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

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

Issue 10378117: With enable-action-box add extensions to BrowserActionContainer only if they have preference kBrows… (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_prefs.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_tab_util.h" 9 #include "chrome/browser/extensions/extension_tab_util.h"
10 #include "chrome/browser/prefs/pref_service.h" 10 #include "chrome/browser/prefs/pref_service.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 browser_->OpenURL(params); 87 browser_->OpenURL(params);
88 break; 88 break;
89 } 89 }
90 case CONFIGURE: 90 case CONFIGURE:
91 DCHECK(!extension->options_url().is_empty()); 91 DCHECK(!extension->options_url().is_empty());
92 profile_->GetExtensionProcessManager()->OpenOptionsPage(extension, 92 profile_->GetExtensionProcessManager()->OpenOptionsPage(extension,
93 browser_); 93 browser_);
94 break; 94 break;
95 case HIDE: { 95 case HIDE: {
96 ExtensionService* extension_service = profile_->GetExtensionService(); 96 ExtensionService* extension_service = profile_->GetExtensionService();
97 extension_service->SetBrowserActionVisibility(extension, false); 97 extension_service->extension_prefs()->
98 SetBrowserActionVisibility(extension, false);
98 break; 99 break;
99 } 100 }
100 case DISABLE: { 101 case DISABLE: {
101 ExtensionService* extension_service = profile_->GetExtensionService(); 102 ExtensionService* extension_service = profile_->GetExtensionService();
102 extension_service->DisableExtension(extension_id_, 103 extension_service->DisableExtension(extension_id_,
103 Extension::DISABLE_USER_ACTION); 104 Extension::DISABLE_USER_ACTION);
104 break; 105 break;
105 } 106 }
106 case UNINSTALL: { 107 case UNINSTALL: {
107 AddRef(); // Balanced in Accepted() and Canceled() 108 AddRef(); // Balanced in Accepted() and Canceled()
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 if (extension->browser_action()) 150 if (extension->browser_action())
150 AddItemWithStringId(HIDE, IDS_EXTENSIONS_HIDE_BUTTON); 151 AddItemWithStringId(HIDE, IDS_EXTENSIONS_HIDE_BUTTON);
151 AddSeparator(); 152 AddSeparator();
152 AddItemWithStringId(MANAGE, IDS_MANAGE_EXTENSIONS); 153 AddItemWithStringId(MANAGE, IDS_MANAGE_EXTENSIONS);
153 } 154 }
154 155
155 const Extension* ExtensionContextMenuModel::GetExtension() const { 156 const Extension* ExtensionContextMenuModel::GetExtension() const {
156 ExtensionService* extension_service = profile_->GetExtensionService(); 157 ExtensionService* extension_service = profile_->GetExtensionService();
157 return extension_service->GetExtensionById(extension_id_, false); 158 return extension_service->GetExtensionById(extension_id_, false);
158 } 159 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698