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/extensions/extension_context_menu_model.h" | 5 #include "chrome/browser/extensions/extension_context_menu_model.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
9 #include "chrome/browser/extensions/extension_system.h" | 9 #include "chrome/browser/extensions/extension_system.h" |
10 #include "chrome/browser/extensions/extension_tab_helper.h" | 10 #include "chrome/browser/extensions/extension_tab_helper.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 return extension->GetHomepageURL().is_valid(); | 76 return extension->GetHomepageURL().is_valid(); |
77 } else if (command_id == INSPECT_POPUP) { | 77 } else if (command_id == INSPECT_POPUP) { |
78 TabContents* tab_contents = chrome::GetActiveTabContents(browser_); | 78 TabContents* tab_contents = chrome::GetActiveTabContents(browser_); |
79 if (!tab_contents) | 79 if (!tab_contents) |
80 return false; | 80 return false; |
81 | 81 |
82 return extension_action_->HasPopup( | 82 return extension_action_->HasPopup( |
83 tab_contents->extension_tab_helper()->tab_id()); | 83 tab_contents->extension_tab_helper()->tab_id()); |
84 } else if (command_id == DISABLE || command_id == UNINSTALL) { | 84 } else if (command_id == DISABLE || command_id == UNINSTALL) { |
85 // Some extension types can not be disabled or uninstalled. | 85 // Some extension types can not be disabled or uninstalled. |
86 return ExtensionSystem::Get( | 86 return extensions::ExtensionSystem::Get( |
87 profile_)->management_policy()->UserMayModifySettings(extension, NULL); | 87 profile_)->management_policy()->UserMayModifySettings(extension, NULL); |
88 } | 88 } |
89 return true; | 89 return true; |
90 } | 90 } |
91 | 91 |
92 bool ExtensionContextMenuModel::GetAcceleratorForCommandId( | 92 bool ExtensionContextMenuModel::GetAcceleratorForCommandId( |
93 int command_id, ui::Accelerator* accelerator) { | 93 int command_id, ui::Accelerator* accelerator) { |
94 return false; | 94 return false; |
95 } | 95 } |
96 | 96 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 if (extension->browser_action()) | 174 if (extension->browser_action()) |
175 AddItemWithStringId(HIDE, IDS_EXTENSIONS_HIDE_BUTTON); | 175 AddItemWithStringId(HIDE, IDS_EXTENSIONS_HIDE_BUTTON); |
176 AddSeparator(); | 176 AddSeparator(); |
177 AddItemWithStringId(MANAGE, IDS_MANAGE_EXTENSIONS); | 177 AddItemWithStringId(MANAGE, IDS_MANAGE_EXTENSIONS); |
178 } | 178 } |
179 | 179 |
180 const Extension* ExtensionContextMenuModel::GetExtension() const { | 180 const Extension* ExtensionContextMenuModel::GetExtension() const { |
181 ExtensionService* extension_service = profile_->GetExtensionService(); | 181 ExtensionService* extension_service = profile_->GetExtensionService(); |
182 return extension_service->GetExtensionById(extension_id_, false); | 182 return extension_service->GetExtensionById(extension_id_, false); |
183 } | 183 } |
OLD | NEW |