| 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" |
| 11 #include "chrome/browser/extensions/chrome_app_sorting.h" | 11 #include "chrome/browser/extensions/chrome_app_sorting.h" |
| 12 #include "chrome/browser/extensions/extension_prefs.h" | 12 #include "chrome/browser/extensions/extension_prefs.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/profiles/profile_manager.h" | 14 #include "chrome/browser/profiles/profile_manager.h" |
| 15 #include "chrome/browser/ui/app_modal_dialogs/javascript_dialog_manager.h" | 15 #include "chrome/browser/ui/app_modal_dialogs/javascript_dialog_manager.h" |
| 16 #include "chrome/browser/ui/browser_finder.h" | 16 #include "chrome/browser/ui/browser_finder.h" |
| 17 #include "chrome/browser/ui/prefs/prefs_tab_helper.h" |
| 17 #include "chrome/common/chrome_switches.h" | 18 #include "chrome/common/chrome_switches.h" |
| 18 #include "chrome/common/chrome_version_info.h" | 19 #include "chrome/common/chrome_version_info.h" |
| 19 #include "chrome/common/pref_names.h" | 20 #include "chrome/common/pref_names.h" |
| 20 | 21 |
| 21 #if defined(OS_CHROMEOS) | 22 #if defined(OS_CHROMEOS) |
| 22 #include "chromeos/chromeos_switches.h" | 23 #include "chromeos/chromeos_switches.h" |
| 23 #endif | 24 #endif |
| 24 | 25 |
| 25 namespace extensions { | 26 namespace extensions { |
| 26 | 27 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 // background page shouldn't be created in it. | 102 // background page shouldn't be created in it. |
| 102 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 103 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 103 if (command_line->HasSwitch(chromeos::switches::kGuestSession) && | 104 if (command_line->HasSwitch(chromeos::switches::kGuestSession) && |
| 104 !context->IsOffTheRecord()) { | 105 !context->IsOffTheRecord()) { |
| 105 return false; | 106 return false; |
| 106 } | 107 } |
| 107 #endif | 108 #endif |
| 108 return true; | 109 return true; |
| 109 } | 110 } |
| 110 | 111 |
| 112 void ChromeExtensionsBrowserClient::OnExtensionHostCreated( |
| 113 content::WebContents* web_contents) { |
| 114 PrefsTabHelper::CreateForWebContents(web_contents); |
| 115 } |
| 116 |
| 111 bool ChromeExtensionsBrowserClient::DidVersionUpdate( | 117 bool ChromeExtensionsBrowserClient::DidVersionUpdate( |
| 112 content::BrowserContext* context) { | 118 content::BrowserContext* context) { |
| 113 Profile* profile = static_cast<Profile*>(context); | 119 Profile* profile = static_cast<Profile*>(context); |
| 114 | 120 |
| 115 // Unit tests may not provide prefs; assume everything is up-to-date. | 121 // Unit tests may not provide prefs; assume everything is up-to-date. |
| 116 ExtensionPrefs* extension_prefs = ExtensionPrefs::Get(profile); | 122 ExtensionPrefs* extension_prefs = ExtensionPrefs::Get(profile); |
| 117 if (!extension_prefs) | 123 if (!extension_prefs) |
| 118 return false; | 124 return false; |
| 119 | 125 |
| 120 // If we're inside a browser test, then assume prefs are all up-to-date. | 126 // If we're inside a browser test, then assume prefs are all up-to-date. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 148 bool ChromeExtensionsBrowserClient::IsRunningInForcedAppMode() { | 154 bool ChromeExtensionsBrowserClient::IsRunningInForcedAppMode() { |
| 149 return chrome::IsRunningInForcedAppMode(); | 155 return chrome::IsRunningInForcedAppMode(); |
| 150 } | 156 } |
| 151 | 157 |
| 152 content::JavaScriptDialogManager* | 158 content::JavaScriptDialogManager* |
| 153 ChromeExtensionsBrowserClient::GetJavaScriptDialogManager() { | 159 ChromeExtensionsBrowserClient::GetJavaScriptDialogManager() { |
| 154 return GetJavaScriptDialogManagerInstance(); | 160 return GetJavaScriptDialogManagerInstance(); |
| 155 } | 161 } |
| 156 | 162 |
| 157 } // namespace extensions | 163 } // namespace extensions |
| OLD | NEW |