Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(915)

Side by Side Diff: chrome/browser/ui/views/toolbar_view.cc

Issue 9479008: Re-factor location bar/toolbar code to get rid of the browser dependency. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win fix Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/toolbar_view.h" 5 #include "chrome/browser/ui/views/toolbar_view.h"
6 6
7 #include "base/i18n/number_formatting.h" 7 #include "base/i18n/number_formatting.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/browser/prefs/pref_service.h" 10 #include "chrome/browser/prefs/pref_service.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 149
150 forward_ = new views::ButtonDropDown(this, forward_menu_model_.get()); 150 forward_ = new views::ButtonDropDown(this, forward_menu_model_.get());
151 forward_->set_triggerable_event_flags(ui::EF_LEFT_MOUSE_BUTTON | 151 forward_->set_triggerable_event_flags(ui::EF_LEFT_MOUSE_BUTTON |
152 ui::EF_MIDDLE_MOUSE_BUTTON); 152 ui::EF_MIDDLE_MOUSE_BUTTON);
153 forward_->set_tag(IDC_FORWARD); 153 forward_->set_tag(IDC_FORWARD);
154 forward_->SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_FORWARD)); 154 forward_->SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_FORWARD));
155 forward_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_FORWARD)); 155 forward_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_FORWARD));
156 forward_->set_id(VIEW_ID_FORWARD_BUTTON); 156 forward_->set_id(VIEW_ID_FORWARD_BUTTON);
157 157
158 // Have to create this before |reload_| as |reload_|'s constructor needs it. 158 // Have to create this before |reload_| as |reload_|'s constructor needs it.
159 location_bar_ = new LocationBarView(browser_, model_, this, 159 location_bar_ = new LocationBarView(browser_->profile(),
160 browser_->command_updater(), model_, this,
160 (display_mode_ == DISPLAYMODE_LOCATION) ? 161 (display_mode_ == DISPLAYMODE_LOCATION) ?
161 LocationBarView::POPUP : LocationBarView::NORMAL); 162 LocationBarView::POPUP : LocationBarView::NORMAL);
162 163
163 reload_ = new ReloadButton(location_bar_, browser_); 164 reload_ = new ReloadButton(location_bar_, browser_->command_updater());
164 reload_->set_triggerable_event_flags(ui::EF_LEFT_MOUSE_BUTTON | 165 reload_->set_triggerable_event_flags(ui::EF_LEFT_MOUSE_BUTTON |
165 ui::EF_MIDDLE_MOUSE_BUTTON); 166 ui::EF_MIDDLE_MOUSE_BUTTON);
166 reload_->set_tag(IDC_RELOAD); 167 reload_->set_tag(IDC_RELOAD);
167 reload_->SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_RELOAD)); 168 reload_->SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_RELOAD));
168 reload_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_RELOAD)); 169 reload_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_RELOAD));
169 reload_->set_id(VIEW_ID_RELOAD_BUTTON); 170 reload_->set_id(VIEW_ID_RELOAD_BUTTON);
170 171
171 home_ = new views::ImageButton(this); 172 home_ = new views::ImageButton(this);
172 home_->set_triggerable_event_flags(ui::EF_LEFT_MOUSE_BUTTON | 173 home_->set_triggerable_event_flags(ui::EF_LEFT_MOUSE_BUTTON |
173 ui::EF_MIDDLE_MOUSE_BUTTON); 174 ui::EF_MIDDLE_MOUSE_BUTTON);
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 accname_app = l10n_util::GetStringFUTF16( 734 accname_app = l10n_util::GetStringFUTF16(
734 IDS_ACCNAME_APP_UPGRADE_RECOMMENDED, accname_app); 735 IDS_ACCNAME_APP_UPGRADE_RECOMMENDED, accname_app);
735 } 736 }
736 app_menu_->SetAccessibleName(accname_app); 737 app_menu_->SetAccessibleName(accname_app);
737 738
738 app_menu_->SetIcon(GetAppMenuIcon(views::CustomButton::BS_NORMAL)); 739 app_menu_->SetIcon(GetAppMenuIcon(views::CustomButton::BS_NORMAL));
739 app_menu_->SetHoverIcon(GetAppMenuIcon(views::CustomButton::BS_HOT)); 740 app_menu_->SetHoverIcon(GetAppMenuIcon(views::CustomButton::BS_HOT));
740 app_menu_->SetPushedIcon(GetAppMenuIcon(views::CustomButton::BS_PUSHED)); 741 app_menu_->SetPushedIcon(GetAppMenuIcon(views::CustomButton::BS_PUSHED));
741 SchedulePaint(); 742 SchedulePaint();
742 } 743 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698