summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser.cc
diff options
context:
space:
mode:
authorbeng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-31 22:41:28 +0000
committerbeng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-31 22:41:28 +0000
commit195442ebb93e6c6246583250fa4a0dcbb3cec7d0 (patch)
treeff402b20fdc82e749860ac6ef866fd932e5cd5b6 /chrome/browser/browser.cc
parent7451693da9a8b91ff52d4394e3f106e1687fefd2 (diff)
downloadchromium_src-195442ebb93e6c6246583250fa4a0dcbb3cec7d0.zip
chromium_src-195442ebb93e6c6246583250fa4a0dcbb3cec7d0.tar.gz
chromium_src-195442ebb93e6c6246583250fa4a0dcbb3cec7d0.tar.bz2
Move BrowserToolbarView to the frames (XPFrame/VistaFrame).
This causes some temporary duplication of code in xp/vista frames but it will be temporary. My goal is to move all the top level browser level views into the frames. From there, I will move them from the frames into their new home - BrowserView (chrome/browser/views/frames/browser_view.cc), and each frame will host a BrowserView. This will reduce duplication of code. To make this change I had to add a bunch of methods to the BrowserWindow (nee ChromeFrame) interface to provide access to some of the toolbar's contents. Excuse the ugly API, we will be improving this incrementally. B=1031854 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser.cc')
-rw-r--r--chrome/browser/browser.cc23
1 files changed, 5 insertions, 18 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index fa76bd9..cec09dd 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -211,7 +211,6 @@ Browser::Browser(const gfx::Rect& initial_bounds,
initial_show_command_(show_command),
is_processing_tab_unload_events_(false),
controller_(this),
- toolbar_(&controller_, this),
chrome_updater_factory_(this),
method_factory_(this),
hung_window_detector_(&hung_plugin_action_),
@@ -235,9 +234,6 @@ Browser::Browser(const gfx::Rect& initial_bounds,
initial_show_command_ = SW_SHOWMAXIMIZED;
window_ = FrameUtil::CreateBrowserWindow(create_bounds, this);
- toolbar_.SetID(VIEW_ID_TOOLBAR);
- toolbar_.Init(profile_);
-
// See note where SIZE_TO_CONTENTS is defined in browser.h for an explanation
// of this hack.
if (show_command == SIZE_TO_CONTENTS) {
@@ -308,11 +304,6 @@ Browser::~Browser() {
NotificationService::AllSources());
ChromeViews::View* p;
- // Remove our main views from the view hierarchy to prevent
- // a double delete (the Browser is deleted before the RootView that contains
- // the toolbar and tab_strip).
- if ((p = toolbar_.GetParent()))
- p->RemoveChildView(&toolbar_);
if (bookmark_bar_view_.get() && (p = bookmark_bar_view_->GetParent()))
p->RemoveChildView(bookmark_bar_view_.get());
@@ -370,10 +361,6 @@ void Browser::CloseFrame() {
window_->Close();
}
-ChromeViews::View* Browser::GetToolbar() {
- return &toolbar_;
-}
-
GURL Browser::GetHomePage() {
if (profile_->GetPrefs()->GetBoolean(prefs::kHomePageIsNewTabPage)) {
return NewTabUIURL();
@@ -414,14 +401,14 @@ void Browser::WindowActivationChanged(bool is_active) {
// Toolbar creation, management
LocationBarView* Browser::GetLocationBarView() const {
- return toolbar_.GetLocationBarView();
+ return window_->GetLocationBarView();
}
////////////////////////////////////////////////////////////////////////////////
// Chrome update coalescing
void Browser::UpdateToolBar(bool should_restore_state) {
- toolbar_.Update(GetSelectedTabContents(), should_restore_state);
+ window_->Update(GetSelectedTabContents(), should_restore_state);
}
void Browser::ScheduleUIUpdate(const TabContents* source,
@@ -903,11 +890,11 @@ void Browser::UpdateTargetURL(TabContents* source, const GURL& url) {
}
void Browser::SetStarredButtonToggled(bool starred) {
- toolbar_.star_button()->SetToggled(starred);
+ window_->GetStarButton()->SetToggled(starred);
}
GoButton* Browser::GetGoButton() {
- return toolbar_.GetGoButton();
+ return window_->GetGoButton();
}
void Browser::ContentsZoomChange(bool zoom_in) {
@@ -1417,7 +1404,7 @@ void Browser::TabSelectedAt(TabContents* old_contents,
new_contents->RestoreFocus();
// Propagate the profile to the location bar.
- toolbar_.SetProfile(new_contents->profile());
+ window_->ProfileChanged(new_contents->profile());
UpdateToolBar(true);
// Force the go/stop button to change.