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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 } | 301 } |
302 | 302 |
303 net::NetLog* ChromeExtensionsBrowserClient::GetNetLog() { | 303 net::NetLog* ChromeExtensionsBrowserClient::GetNetLog() { |
304 return g_browser_process->net_log(); | 304 return g_browser_process->net_log(); |
305 } | 305 } |
306 | 306 |
307 ExtensionCache* ChromeExtensionsBrowserClient::GetExtensionCache() { | 307 ExtensionCache* ChromeExtensionsBrowserClient::GetExtensionCache() { |
308 if (!extension_cache_.get()) { | 308 if (!extension_cache_.get()) { |
309 #if defined(OS_CHROMEOS) | 309 #if defined(OS_CHROMEOS) |
310 extension_cache_.reset(new ExtensionCacheImpl( | 310 extension_cache_.reset(new ExtensionCacheImpl( |
311 base::WrapUnique(new ChromeOSExtensionCacheDelegate()))); | 311 base::MakeUnique<ChromeOSExtensionCacheDelegate>())); |
312 #else | 312 #else |
313 extension_cache_.reset(new NullExtensionCache()); | 313 extension_cache_.reset(new NullExtensionCache()); |
314 #endif | 314 #endif |
315 } | 315 } |
316 return extension_cache_.get(); | 316 return extension_cache_.get(); |
317 } | 317 } |
318 | 318 |
319 bool ChromeExtensionsBrowserClient::IsBackgroundUpdateAllowed() { | 319 bool ChromeExtensionsBrowserClient::IsBackgroundUpdateAllowed() { |
320 return !base::CommandLine::ForCurrentProcess()->HasSwitch( | 320 return !base::CommandLine::ForCurrentProcess()->HasSwitch( |
321 switches::kDisableBackgroundNetworking); | 321 switches::kDisableBackgroundNetworking); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 scoped_refptr<update_client::UpdateClient> | 393 scoped_refptr<update_client::UpdateClient> |
394 ChromeExtensionsBrowserClient::CreateUpdateClient( | 394 ChromeExtensionsBrowserClient::CreateUpdateClient( |
395 content::BrowserContext* context) { | 395 content::BrowserContext* context) { |
396 return update_client::UpdateClientFactory( | 396 return update_client::UpdateClientFactory( |
397 make_scoped_refptr(new ChromeUpdateClientConfig(context))); | 397 make_scoped_refptr(new ChromeUpdateClientConfig(context))); |
398 } | 398 } |
399 | 399 |
400 std::unique_ptr<ExtensionApiFrameIdMapHelper> | 400 std::unique_ptr<ExtensionApiFrameIdMapHelper> |
401 ChromeExtensionsBrowserClient::CreateExtensionApiFrameIdMapHelper( | 401 ChromeExtensionsBrowserClient::CreateExtensionApiFrameIdMapHelper( |
402 ExtensionApiFrameIdMap* map) { | 402 ExtensionApiFrameIdMap* map) { |
403 return base::WrapUnique(new ChromeExtensionApiFrameIdMapHelper(map)); | 403 return base::MakeUnique<ChromeExtensionApiFrameIdMapHelper>(map); |
404 } | 404 } |
405 | 405 |
406 std::unique_ptr<content::BluetoothChooser> | 406 std::unique_ptr<content::BluetoothChooser> |
407 ChromeExtensionsBrowserClient::CreateBluetoothChooser( | 407 ChromeExtensionsBrowserClient::CreateBluetoothChooser( |
408 content::RenderFrameHost* frame, | 408 content::RenderFrameHost* frame, |
409 const content::BluetoothChooser::EventHandler& event_handler) { | 409 const content::BluetoothChooser::EventHandler& event_handler) { |
410 return base::WrapUnique( | 410 return base::MakeUnique<ChromeExtensionBluetoothChooser>(frame, |
411 new ChromeExtensionBluetoothChooser(frame, event_handler)); | 411 event_handler); |
412 } | 412 } |
413 | 413 |
414 bool ChromeExtensionsBrowserClient::IsActivityLoggingEnabled( | 414 bool ChromeExtensionsBrowserClient::IsActivityLoggingEnabled( |
415 content::BrowserContext* context) { | 415 content::BrowserContext* context) { |
416 ActivityLog* activity_log = ActivityLog::GetInstance(context); | 416 ActivityLog* activity_log = ActivityLog::GetInstance(context); |
417 return activity_log && activity_log->is_active(); | 417 return activity_log && activity_log->is_active(); |
418 } | 418 } |
419 | 419 |
420 } // namespace extensions | 420 } // namespace extensions |
OLD | NEW |