OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chrome_extensions_browser_client.h" | 5 #include "chrome/browser/extensions/chrome_extensions_browser_client.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/version.h" | 8 #include "base/version.h" |
9 #include "chrome/browser/app_mode/app_mode_utils.h" | 9 #include "chrome/browser/app_mode/app_mode_utils.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 #include "chrome/common/chrome_version_info.h" | 32 #include "chrome/common/chrome_version_info.h" |
33 #include "chrome/common/extensions/features/feature_channel.h" | 33 #include "chrome/common/extensions/features/feature_channel.h" |
34 #include "chrome/common/pref_names.h" | 34 #include "chrome/common/pref_names.h" |
35 #include "extensions/browser/api/generated_api_registration.h" | 35 #include "extensions/browser/api/generated_api_registration.h" |
36 #include "extensions/browser/extension_function_registry.h" | 36 #include "extensions/browser/extension_function_registry.h" |
37 #include "extensions/browser/extension_prefs.h" | 37 #include "extensions/browser/extension_prefs.h" |
38 #include "extensions/browser/pref_names.h" | 38 #include "extensions/browser/pref_names.h" |
39 #include "extensions/browser/url_request_util.h" | 39 #include "extensions/browser/url_request_util.h" |
40 | 40 |
41 #if defined(OS_CHROMEOS) | 41 #if defined(OS_CHROMEOS) |
| 42 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
42 #include "chrome/browser/extensions/updater/extension_cache_impl.h" | 43 #include "chrome/browser/extensions/updater/extension_cache_impl.h" |
43 #include "chromeos/chromeos_switches.h" | 44 #include "chromeos/chromeos_switches.h" |
44 #else | 45 #else |
45 #include "extensions/browser/updater/null_extension_cache.h" | 46 #include "extensions/browser/updater/null_extension_cache.h" |
46 #endif | 47 #endif |
47 | 48 |
48 namespace extensions { | 49 namespace extensions { |
49 | 50 |
50 ChromeExtensionsBrowserClient::ChromeExtensionsBrowserClient() { | 51 ChromeExtensionsBrowserClient::ChromeExtensionsBrowserClient() { |
51 process_manager_delegate_.reset(new ChromeProcessManagerDelegate); | 52 process_manager_delegate_.reset(new ChromeProcessManagerDelegate); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 content::BrowserContext* ChromeExtensionsBrowserClient::GetOffTheRecordContext( | 93 content::BrowserContext* ChromeExtensionsBrowserClient::GetOffTheRecordContext( |
93 content::BrowserContext* context) { | 94 content::BrowserContext* context) { |
94 return static_cast<Profile*>(context)->GetOffTheRecordProfile(); | 95 return static_cast<Profile*>(context)->GetOffTheRecordProfile(); |
95 } | 96 } |
96 | 97 |
97 content::BrowserContext* ChromeExtensionsBrowserClient::GetOriginalContext( | 98 content::BrowserContext* ChromeExtensionsBrowserClient::GetOriginalContext( |
98 content::BrowserContext* context) { | 99 content::BrowserContext* context) { |
99 return static_cast<Profile*>(context)->GetOriginalProfile(); | 100 return static_cast<Profile*>(context)->GetOriginalProfile(); |
100 } | 101 } |
101 | 102 |
| 103 #if defined(OS_CHROMEOS) |
| 104 std::string ChromeExtensionsBrowserClient::GetUserIdHashFromContext( |
| 105 content::BrowserContext* context) { |
| 106 return chromeos::ProfileHelper::GetUserIdHashFromProfile( |
| 107 static_cast<Profile*>(context)); |
| 108 } |
| 109 #endif |
| 110 |
102 bool ChromeExtensionsBrowserClient::IsGuestSession( | 111 bool ChromeExtensionsBrowserClient::IsGuestSession( |
103 content::BrowserContext* context) const { | 112 content::BrowserContext* context) const { |
104 return static_cast<Profile*>(context)->IsGuestSession(); | 113 return static_cast<Profile*>(context)->IsGuestSession(); |
105 } | 114 } |
106 | 115 |
107 bool ChromeExtensionsBrowserClient::IsExtensionIncognitoEnabled( | 116 bool ChromeExtensionsBrowserClient::IsExtensionIncognitoEnabled( |
108 const std::string& extension_id, | 117 const std::string& extension_id, |
109 content::BrowserContext* context) const { | 118 content::BrowserContext* context) const { |
110 return IsGuestSession(context) | 119 return IsGuestSession(context) |
111 || util::IsIncognitoEnabled(extension_id, context); | 120 || util::IsIncognitoEnabled(extension_id, context); |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 base::Version browser_version = base::Version(version_info.Version()); | 300 base::Version browser_version = base::Version(version_info.Version()); |
292 Version browser_min_version(min_version); | 301 Version browser_min_version(min_version); |
293 if (browser_version.IsValid() && browser_min_version.IsValid() && | 302 if (browser_version.IsValid() && browser_min_version.IsValid() && |
294 browser_min_version.CompareTo(browser_version) > 0) { | 303 browser_min_version.CompareTo(browser_version) > 0) { |
295 return false; | 304 return false; |
296 } | 305 } |
297 return true; | 306 return true; |
298 } | 307 } |
299 | 308 |
300 } // namespace extensions | 309 } // namespace extensions |
OLD | NEW |