Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(393)

Side by Side Diff: chrome/browser/extensions/extension_context_menu_model.cc

Issue 10626007: Move ExtensionSystem into extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Master merge; moved class declaration Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698