| 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 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 | 551 |
| 552 if (!browser_->profile()->IsOffTheRecord()) { | 552 if (!browser_->profile()->IsOffTheRecord()) { |
| 553 recent_tabs_sub_menu_model_.reset(new RecentTabsSubMenuModel(provider_, | 553 recent_tabs_sub_menu_model_.reset(new RecentTabsSubMenuModel(provider_, |
| 554 browser_, | 554 browser_, |
| 555 NULL)); | 555 NULL)); |
| 556 AddSubMenuWithStringId(IDC_RECENT_TABS_MENU, IDS_RECENT_TABS_MENU, | 556 AddSubMenuWithStringId(IDC_RECENT_TABS_MENU, IDS_RECENT_TABS_MENU, |
| 557 recent_tabs_sub_menu_model_.get()); | 557 recent_tabs_sub_menu_model_.get()); |
| 558 } | 558 } |
| 559 | 559 |
| 560 #if defined(OS_WIN) | 560 #if defined(OS_WIN) |
| 561 if (base::win::GetVersion() >= base::win::VERSION_WIN7 && | 561 // Windows 8 can support ASH mode using WARP, but Windows 7 requires a working |
| 562 content::GpuDataManager::GetInstance()->CanUseGpuBrowserCompositor()) { | 562 // GPU compositor. |
| 563 if ((base::win::GetVersion() >= base::win::VERSION_WIN7 && |
| 564 content::GpuDataManager::GetInstance()->CanUseGpuBrowserCompositor()) || |
| 565 (base::win::GetVersion() >= base::win::VERSION_WIN8)) { |
| 563 if (browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) { | 566 if (browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) { |
| 564 // ASH/Metro mode, add the 'Relaunch Chrome in desktop mode'. | 567 // ASH/Metro mode, add the 'Relaunch Chrome in desktop mode'. |
| 565 AddSeparator(ui::NORMAL_SEPARATOR); | 568 AddSeparator(ui::NORMAL_SEPARATOR); |
| 566 AddItemWithStringId(IDC_WIN_DESKTOP_RESTART, IDS_WIN_DESKTOP_RESTART); | 569 AddItemWithStringId(IDC_WIN_DESKTOP_RESTART, IDS_WIN_DESKTOP_RESTART); |
| 567 } else { | 570 } else { |
| 568 // In Windows 8 desktop, add the 'Relaunch Chrome in Windows 8 mode'. | 571 // In Windows 8 desktop, add the 'Relaunch Chrome in Windows 8 mode'. |
| 569 // In Windows 7 desktop, add the 'Relaunch Chrome in Windows ASH mode' | 572 // In Windows 7 desktop, add the 'Relaunch Chrome in Windows ASH mode' |
| 570 AddSeparator(ui::NORMAL_SEPARATOR); | 573 AddSeparator(ui::NORMAL_SEPARATOR); |
| 571 if (base::win::GetVersion() >= base::win::VERSION_WIN8) { | 574 if (base::win::GetVersion() >= base::win::VERSION_WIN8) { |
| 572 AddItemWithStringId(IDC_WIN8_METRO_RESTART, IDS_WIN8_METRO_RESTART); | 575 AddItemWithStringId(IDC_WIN8_METRO_RESTART, IDS_WIN8_METRO_RESTART); |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 ->GetZoomPercent(); | 780 ->GetZoomPercent(); |
| 778 } | 781 } |
| 779 zoom_label_ = l10n_util::GetStringFUTF16( | 782 zoom_label_ = l10n_util::GetStringFUTF16( |
| 780 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); | 783 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); |
| 781 } | 784 } |
| 782 | 785 |
| 783 void WrenchMenuModel::OnZoomLevelChanged( | 786 void WrenchMenuModel::OnZoomLevelChanged( |
| 784 const content::HostZoomMap::ZoomLevelChange& change) { | 787 const content::HostZoomMap::ZoomLevelChange& change) { |
| 785 UpdateZoomControls(); | 788 UpdateZoomControls(); |
| 786 } | 789 } |
| OLD | NEW |