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/app_menu_model.h" | 5 #include "chrome/browser/ui/toolbar/app_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 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
677 return chrome::IsCommandEnabled(browser_, command_id); | 677 return chrome::IsCommandEnabled(browser_, command_id); |
678 } | 678 } |
679 | 679 |
680 bool AppMenuModel::IsCommandIdVisible(int command_id) const { | 680 bool AppMenuModel::IsCommandIdVisible(int command_id) const { |
681 switch (command_id) { | 681 switch (command_id) { |
682 #if defined(OS_MACOSX) | 682 #if defined(OS_MACOSX) |
683 case kEmptyMenuItemCommand: | 683 case kEmptyMenuItemCommand: |
684 return false; // Always hidden (see CreateActionToolbarOverflowMenu). | 684 return false; // Always hidden (see CreateActionToolbarOverflowMenu). |
685 #endif | 685 #endif |
686 #if defined(OS_WIN) | 686 #if defined(OS_WIN) |
687 case IDC_VIEW_INCOMPATIBILITIES: { | 687 case IDC_VIEW_INCOMPATIBILITIES: |
688 EnumerateModulesModel* loaded_modules = | 688 return EnumerateModulesModel::GetInstance()->ShouldShowConflictWarning(); |
689 EnumerateModulesModel::GetInstance(); | |
690 if (loaded_modules->confirmed_bad_modules_detected() <= 0) | |
691 return false; | |
692 // We'll leave the app menu adornment on until the user clicks the link. | |
693 if (loaded_modules->modules_to_notify_about() <= 0) | |
694 loaded_modules->AcknowledgeConflictNotification(); | |
695 return true; | |
696 } | |
697 case IDC_PIN_TO_START_SCREEN: | 689 case IDC_PIN_TO_START_SCREEN: |
698 return false; | 690 return false; |
Peter Kasting
2016/08/05 00:10:08
Nit: Could factor IDC_PIN_TO_START_SCREEN out of t
chrisha
2016/08/12 19:04:40
Thanks for the suggestion. Went the less fragile r
| |
699 #else | 691 #else |
700 case IDC_VIEW_INCOMPATIBILITIES: | 692 case IDC_VIEW_INCOMPATIBILITIES: |
701 case IDC_PIN_TO_START_SCREEN: | 693 case IDC_PIN_TO_START_SCREEN: |
702 return false; | 694 return false; |
703 #endif | 695 #endif |
704 case IDC_UPGRADE_DIALOG: | 696 case IDC_UPGRADE_DIALOG: |
705 return browser_defaults::kShowUpgradeMenuItem && | 697 return browser_defaults::kShowUpgradeMenuItem && |
706 UpgradeDetector::GetInstance()->notify_upgrade(); | 698 UpgradeDetector::GetInstance()->notify_upgrade(); |
707 #if !defined(OS_LINUX) || defined(USE_AURA) | 699 #if !defined(OS_LINUX) || defined(USE_AURA) |
708 case IDC_BOOKMARK_PAGE: | 700 case IDC_BOOKMARK_PAGE: |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
934 browser_->tab_strip_model()->GetActiveWebContents()) | 926 browser_->tab_strip_model()->GetActiveWebContents()) |
935 ->GetZoomPercent(); | 927 ->GetZoomPercent(); |
936 } | 928 } |
937 zoom_label_ = base::FormatPercent(zoom_percent); | 929 zoom_label_ = base::FormatPercent(zoom_percent); |
938 } | 930 } |
939 | 931 |
940 void AppMenuModel::OnZoomLevelChanged( | 932 void AppMenuModel::OnZoomLevelChanged( |
941 const content::HostZoomMap::ZoomLevelChange& change) { | 933 const content::HostZoomMap::ZoomLevelChange& change) { |
942 UpdateZoomControls(); | 934 UpdateZoomControls(); |
943 } | 935 } |
OLD | NEW |