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 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 return chrome::IsCommandEnabled(browser_, command_id); | 683 return chrome::IsCommandEnabled(browser_, command_id); |
684 } | 684 } |
685 | 685 |
686 bool AppMenuModel::IsCommandIdVisible(int command_id) const { | 686 bool AppMenuModel::IsCommandIdVisible(int command_id) const { |
687 switch (command_id) { | 687 switch (command_id) { |
688 #if defined(OS_MACOSX) | 688 #if defined(OS_MACOSX) |
689 case kEmptyMenuItemCommand: | 689 case kEmptyMenuItemCommand: |
690 return false; // Always hidden (see CreateActionToolbarOverflowMenu). | 690 return false; // Always hidden (see CreateActionToolbarOverflowMenu). |
691 #endif | 691 #endif |
692 #if defined(OS_WIN) | 692 #if defined(OS_WIN) |
693 case IDC_VIEW_INCOMPATIBILITIES: { | 693 case IDC_VIEW_INCOMPATIBILITIES: |
694 EnumerateModulesModel* loaded_modules = | 694 return EnumerateModulesModel::GetInstance()->ShouldShowConflictWarning(); |
695 EnumerateModulesModel::GetInstance(); | |
696 if (loaded_modules->confirmed_bad_modules_detected() <= 0) | |
697 return false; | |
698 // We'll leave the app menu adornment on until the user clicks the link. | |
699 if (loaded_modules->modules_to_notify_about() <= 0) | |
700 loaded_modules->AcknowledgeConflictNotification(); | |
701 return true; | |
702 } | |
703 case IDC_PIN_TO_START_SCREEN: | 695 case IDC_PIN_TO_START_SCREEN: |
704 return false; | 696 return false; |
705 #else | 697 #else |
706 case IDC_VIEW_INCOMPATIBILITIES: | 698 case IDC_VIEW_INCOMPATIBILITIES: |
707 case IDC_PIN_TO_START_SCREEN: | 699 case IDC_PIN_TO_START_SCREEN: |
708 return false; | 700 return false; |
709 #endif | 701 #endif |
710 case IDC_UPGRADE_DIALOG: | 702 case IDC_UPGRADE_DIALOG: |
711 return browser_defaults::kShowUpgradeMenuItem && | 703 return browser_defaults::kShowUpgradeMenuItem && |
712 UpgradeDetector::GetInstance()->notify_upgrade(); | 704 UpgradeDetector::GetInstance()->notify_upgrade(); |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 browser_->tab_strip_model()->GetActiveWebContents()) | 931 browser_->tab_strip_model()->GetActiveWebContents()) |
940 ->GetZoomPercent(); | 932 ->GetZoomPercent(); |
941 } | 933 } |
942 zoom_label_ = base::FormatPercent(zoom_percent); | 934 zoom_label_ = base::FormatPercent(zoom_percent); |
943 } | 935 } |
944 | 936 |
945 void AppMenuModel::OnZoomLevelChanged( | 937 void AppMenuModel::OnZoomLevelChanged( |
946 const content::HostZoomMap::ZoomLevelChange& change) { | 938 const content::HostZoomMap::ZoomLevelChange& change) { |
947 UpdateZoomControls(); | 939 UpdateZoomControls(); |
948 } | 940 } |
OLD | NEW |