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

Side by Side Diff: chrome/browser/chromeos/login/ui/preloaded_web_view_factory.cc

Issue 2610373002: cros: Only preload the lock screen; do not reuse it. (Closed)
Patch Set: Address comments Created 3 years, 11 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/chromeos/login/ui/shared_web_view_factory.h" 5 #include "chrome/browser/chromeos/login/ui/preloaded_web_view_factory.h"
6 6
7 #include "chrome/browser/chromeos/login/ui/shared_web_view.h" 7 #include "chrome/browser/chromeos/login/ui/preloaded_web_view.h"
8 #include "chrome/browser/chromeos/profiles/profile_helper.h" 8 #include "chrome/browser/chromeos/profiles/profile_helper.h"
9 #include "chrome/browser/profiles/incognito_helpers.h" 9 #include "chrome/browser/profiles/incognito_helpers.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
11 #include "components/keyed_service/content/browser_context_dependency_manager.h" 11 #include "components/keyed_service/content/browser_context_dependency_manager.h"
12 12
13 namespace chromeos { 13 namespace chromeos {
14 14
15 // static 15 // static
16 SharedWebView* SharedWebViewFactory::GetForProfile(Profile* profile) { 16 PreloadedWebView* PreloadedWebViewFactory::GetForProfile(Profile* profile) {
17 auto result = static_cast<SharedWebView*>( 17 auto result = static_cast<PreloadedWebView*>(
18 GetInstance()->GetServiceForBrowserContext(profile, true)); 18 GetInstance()->GetServiceForBrowserContext(profile, true));
19 return result; 19 return result;
20 } 20 }
21 21
22 // static 22 // static
23 SharedWebViewFactory* SharedWebViewFactory::GetInstance() { 23 PreloadedWebViewFactory* PreloadedWebViewFactory::GetInstance() {
24 return base::Singleton<SharedWebViewFactory>::get(); 24 return base::Singleton<PreloadedWebViewFactory>::get();
25 } 25 }
26 26
27 SharedWebViewFactory::SharedWebViewFactory() 27 PreloadedWebViewFactory::PreloadedWebViewFactory()
28 : BrowserContextKeyedServiceFactory( 28 : BrowserContextKeyedServiceFactory(
29 "SharedWebViewFactory", 29 "PreloadedWebViewFactory",
30 BrowserContextDependencyManager::GetInstance()) {} 30 BrowserContextDependencyManager::GetInstance()) {}
31 31
32 SharedWebViewFactory::~SharedWebViewFactory() {} 32 PreloadedWebViewFactory::~PreloadedWebViewFactory() {}
33 33
34 content::BrowserContext* SharedWebViewFactory::GetBrowserContextToUse( 34 content::BrowserContext* PreloadedWebViewFactory::GetBrowserContextToUse(
35 content::BrowserContext* context) const { 35 content::BrowserContext* context) const {
36 // Make sure that only the SigninProfile is using a shared webview. 36 // Make sure that only the SigninProfile is using a preloaded webview.
37 if (Profile::FromBrowserContext(context) != ProfileHelper::GetSigninProfile()) 37 if (Profile::FromBrowserContext(context) != ProfileHelper::GetSigninProfile())
38 return nullptr; 38 return nullptr;
39 39
40 return context; 40 return context;
41 } 41 }
42 42
43 KeyedService* SharedWebViewFactory::BuildServiceInstanceFor( 43 KeyedService* PreloadedWebViewFactory::BuildServiceInstanceFor(
44 content::BrowserContext* context) const { 44 content::BrowserContext* context) const {
45 return new SharedWebView(Profile::FromBrowserContext(context)); 45 return new PreloadedWebView(Profile::FromBrowserContext(context));
46 } 46 }
47 47
48 } // namespace chromeos 48 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/ui/preloaded_web_view_factory.h ('k') | chrome/browser/chromeos/login/ui/shared_web_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698