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

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

Issue 14699002: Move BrowserAction references from ExtensionPrefs to ExtensionActionAPI (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 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
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/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h"
9 #include "chrome/browser/extensions/extension_action.h" 10 #include "chrome/browser/extensions/extension_action.h"
10 #include "chrome/browser/extensions/extension_action_manager.h" 11 #include "chrome/browser/extensions/extension_action_manager.h"
11 #include "chrome/browser/extensions/extension_service.h" 12 #include "chrome/browser/extensions/extension_service.h"
12 #include "chrome/browser/extensions/extension_system.h" 13 #include "chrome/browser/extensions/extension_system.h"
13 #include "chrome/browser/extensions/extension_tab_util.h" 14 #include "chrome/browser/extensions/extension_tab_util.h"
14 #include "chrome/browser/extensions/management_policy.h" 15 #include "chrome/browser/extensions/management_policy.h"
15 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
16 #include "chrome/browser/ui/browser.h" 17 #include "chrome/browser/ui/browser.h"
17 #include "chrome/browser/ui/chrome_pages.h" 18 #include "chrome/browser/ui/chrome_pages.h"
18 #include "chrome/browser/ui/tabs/tab_strip_model.h" 19 #include "chrome/browser/ui/tabs/tab_strip_model.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 Referrer(), NEW_FOREGROUND_TAB, 108 Referrer(), NEW_FOREGROUND_TAB,
108 content::PAGE_TRANSITION_LINK, false); 109 content::PAGE_TRANSITION_LINK, false);
109 browser_->OpenURL(params); 110 browser_->OpenURL(params);
110 break; 111 break;
111 } 112 }
112 case CONFIGURE: 113 case CONFIGURE:
113 DCHECK(!extensions::ManifestURL::GetOptionsPage(extension).is_empty()); 114 DCHECK(!extensions::ManifestURL::GetOptionsPage(extension).is_empty());
114 ExtensionTabUtil::OpenOptionsPage(extension, browser_); 115 ExtensionTabUtil::OpenOptionsPage(extension, browser_);
115 break; 116 break;
116 case HIDE: { 117 case HIDE: {
117 ExtensionService* extension_service = 118 extensions::ExtensionActionAPI::SetBrowserActionVisibility(
118 extensions::ExtensionSystem::Get(profile_)->extension_service(); 119 extensions::ExtensionSystem::Get(profile_)->
119 extension_service->extension_prefs()-> 120 extension_service()->extension_prefs(),
120 SetBrowserActionVisibility(extension, false); 121 extension->id(),
122 false);
121 break; 123 break;
122 } 124 }
123 case UNINSTALL: { 125 case UNINSTALL: {
124 AddRef(); // Balanced in Accepted() and Canceled() 126 AddRef(); // Balanced in Accepted() and Canceled()
125 extension_uninstall_dialog_.reset( 127 extension_uninstall_dialog_.reset(
126 ExtensionUninstallDialog::Create(profile_, browser_, this)); 128 ExtensionUninstallDialog::Create(profile_, browser_, this));
127 extension_uninstall_dialog_->ConfirmUninstall(extension); 129 extension_uninstall_dialog_->ConfirmUninstall(extension);
128 break; 130 break;
129 } 131 }
130 case MANAGE: { 132 case MANAGE: {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 AddItemWithStringId(HIDE, IDS_EXTENSIONS_HIDE_BUTTON); 178 AddItemWithStringId(HIDE, IDS_EXTENSIONS_HIDE_BUTTON);
177 AddSeparator(ui::NORMAL_SEPARATOR); 179 AddSeparator(ui::NORMAL_SEPARATOR);
178 AddItemWithStringId(MANAGE, IDS_MANAGE_EXTENSION); 180 AddItemWithStringId(MANAGE, IDS_MANAGE_EXTENSION);
179 } 181 }
180 182
181 const Extension* ExtensionContextMenuModel::GetExtension() const { 183 const Extension* ExtensionContextMenuModel::GetExtension() const {
182 ExtensionService* extension_service = 184 ExtensionService* extension_service =
183 extensions::ExtensionSystem::Get(profile_)->extension_service(); 185 extensions::ExtensionSystem::Get(profile_)->extension_service();
184 return extension_service->GetExtensionById(extension_id_, false); 186 return extension_service->GetExtensionById(extension_id_, false);
185 } 187 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698