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

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

Issue 13865012: Change GetProfileToUse method from Profile to content::BrowserContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: trybots 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 | Annotate | Revision Log
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_action_manager.h" 5 #include "chrome/browser/extensions/extension_action_manager.h"
6 6
7 #include "chrome/browser/extensions/api/system_indicator/system_indicator_manage r.h" 7 #include "chrome/browser/extensions/api/system_indicator/system_indicator_manage r.h"
8 #include "chrome/browser/extensions/api/system_indicator/system_indicator_manage r_factory.h" 8 #include "chrome/browser/extensions/api/system_indicator/system_indicator_manage r_factory.h"
9 #include "chrome/browser/extensions/extension_action.h" 9 #include "chrome/browser/extensions/extension_action.h"
10 #include "chrome/browser/extensions/extension_system.h" 10 #include "chrome/browser/extensions/extension_system.h"
11 #include "chrome/browser/profiles/incognito_helpers.h"
11 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/browser/profiles/profile_dependency_manager.h" 13 #include "chrome/browser/profiles/profile_dependency_manager.h"
13 #include "chrome/browser/profiles/profile_keyed_service_factory.h" 14 #include "chrome/browser/profiles/profile_keyed_service_factory.h"
14 #include "chrome/common/chrome_notification_types.h" 15 #include "chrome/common/chrome_notification_types.h"
15 #include "chrome/common/extensions/api/extension_action/action_info.h" 16 #include "chrome/common/extensions/api/extension_action/action_info.h"
16 #include "chrome/common/extensions/api/extension_action/page_action_handler.h" 17 #include "chrome/common/extensions/api/extension_action/page_action_handler.h"
17 #include "chrome/common/extensions/api/extension_action/script_badge_handler.h" 18 #include "chrome/common/extensions/api/extension_action/script_badge_handler.h"
18 #include "chrome/common/extensions/extension.h" 19 #include "chrome/common/extensions/extension.h"
19 #include "chrome/common/extensions/feature_switch.h" 20 #include "chrome/common/extensions/feature_switch.h"
20 #include "content/public/browser/notification_service.h" 21 #include "content/public/browser/notification_service.h"
(...skipping 20 matching lines...) Expand all
41 ExtensionActionManagerFactory() 42 ExtensionActionManagerFactory()
42 : ProfileKeyedServiceFactory("ExtensionActionManager", 43 : ProfileKeyedServiceFactory("ExtensionActionManager",
43 ProfileDependencyManager::GetInstance()) { 44 ProfileDependencyManager::GetInstance()) {
44 } 45 }
45 46
46 virtual ProfileKeyedService* BuildServiceInstanceFor( 47 virtual ProfileKeyedService* BuildServiceInstanceFor(
47 content::BrowserContext* profile) const OVERRIDE { 48 content::BrowserContext* profile) const OVERRIDE {
48 return new ExtensionActionManager(static_cast<Profile*>(profile)); 49 return new ExtensionActionManager(static_cast<Profile*>(profile));
49 } 50 }
50 51
51 virtual bool ServiceRedirectedInIncognito() const OVERRIDE { 52 virtual content::BrowserContext* GetBrowserContextToUse(
52 return true; 53 content::BrowserContext* context) const OVERRIDE {
54 return chrome::GetBrowserContextRedirectedInIncognito(context);
53 } 55 }
54 }; 56 };
55 57
56 ExtensionActionManagerFactory* 58 ExtensionActionManagerFactory*
57 ExtensionActionManagerFactory::GetInstance() { 59 ExtensionActionManagerFactory::GetInstance() {
58 return Singleton<ExtensionActionManagerFactory>::get(); 60 return Singleton<ExtensionActionManagerFactory>::get();
59 } 61 }
60 62
61 } // namespace 63 } // namespace
62 64
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 } 161 }
160 162
161 ExtensionAction* ExtensionActionManager::GetScriptBadge( 163 ExtensionAction* ExtensionActionManager::GetScriptBadge(
162 const extensions::Extension& extension) const { 164 const extensions::Extension& extension) const {
163 return GetOrCreateOrNull(&script_badges_, extension.id(), 165 return GetOrCreateOrNull(&script_badges_, extension.id(),
164 ActionInfo::TYPE_SCRIPT_BADGE, 166 ActionInfo::TYPE_SCRIPT_BADGE,
165 ActionInfo::GetScriptBadgeInfo(&extension)); 167 ActionInfo::GetScriptBadgeInfo(&extension));
166 } 168 }
167 169
168 } // namespace extensions 170 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698