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

Side by Side Diff: extensions/browser/test_extensions_browser_client.cc

Issue 381283002: Refactor code that defers extension background page loading (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase on top of chrome_browser_extensions.gypi GN changes Created 6 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 | Annotate | Revision Log
« no previous file with comments | « extensions/browser/test_extensions_browser_client.h ('k') | extensions/extensions.gyp » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/test_extensions_browser_client.h" 5 #include "extensions/browser/test_extensions_browser_client.h"
6 6
7 #include "content/public/browser/browser_context.h" 7 #include "content/public/browser/browser_context.h"
8 #include "extensions/browser/app_sorting.h" 8 #include "extensions/browser/app_sorting.h"
9 #include "extensions/browser/extension_host_delegate.h" 9 #include "extensions/browser/extension_host_delegate.h"
10 #include "extensions/browser/test_runtime_api_delegate.h" 10 #include "extensions/browser/test_runtime_api_delegate.h"
11 11
12 using content::BrowserContext; 12 using content::BrowserContext;
13 13
14 namespace extensions { 14 namespace extensions {
15 15
16 TestExtensionsBrowserClient::TestExtensionsBrowserClient( 16 TestExtensionsBrowserClient::TestExtensionsBrowserClient(
17 BrowserContext* main_context) 17 BrowserContext* main_context)
18 : main_context_(main_context), incognito_context_(NULL) { 18 : main_context_(main_context),
19 incognito_context_(NULL),
20 process_manager_delegate_(NULL) {
19 DCHECK(main_context_); 21 DCHECK(main_context_);
20 DCHECK(!main_context_->IsOffTheRecord()); 22 DCHECK(!main_context_->IsOffTheRecord());
21 } 23 }
22 24
23 TestExtensionsBrowserClient::~TestExtensionsBrowserClient() {} 25 TestExtensionsBrowserClient::~TestExtensionsBrowserClient() {}
24 26
25 void TestExtensionsBrowserClient::SetIncognitoContext(BrowserContext* context) { 27 void TestExtensionsBrowserClient::SetIncognitoContext(BrowserContext* context) {
26 // If a context is provided it must be off-the-record. 28 // If a context is provided it must be off-the-record.
27 DCHECK(!context || context->IsOffTheRecord()); 29 DCHECK(!context || context->IsOffTheRecord());
28 incognito_context_ = context; 30 incognito_context_ = context;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 111
110 PrefService* TestExtensionsBrowserClient::GetPrefServiceForContext( 112 PrefService* TestExtensionsBrowserClient::GetPrefServiceForContext(
111 BrowserContext* context) { 113 BrowserContext* context) {
112 return NULL; 114 return NULL;
113 } 115 }
114 116
115 void TestExtensionsBrowserClient::GetEarlyExtensionPrefsObservers( 117 void TestExtensionsBrowserClient::GetEarlyExtensionPrefsObservers(
116 content::BrowserContext* context, 118 content::BrowserContext* context,
117 std::vector<ExtensionPrefsObserver*>* observers) const {} 119 std::vector<ExtensionPrefsObserver*>* observers) const {}
118 120
119 bool TestExtensionsBrowserClient::DeferLoadingBackgroundHosts( 121 ProcessManagerDelegate* TestExtensionsBrowserClient::GetProcessManagerDelegate()
120 BrowserContext* context) const { 122 const {
121 return false; 123 return process_manager_delegate_;
122 }
123
124 bool TestExtensionsBrowserClient::IsBackgroundPageAllowed(
125 BrowserContext* context) const {
126 return true;
127 } 124 }
128 125
129 scoped_ptr<ExtensionHostDelegate> 126 scoped_ptr<ExtensionHostDelegate>
130 TestExtensionsBrowserClient::CreateExtensionHostDelegate() { 127 TestExtensionsBrowserClient::CreateExtensionHostDelegate() {
131 return scoped_ptr<ExtensionHostDelegate>(); 128 return scoped_ptr<ExtensionHostDelegate>();
132 } 129 }
133 130
134 bool TestExtensionsBrowserClient::DidVersionUpdate(BrowserContext* context) { 131 bool TestExtensionsBrowserClient::DidVersionUpdate(BrowserContext* context) {
135 return false; 132 return false;
136 } 133 }
(...skipping 24 matching lines...) Expand all
161 content::BrowserContext* context) const { 158 content::BrowserContext* context) const {
162 return scoped_ptr<RuntimeAPIDelegate>(new TestRuntimeAPIDelegate()); 159 return scoped_ptr<RuntimeAPIDelegate>(new TestRuntimeAPIDelegate());
163 } 160 }
164 161
165 ComponentExtensionResourceManager* 162 ComponentExtensionResourceManager*
166 TestExtensionsBrowserClient::GetComponentExtensionResourceManager() { 163 TestExtensionsBrowserClient::GetComponentExtensionResourceManager() {
167 return NULL; 164 return NULL;
168 } 165 }
169 166
170 } // namespace extensions 167 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/test_extensions_browser_client.h ('k') | extensions/extensions.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698