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