| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 ChromeExtensionsBrowserClient::~ChromeExtensionsBrowserClient() {} | 79 ChromeExtensionsBrowserClient::~ChromeExtensionsBrowserClient() {} |
| 80 | 80 |
| 81 bool ChromeExtensionsBrowserClient::IsShuttingDown() { | 81 bool ChromeExtensionsBrowserClient::IsShuttingDown() { |
| 82 return g_browser_process->IsShuttingDown(); | 82 return g_browser_process->IsShuttingDown(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 bool ChromeExtensionsBrowserClient::AreExtensionsDisabled( | 85 bool ChromeExtensionsBrowserClient::AreExtensionsDisabled( |
| 86 const base::CommandLine& command_line, | 86 const base::CommandLine& command_line, |
| 87 content::BrowserContext* context) { | 87 content::BrowserContext* context) { |
| 88 Profile* profile = static_cast<Profile*>(context); | 88 Profile* profile = static_cast<Profile*>(context); |
| 89 return command_line.HasSwitch(switches::kDisableExtensions) || | 89 return switches::ExtensionsDisabled(command_line) || |
| 90 profile->GetPrefs()->GetBoolean(prefs::kDisableExtensions); | 90 profile->GetPrefs()->GetBoolean(prefs::kDisableExtensions); |
| 91 } | 91 } |
| 92 | 92 |
| 93 bool ChromeExtensionsBrowserClient::IsValidContext( | 93 bool ChromeExtensionsBrowserClient::IsValidContext( |
| 94 content::BrowserContext* context) { | 94 content::BrowserContext* context) { |
| 95 Profile* profile = static_cast<Profile*>(context); | 95 Profile* profile = static_cast<Profile*>(context); |
| 96 return g_browser_process->profile_manager() && | 96 return g_browser_process->profile_manager() && |
| 97 g_browser_process->profile_manager()->IsValidProfile(profile); | 97 g_browser_process->profile_manager()->IsValidProfile(profile); |
| 98 } | 98 } |
| 99 | 99 |
| 100 bool ChromeExtensionsBrowserClient::IsSameContext( | 100 bool ChromeExtensionsBrowserClient::IsSameContext( |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 new ChromeExtensionBluetoothChooser(frame, event_handler)); | 411 new ChromeExtensionBluetoothChooser(frame, 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 |