summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/views/toolbar_view.cc
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-08 21:31:12 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-08 21:31:12 +0000
commite09f079d2a247ae24f52075bc8bcc446b2838ddf (patch)
treeec6225f1a76596d40b315897a2e804fff579ab4e /chrome/browser/ui/views/toolbar_view.cc
parentedbe8a4d27175be21a21cba4f77aeeb45e627db1 (diff)
downloadchromium_src-e09f079d2a247ae24f52075bc8bcc446b2838ddf.zip
chromium_src-e09f079d2a247ae24f52075bc8bcc446b2838ddf.tar.gz
chromium_src-e09f079d2a247ae24f52075bc8bcc446b2838ddf.tar.bz2
Remove frontend code that allows for dynamic profile setting, and read the profile off the browser where possible. This matches common practice and various invariants that expect profiles to be constant for the life of the browser.
BUG=none TEST=none Review URL: http://codereview.chromium.org/7574021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95889 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/views/toolbar_view.cc')
-rw-r--r--chrome/browser/ui/views/toolbar_view.cc19
1 files changed, 5 insertions, 14 deletions
diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc
index e9159b6..1452c96 100644
--- a/chrome/browser/ui/views/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar_view.cc
@@ -87,7 +87,6 @@ ToolbarView::ToolbarView(Browser* browser)
location_bar_(NULL),
browser_actions_(NULL),
app_menu_(NULL),
- profile_(NULL),
browser_(browser),
profiles_menu_contents_(NULL) {
set_id(VIEW_ID_TOOLBAR);
@@ -117,7 +116,7 @@ ToolbarView::~ToolbarView() {
// already gone.
}
-void ToolbarView::Init(Profile* profile) {
+void ToolbarView::Init() {
back_menu_model_.reset(new BackForwardMenuModel(
browser_, BackForwardMenuModel::BACKWARD_MENU));
forward_menu_model_.reset(new BackForwardMenuModel(
@@ -144,8 +143,8 @@ void ToolbarView::Init(Profile* profile) {
forward_->set_id(VIEW_ID_FORWARD_BUTTON);
// Have to create this before |reload_| as |reload_|'s constructor needs it.
- location_bar_ = new LocationBarView(profile, browser_,
- model_, this, (display_mode_ == DISPLAYMODE_LOCATION) ?
+ location_bar_ = new LocationBarView(browser_, model_, this,
+ (display_mode_ == DISPLAYMODE_LOCATION) ?
LocationBarView::POPUP : LocationBarView::NORMAL);
reload_ = new ReloadButton(location_bar_, browser_);
@@ -197,11 +196,10 @@ void ToolbarView::Init(Profile* profile) {
AddChildView(app_menu_);
location_bar_->Init();
- show_home_button_.Init(prefs::kShowHomeButton, profile->GetPrefs(), this);
+ show_home_button_.Init(prefs::kShowHomeButton,
+ browser_->profile()->GetPrefs(), this);
browser_actions_->Init();
- SetProfile(profile);
-
// Accessibility specific tooltip text.
if (BrowserAccessibilityState::GetInstance()->IsAccessibleBrowser()) {
back_->SetTooltipText(
@@ -211,13 +209,6 @@ void ToolbarView::Init(Profile* profile) {
}
}
-void ToolbarView::SetProfile(Profile* profile) {
- if (profile != profile_) {
- profile_ = profile;
- location_bar_->SetProfile(profile);
- }
-}
-
void ToolbarView::Update(TabContents* tab, bool should_restore_state) {
if (location_bar_)
location_bar_->Update(should_restore_state ? tab : NULL);