OLD | NEW |
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/toolbar/wrench_menu_model.h" | 5 #include "chrome/browser/ui/toolbar/wrench_menu_model.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 #include "chrome/browser/ui/toolbar/bookmark_sub_menu_model.h" | 34 #include "chrome/browser/ui/toolbar/bookmark_sub_menu_model.h" |
35 #include "chrome/browser/ui/toolbar/encoding_menu_controller.h" | 35 #include "chrome/browser/ui/toolbar/encoding_menu_controller.h" |
36 #include "chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.h" | 36 #include "chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.h" |
37 #include "chrome/browser/ui/zoom/zoom_controller.h" | 37 #include "chrome/browser/ui/zoom/zoom_controller.h" |
38 #include "chrome/browser/ui/zoom/zoom_event_manager.h" | 38 #include "chrome/browser/ui/zoom/zoom_event_manager.h" |
39 #include "chrome/browser/upgrade_detector.h" | 39 #include "chrome/browser/upgrade_detector.h" |
40 #include "chrome/common/chrome_paths.h" | 40 #include "chrome/common/chrome_paths.h" |
41 #include "chrome/common/chrome_switches.h" | 41 #include "chrome/common/chrome_switches.h" |
42 #include "chrome/common/pref_names.h" | 42 #include "chrome/common/pref_names.h" |
43 #include "chrome/common/profiling.h" | 43 #include "chrome/common/profiling.h" |
| 44 #include "chrome/grit/chromium_strings.h" |
| 45 #include "chrome/grit/generated_resources.h" |
44 #include "components/signin/core/browser/signin_manager.h" | 46 #include "components/signin/core/browser/signin_manager.h" |
45 #include "components/signin/core/common/profile_management_switches.h" | 47 #include "components/signin/core/common/profile_management_switches.h" |
46 #include "content/public/browser/host_zoom_map.h" | 48 #include "content/public/browser/host_zoom_map.h" |
47 #include "content/public/browser/navigation_entry.h" | 49 #include "content/public/browser/navigation_entry.h" |
48 #include "content/public/browser/notification_service.h" | 50 #include "content/public/browser/notification_service.h" |
49 #include "content/public/browser/notification_source.h" | 51 #include "content/public/browser/notification_source.h" |
50 #include "content/public/browser/notification_types.h" | 52 #include "content/public/browser/notification_types.h" |
51 #include "content/public/browser/user_metrics.h" | 53 #include "content/public/browser/user_metrics.h" |
52 #include "content/public/browser/web_contents.h" | 54 #include "content/public/browser/web_contents.h" |
53 #include "extensions/common/feature_switch.h" | 55 #include "extensions/common/feature_switch.h" |
54 #include "grit/chromium_strings.h" | |
55 #include "grit/generated_resources.h" | |
56 #include "grit/theme_resources.h" | 56 #include "grit/theme_resources.h" |
57 #include "ui/base/l10n/l10n_util.h" | 57 #include "ui/base/l10n/l10n_util.h" |
58 #include "ui/base/layout.h" | 58 #include "ui/base/layout.h" |
59 #include "ui/base/models/button_menu_item_model.h" | 59 #include "ui/base/models/button_menu_item_model.h" |
60 #include "ui/base/resource/resource_bundle.h" | 60 #include "ui/base/resource/resource_bundle.h" |
61 #include "ui/gfx/image/image.h" | 61 #include "ui/gfx/image/image.h" |
62 #include "ui/gfx/image/image_skia.h" | 62 #include "ui/gfx/image/image_skia.h" |
63 | 63 |
64 #if defined(OS_CHROMEOS) | 64 #if defined(OS_CHROMEOS) |
65 #include "chromeos/chromeos_switches.h" | 65 #include "chromeos/chromeos_switches.h" |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 recent_tabs_sub_menu_model_.reset(new RecentTabsSubMenuModel(provider_, | 562 recent_tabs_sub_menu_model_.reset(new RecentTabsSubMenuModel(provider_, |
563 browser_, | 563 browser_, |
564 NULL)); | 564 NULL)); |
565 AddSubMenuWithStringId(IDC_RECENT_TABS_MENU, IDS_RECENT_TABS_MENU, | 565 AddSubMenuWithStringId(IDC_RECENT_TABS_MENU, IDS_RECENT_TABS_MENU, |
566 recent_tabs_sub_menu_model_.get()); | 566 recent_tabs_sub_menu_model_.get()); |
567 } | 567 } |
568 | 568 |
569 #if defined(OS_WIN) | 569 #if defined(OS_WIN) |
570 | 570 |
571 #if defined(USE_AURA) | 571 #if defined(USE_AURA) |
572 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && | 572 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && |
573 content::GpuDataManager::GetInstance()->CanUseGpuBrowserCompositor()) { | 573 content::GpuDataManager::GetInstance()->CanUseGpuBrowserCompositor()) { |
574 if (browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) { | 574 if (browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) { |
575 // Metro mode, add the 'Relaunch Chrome in desktop mode'. | 575 // Metro mode, add the 'Relaunch Chrome in desktop mode'. |
576 AddSeparator(ui::NORMAL_SEPARATOR); | 576 AddSeparator(ui::NORMAL_SEPARATOR); |
577 AddItemWithStringId(IDC_WIN8_DESKTOP_RESTART, IDS_WIN8_DESKTOP_RESTART); | 577 AddItemWithStringId(IDC_WIN8_DESKTOP_RESTART, IDS_WIN8_DESKTOP_RESTART); |
578 } else { | 578 } else { |
579 // In Windows 8 desktop, add the 'Relaunch Chrome in Windows 8 mode'. | 579 // In Windows 8 desktop, add the 'Relaunch Chrome in Windows 8 mode'. |
580 AddSeparator(ui::NORMAL_SEPARATOR); | 580 AddSeparator(ui::NORMAL_SEPARATOR); |
581 AddItemWithStringId(IDC_WIN8_METRO_RESTART, IDS_WIN8_METRO_RESTART); | 581 AddItemWithStringId(IDC_WIN8_METRO_RESTART, IDS_WIN8_METRO_RESTART); |
582 } | 582 } |
583 } | 583 } |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 ->GetZoomPercent(); | 795 ->GetZoomPercent(); |
796 } | 796 } |
797 zoom_label_ = l10n_util::GetStringFUTF16( | 797 zoom_label_ = l10n_util::GetStringFUTF16( |
798 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); | 798 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); |
799 } | 799 } |
800 | 800 |
801 void WrenchMenuModel::OnZoomLevelChanged( | 801 void WrenchMenuModel::OnZoomLevelChanged( |
802 const content::HostZoomMap::ZoomLevelChange& change) { | 802 const content::HostZoomMap::ZoomLevelChange& change) { |
803 UpdateZoomControls(); | 803 UpdateZoomControls(); |
804 } | 804 } |
OLD | NEW |