OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/command_updater.h" | 10 #include "chrome/browser/command_updater.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "chrome/browser/ui/browser_window.h" | 21 #include "chrome/browser/ui/browser_window.h" |
22 #include "chrome/browser/ui/global_error/global_error_service.h" | 22 #include "chrome/browser/ui/global_error/global_error_service.h" |
23 #include "chrome/browser/ui/global_error/global_error_service_factory.h" | 23 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
24 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 24 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
25 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 25 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
26 #include "chrome/browser/ui/toolbar/wrench_menu_model.h" | 26 #include "chrome/browser/ui/toolbar/wrench_menu_model.h" |
27 #include "chrome/browser/ui/view_ids.h" | 27 #include "chrome/browser/ui/view_ids.h" |
28 #include "chrome/browser/ui/views/browser_actions_container.h" | 28 #include "chrome/browser/ui/views/browser_actions_container.h" |
29 #include "chrome/browser/ui/views/extensions/disabled_extensions_view.h" | 29 #include "chrome/browser/ui/views/extensions/disabled_extensions_view.h" |
30 #include "chrome/browser/ui/views/frame/browser_view.h" | 30 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 31 #include "chrome/browser/ui/views/home_button.h" |
31 #include "chrome/browser/ui/views/location_bar/page_action_image_view.h" | 32 #include "chrome/browser/ui/views/location_bar/page_action_image_view.h" |
32 #include "chrome/browser/ui/views/location_bar/star_view.h" | 33 #include "chrome/browser/ui/views/location_bar/star_view.h" |
33 #include "chrome/browser/ui/views/wrench_menu.h" | 34 #include "chrome/browser/ui/views/wrench_menu.h" |
34 #include "chrome/browser/upgrade_detector.h" | 35 #include "chrome/browser/upgrade_detector.h" |
35 #include "chrome/common/chrome_notification_types.h" | 36 #include "chrome/common/chrome_notification_types.h" |
36 #include "chrome/common/pref_names.h" | 37 #include "chrome/common/pref_names.h" |
37 #include "content/public/browser/browser_accessibility_state.h" | 38 #include "content/public/browser/browser_accessibility_state.h" |
38 #include "content/public/browser/notification_service.h" | 39 #include "content/public/browser/notification_service.h" |
39 #include "content/public/browser/render_view_host.h" | 40 #include "content/public/browser/render_view_host.h" |
40 #include "content/public/browser/user_metrics.h" | 41 #include "content/public/browser/user_metrics.h" |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 LocationBarView::POPUP : LocationBarView::NORMAL); | 240 LocationBarView::POPUP : LocationBarView::NORMAL); |
240 | 241 |
241 reload_ = new ReloadButton(location_bar_, | 242 reload_ = new ReloadButton(location_bar_, |
242 browser_->command_controller()->command_updater()); | 243 browser_->command_controller()->command_updater()); |
243 reload_->set_triggerable_event_flags(ui::EF_LEFT_MOUSE_BUTTON | | 244 reload_->set_triggerable_event_flags(ui::EF_LEFT_MOUSE_BUTTON | |
244 ui::EF_MIDDLE_MOUSE_BUTTON); | 245 ui::EF_MIDDLE_MOUSE_BUTTON); |
245 reload_->set_tag(IDC_RELOAD); | 246 reload_->set_tag(IDC_RELOAD); |
246 reload_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_RELOAD)); | 247 reload_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_RELOAD)); |
247 reload_->set_id(VIEW_ID_RELOAD_BUTTON); | 248 reload_->set_id(VIEW_ID_RELOAD_BUTTON); |
248 | 249 |
249 home_ = new views::ImageButton(this); | 250 home_ = new HomeImageButton(this, browser_); |
250 home_->set_triggerable_event_flags(ui::EF_LEFT_MOUSE_BUTTON | | 251 home_->set_triggerable_event_flags(ui::EF_LEFT_MOUSE_BUTTON | |
251 ui::EF_MIDDLE_MOUSE_BUTTON); | 252 ui::EF_MIDDLE_MOUSE_BUTTON); |
252 home_->set_tag(IDC_HOME); | 253 home_->set_tag(IDC_HOME); |
253 home_->SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_HOME)); | 254 home_->SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_HOME)); |
254 home_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_HOME)); | 255 home_->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_HOME)); |
255 home_->set_id(VIEW_ID_HOME_BUTTON); | 256 home_->set_id(VIEW_ID_HOME_BUTTON); |
256 | 257 |
257 browser_actions_ = new BrowserActionsContainer(browser_, this); | 258 browser_actions_ = new BrowserActionsContainer(browser_, this); |
258 | 259 |
259 #if defined(OS_WIN) && !defined(USE_AURA) | 260 #if defined(OS_WIN) && !defined(USE_AURA) |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 app_menu_->SetIcon(GetAppMenuIcon(views::CustomButton::STATE_NORMAL)); | 905 app_menu_->SetIcon(GetAppMenuIcon(views::CustomButton::STATE_NORMAL)); |
905 app_menu_->SetHoverIcon(GetAppMenuIcon(views::CustomButton::STATE_HOVERED)); | 906 app_menu_->SetHoverIcon(GetAppMenuIcon(views::CustomButton::STATE_HOVERED)); |
906 app_menu_->SetPushedIcon(GetAppMenuIcon(views::CustomButton::STATE_PRESSED)); | 907 app_menu_->SetPushedIcon(GetAppMenuIcon(views::CustomButton::STATE_PRESSED)); |
907 SchedulePaint(); | 908 SchedulePaint(); |
908 } | 909 } |
909 | 910 |
910 void ToolbarView::OnShowHomeButtonChanged() { | 911 void ToolbarView::OnShowHomeButtonChanged() { |
911 Layout(); | 912 Layout(); |
912 SchedulePaint(); | 913 SchedulePaint(); |
913 } | 914 } |
OLD | NEW |