OLD | NEW |
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/shell/browser/shell_extensions_browser_client.h" | 5 #include "extensions/shell/browser/shell_extensions_browser_client.h" |
6 | 6 |
| 7 #include "content/public/browser/browser_context.h" |
7 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
8 #include "extensions/browser/api/extensions_api_client.h" | 9 #include "extensions/browser/api/extensions_api_client.h" |
9 #include "extensions/browser/api/generated_api_registration.h" | 10 #include "extensions/browser/api/generated_api_registration.h" |
10 #include "extensions/browser/app_sorting.h" | 11 #include "extensions/browser/app_sorting.h" |
11 #include "extensions/browser/event_router.h" | 12 #include "extensions/browser/event_router.h" |
12 #include "extensions/browser/extension_function_registry.h" | 13 #include "extensions/browser/extension_function_registry.h" |
13 #include "extensions/browser/null_app_sorting.h" | 14 #include "extensions/browser/null_app_sorting.h" |
14 #include "extensions/browser/updater/null_extension_cache.h" | 15 #include "extensions/browser/updater/null_extension_cache.h" |
15 #include "extensions/browser/url_request_util.h" | 16 #include "extensions/browser/url_request_util.h" |
16 #include "extensions/shell/browser/api/generated_api_registration.h" | 17 #include "extensions/shell/browser/api/generated_api_registration.h" |
17 #include "extensions/shell/browser/shell_extension_host_delegate.h" | 18 #include "extensions/shell/browser/shell_extension_host_delegate.h" |
18 #include "extensions/shell/browser/shell_extension_system_factory.h" | 19 #include "extensions/shell/browser/shell_extension_system_factory.h" |
19 #include "extensions/shell/browser/shell_extensions_api_client.h" | 20 #include "extensions/shell/browser/shell_extensions_api_client.h" |
20 #include "extensions/shell/browser/shell_runtime_api_delegate.h" | 21 #include "extensions/shell/browser/shell_runtime_api_delegate.h" |
21 | 22 |
| 23 #if defined(OS_CHROMEOS) |
| 24 #include "chromeos/login/login_state.h" |
| 25 #endif |
| 26 |
22 using content::BrowserContext; | 27 using content::BrowserContext; |
23 using content::BrowserThread; | 28 using content::BrowserThread; |
24 | 29 |
25 namespace extensions { | 30 namespace extensions { |
26 | 31 |
27 ShellExtensionsBrowserClient::ShellExtensionsBrowserClient( | 32 ShellExtensionsBrowserClient::ShellExtensionsBrowserClient( |
28 BrowserContext* context, | 33 BrowserContext* context, |
29 PrefService* pref_service) | 34 PrefService* pref_service) |
30 : browser_context_(context), | 35 : browser_context_(context), |
31 pref_service_(pref_service), | 36 pref_service_(pref_service), |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 BrowserContext* context) { | 69 BrowserContext* context) { |
65 // app_shell only supports a single context. | 70 // app_shell only supports a single context. |
66 return NULL; | 71 return NULL; |
67 } | 72 } |
68 | 73 |
69 BrowserContext* ShellExtensionsBrowserClient::GetOriginalContext( | 74 BrowserContext* ShellExtensionsBrowserClient::GetOriginalContext( |
70 BrowserContext* context) { | 75 BrowserContext* context) { |
71 return context; | 76 return context; |
72 } | 77 } |
73 | 78 |
| 79 #if defined(OS_CHROMEOS) |
| 80 std::string ShellExtensionsBrowserClient::GetUserIdHashFromContext( |
| 81 content::BrowserContext* context) { |
| 82 return chromeos::LoginState::Get()->primary_user_hash();; |
| 83 } |
| 84 #endif |
| 85 |
74 bool ShellExtensionsBrowserClient::IsGuestSession( | 86 bool ShellExtensionsBrowserClient::IsGuestSession( |
75 BrowserContext* context) const { | 87 BrowserContext* context) const { |
76 return false; | 88 return false; |
77 } | 89 } |
78 | 90 |
79 bool ShellExtensionsBrowserClient::IsExtensionIncognitoEnabled( | 91 bool ShellExtensionsBrowserClient::IsExtensionIncognitoEnabled( |
80 const std::string& extension_id, | 92 const std::string& extension_id, |
81 content::BrowserContext* context) const { | 93 content::BrowserContext* context) const { |
82 return false; | 94 return false; |
83 } | 95 } |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 const std::string& min_version) { | 226 const std::string& min_version) { |
215 return true; | 227 return true; |
216 } | 228 } |
217 | 229 |
218 void ShellExtensionsBrowserClient::SetAPIClientForTest( | 230 void ShellExtensionsBrowserClient::SetAPIClientForTest( |
219 ExtensionsAPIClient* api_client) { | 231 ExtensionsAPIClient* api_client) { |
220 api_client_.reset(api_client); | 232 api_client_.reset(api_client); |
221 } | 233 } |
222 | 234 |
223 } // namespace extensions | 235 } // namespace extensions |
OLD | NEW |