| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 std::unique_ptr<ExtensionHostDelegate> | 194 std::unique_ptr<ExtensionHostDelegate> |
| 195 ChromeExtensionsBrowserClient::CreateExtensionHostDelegate() { | 195 ChromeExtensionsBrowserClient::CreateExtensionHostDelegate() { |
| 196 return std::unique_ptr<ExtensionHostDelegate>( | 196 return std::unique_ptr<ExtensionHostDelegate>( |
| 197 new ChromeExtensionHostDelegate); | 197 new ChromeExtensionHostDelegate); |
| 198 } | 198 } |
| 199 | 199 |
| 200 bool ChromeExtensionsBrowserClient::DidVersionUpdate( | 200 bool ChromeExtensionsBrowserClient::DidVersionUpdate( |
| 201 content::BrowserContext* context) { | 201 content::BrowserContext* context) { |
| 202 Profile* profile = static_cast<Profile*>(context); | 202 Profile* profile = static_cast<Profile*>(context); |
| 203 | 203 |
| 204 // Unit tests may not provide prefs; assume everything is up-to-date. | 204 // Unit tests may not provide prefs; assume everything is up to date. |
| 205 ExtensionPrefs* extension_prefs = ExtensionPrefs::Get(profile); | 205 ExtensionPrefs* extension_prefs = ExtensionPrefs::Get(profile); |
| 206 if (!extension_prefs) | 206 if (!extension_prefs) |
| 207 return false; | 207 return false; |
| 208 | 208 |
| 209 // If we're inside a browser test, then assume prefs are all up-to-date. | 209 // If we're inside a browser test, then assume prefs are all up to date. |
| 210 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) | 210 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) |
| 211 return false; | 211 return false; |
| 212 | 212 |
| 213 PrefService* pref_service = extension_prefs->pref_service(); | 213 PrefService* pref_service = extension_prefs->pref_service(); |
| 214 base::Version last_version; | 214 base::Version last_version; |
| 215 if (pref_service->HasPrefPath(pref_names::kLastChromeVersion)) { | 215 if (pref_service->HasPrefPath(pref_names::kLastChromeVersion)) { |
| 216 std::string last_version_str = | 216 std::string last_version_str = |
| 217 pref_service->GetString(pref_names::kLastChromeVersion); | 217 pref_service->GetString(pref_names::kLastChromeVersion); |
| 218 last_version = base::Version(last_version_str); | 218 last_version = base::Version(last_version_str); |
| 219 } | 219 } |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 | 411 |
| 412 std::unique_ptr<content::BluetoothChooser> | 412 std::unique_ptr<content::BluetoothChooser> |
| 413 ChromeExtensionsBrowserClient::CreateBluetoothChooser( | 413 ChromeExtensionsBrowserClient::CreateBluetoothChooser( |
| 414 content::RenderFrameHost* frame, | 414 content::RenderFrameHost* frame, |
| 415 const content::BluetoothChooser::EventHandler& event_handler) { | 415 const content::BluetoothChooser::EventHandler& event_handler) { |
| 416 return base::WrapUnique( | 416 return base::WrapUnique( |
| 417 new ChromeExtensionBluetoothChooser(frame, event_handler)); | 417 new ChromeExtensionBluetoothChooser(frame, event_handler)); |
| 418 } | 418 } |
| 419 | 419 |
| 420 } // namespace extensions | 420 } // namespace extensions |
| OLD | NEW |