| 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 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 | 560 |
| 561 if (!browser_->profile()->IsOffTheRecord()) { | 561 if (!browser_->profile()->IsOffTheRecord()) { |
| 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 if (base::win::GetVersion() >= base::win::VERSION_WIN8) { |
| 571 #if defined(USE_AURA) | |
| 572 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && | |
| 573 content::GpuDataManager::GetInstance()->CanUseGpuBrowserCompositor()) { | |
| 574 if (browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) { | 571 if (browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) { |
| 575 // Metro mode, add the 'Relaunch Chrome in desktop mode'. | 572 // Metro mode, add the 'Relaunch Chrome in desktop mode'. |
| 576 AddSeparator(ui::NORMAL_SEPARATOR); | 573 AddSeparator(ui::NORMAL_SEPARATOR); |
| 577 AddItemWithStringId(IDC_WIN8_DESKTOP_RESTART, IDS_WIN8_DESKTOP_RESTART); | 574 AddItemWithStringId(IDC_WIN8_DESKTOP_RESTART, IDS_WIN8_DESKTOP_RESTART); |
| 578 } else { | 575 } else { |
| 579 // In Windows 8 desktop, add the 'Relaunch Chrome in Windows 8 mode'. | 576 // In Windows 8 desktop, add the 'Relaunch Chrome in Windows 8 mode'. |
| 580 AddSeparator(ui::NORMAL_SEPARATOR); | 577 AddSeparator(ui::NORMAL_SEPARATOR); |
| 581 AddItemWithStringId(IDC_WIN8_METRO_RESTART, IDS_WIN8_METRO_RESTART); | 578 AddItemWithStringId(IDC_WIN8_METRO_RESTART, IDS_WIN8_METRO_RESTART); |
| 582 } | 579 } |
| 583 } | 580 } |
| 584 #else | |
| 585 if (base::win::IsMetroProcess()) { | |
| 586 // Metro mode, add the 'Relaunch Chrome in desktop mode'. | |
| 587 AddSeparator(ui::NORMAL_SEPARATOR); | |
| 588 AddItemWithStringId(IDC_WIN8_DESKTOP_RESTART, IDS_WIN8_DESKTOP_RESTART); | |
| 589 } else { | |
| 590 // In Windows 8 desktop, add the 'Relaunch Chrome in Windows 8 mode'. | |
| 591 AddSeparator(ui::NORMAL_SEPARATOR); | |
| 592 AddItemWithStringId(IDC_WIN8_METRO_RESTART, IDS_WIN8_METRO_RESTART); | |
| 593 } | |
| 594 #endif | |
| 595 | |
| 596 #endif | 581 #endif |
| 597 | 582 |
| 598 // Append the full menu including separators. The final separator only gets | 583 // Append the full menu including separators. The final separator only gets |
| 599 // appended when this is a touch menu - otherwise it would get added twice. | 584 // appended when this is a touch menu - otherwise it would get added twice. |
| 600 CreateCutCopyPasteMenu(); | 585 CreateCutCopyPasteMenu(); |
| 601 | 586 |
| 602 if (CommandLine::ForCurrentProcess()->HasSwitch( | 587 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 603 switches::kEnableDomDistiller)) { | 588 switches::kEnableDomDistiller)) { |
| 604 AddItemWithStringId(IDC_DISTILL_PAGE, IDS_DISTILL_PAGE); | 589 AddItemWithStringId(IDC_DISTILL_PAGE, IDS_DISTILL_PAGE); |
| 605 } | 590 } |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 ->GetZoomPercent(); | 780 ->GetZoomPercent(); |
| 796 } | 781 } |
| 797 zoom_label_ = l10n_util::GetStringFUTF16( | 782 zoom_label_ = l10n_util::GetStringFUTF16( |
| 798 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); | 783 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); |
| 799 } | 784 } |
| 800 | 785 |
| 801 void WrenchMenuModel::OnZoomLevelChanged( | 786 void WrenchMenuModel::OnZoomLevelChanged( |
| 802 const content::HostZoomMap::ZoomLevelChange& change) { | 787 const content::HostZoomMap::ZoomLevelChange& change) { |
| 803 UpdateZoomControls(); | 788 UpdateZoomControls(); |
| 804 } | 789 } |
| OLD | NEW |