| 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 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 | 676 |
| 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 case IDC_VIEW_INCOMPATIBILITIES: |
| 686 #if defined(OS_WIN) | 687 #if defined(OS_WIN) |
| 687 case IDC_VIEW_INCOMPATIBILITIES: { | 688 return EnumerateModulesModel::GetInstance()->ShouldShowConflictWarning(); |
| 688 EnumerateModulesModel* loaded_modules = | 689 #else |
| 689 EnumerateModulesModel::GetInstance(); | 690 return false; |
| 690 if (loaded_modules->confirmed_bad_modules_detected() <= 0) | 691 #endif |
| 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: | 692 case IDC_PIN_TO_START_SCREEN: |
| 698 return false; | 693 return false; |
| 699 #else | |
| 700 case IDC_VIEW_INCOMPATIBILITIES: | |
| 701 case IDC_PIN_TO_START_SCREEN: | |
| 702 return false; | |
| 703 #endif | |
| 704 case IDC_UPGRADE_DIALOG: | 694 case IDC_UPGRADE_DIALOG: |
| 705 return browser_defaults::kShowUpgradeMenuItem && | 695 return browser_defaults::kShowUpgradeMenuItem && |
| 706 UpgradeDetector::GetInstance()->notify_upgrade(); | 696 UpgradeDetector::GetInstance()->notify_upgrade(); |
| 707 #if !defined(OS_LINUX) || defined(USE_AURA) | 697 #if !defined(OS_LINUX) || defined(USE_AURA) |
| 708 case IDC_BOOKMARK_PAGE: | 698 case IDC_BOOKMARK_PAGE: |
| 709 return !chrome::ShouldRemoveBookmarkThisPageUI(browser_->profile()); | 699 return !chrome::ShouldRemoveBookmarkThisPageUI(browser_->profile()); |
| 710 case IDC_BOOKMARK_ALL_TABS: | 700 case IDC_BOOKMARK_ALL_TABS: |
| 711 return !chrome::ShouldRemoveBookmarkOpenPagesUI(browser_->profile()); | 701 return !chrome::ShouldRemoveBookmarkOpenPagesUI(browser_->profile()); |
| 712 #endif | 702 #endif |
| 713 default: | 703 default: |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 934 browser_->tab_strip_model()->GetActiveWebContents()) | 924 browser_->tab_strip_model()->GetActiveWebContents()) |
| 935 ->GetZoomPercent(); | 925 ->GetZoomPercent(); |
| 936 } | 926 } |
| 937 zoom_label_ = base::FormatPercent(zoom_percent); | 927 zoom_label_ = base::FormatPercent(zoom_percent); |
| 938 } | 928 } |
| 939 | 929 |
| 940 void AppMenuModel::OnZoomLevelChanged( | 930 void AppMenuModel::OnZoomLevelChanged( |
| 941 const content::HostZoomMap::ZoomLevelChange& change) { | 931 const content::HostZoomMap::ZoomLevelChange& change) { |
| 942 UpdateZoomControls(); | 932 UpdateZoomControls(); |
| 943 } | 933 } |
| OLD | NEW |