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