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

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

Issue 2934293003: The chrome.lockScreen.data API implementation (Closed)
Patch Set: remove FilePath*UTF8Unsafe methods Created 3 years, 6 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 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 "base/values.h" 7 #include "base/values.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "content/public/browser/browser_context.h" 9 #include "content/public/browser/browser_context.h"
10 #include "extensions/browser/extension_host_delegate.h" 10 #include "extensions/browser/extension_host_delegate.h"
11 #include "extensions/browser/test_runtime_api_delegate.h" 11 #include "extensions/browser/test_runtime_api_delegate.h"
12 #include "extensions/browser/updater/null_extension_cache.h" 12 #include "extensions/browser/updater/null_extension_cache.h"
13 13
14 #if defined(OS_CHROMEOS) 14 #if defined(OS_CHROMEOS)
15 #include "chromeos/login/login_state.h" 15 #include "chromeos/login/login_state.h"
16 #endif 16 #endif
17 17
18 using content::BrowserContext; 18 using content::BrowserContext;
19 19
20 namespace extensions { 20 namespace extensions {
21 21
22 TestExtensionsBrowserClient::TestExtensionsBrowserClient( 22 TestExtensionsBrowserClient::TestExtensionsBrowserClient(
23 BrowserContext* main_context) 23 BrowserContext* main_context)
24 : main_context_(main_context), 24 : main_context_(main_context),
25 incognito_context_(NULL), 25 incognito_context_(nullptr),
26 process_manager_delegate_(NULL), 26 lock_screen_context_(nullptr),
27 extension_system_factory_(NULL), 27 process_manager_delegate_(nullptr),
28 extension_system_factory_(nullptr),
28 extension_cache_(new NullExtensionCache) { 29 extension_cache_(new NullExtensionCache) {
29 DCHECK(main_context_); 30 DCHECK(main_context_);
30 DCHECK(!main_context_->IsOffTheRecord()); 31 DCHECK(!main_context_->IsOffTheRecord());
31 } 32 }
32 33
33 TestExtensionsBrowserClient::~TestExtensionsBrowserClient() {} 34 TestExtensionsBrowserClient::~TestExtensionsBrowserClient() {}
34 35
35 void TestExtensionsBrowserClient::SetUpdateClientFactory( 36 void TestExtensionsBrowserClient::SetUpdateClientFactory(
36 const base::Callback<update_client::UpdateClient*(void)>& factory) { 37 const base::Callback<update_client::UpdateClient*(void)>& factory) {
37 update_client_factory_ = factory; 38 update_client_factory_ = factory;
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 scoped_refptr<update_client::UpdateClient> 219 scoped_refptr<update_client::UpdateClient>
219 TestExtensionsBrowserClient::CreateUpdateClient( 220 TestExtensionsBrowserClient::CreateUpdateClient(
220 content::BrowserContext* context) { 221 content::BrowserContext* context) {
221 return update_client_factory_.is_null() 222 return update_client_factory_.is_null()
222 ? nullptr 223 ? nullptr
223 : make_scoped_refptr(update_client_factory_.Run()); 224 : make_scoped_refptr(update_client_factory_.Run());
224 } 225 }
225 226
226 bool TestExtensionsBrowserClient::IsLockScreenContext( 227 bool TestExtensionsBrowserClient::IsLockScreenContext(
227 content::BrowserContext* context) { 228 content::BrowserContext* context) {
228 return false; 229 return lock_screen_context_ && context == lock_screen_context_;
229 } 230 }
230 231
231 } // namespace extensions 232 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698