| 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 "extensions/browser/process_manager.h" | 5 #include "extensions/browser/process_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 content::NotificationService::AllSources()); | 197 content::NotificationService::AllSources()); |
| 198 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CREATED, | 198 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CREATED, |
| 199 content::Source<BrowserContext>(original_context)); | 199 content::Source<BrowserContext>(original_context)); |
| 200 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, | 200 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, |
| 201 content::Source<BrowserContext>(context)); | 201 content::Source<BrowserContext>(context)); |
| 202 if (context->IsOffTheRecord()) { | 202 if (context->IsOffTheRecord()) { |
| 203 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, | 203 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, |
| 204 content::Source<BrowserContext>(original_context)); | 204 content::Source<BrowserContext>(original_context)); |
| 205 } | 205 } |
| 206 | 206 |
| 207 // Note: event_page_idle_time_ must be sufficiently larger (e.g. 2x) than |
| 208 // kKeepaliveThrottleIntervalInSeconds in ppapi/proxy/plugin_globals. |
| 207 event_page_idle_time_ = base::TimeDelta::FromSeconds(10); | 209 event_page_idle_time_ = base::TimeDelta::FromSeconds(10); |
| 208 unsigned idle_time_msec = 0; | 210 unsigned idle_time_msec = 0; |
| 209 if (base::StringToUint(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 211 if (base::StringToUint(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 210 extensions::switches::kEventPageIdleTime), &idle_time_msec)) { | 212 extensions::switches::kEventPageIdleTime), &idle_time_msec)) { |
| 211 CHECK(idle_time_msec > 0); // OnKeepaliveImpulseCheck requires non zero. | 213 CHECK(idle_time_msec > 0); // OnKeepaliveImpulseCheck requires non zero. |
| 212 event_page_idle_time_ = base::TimeDelta::FromMilliseconds(idle_time_msec); | 214 event_page_idle_time_ = base::TimeDelta::FromMilliseconds(idle_time_msec); |
| 213 } | 215 } |
| 214 event_page_suspending_time_ = base::TimeDelta::FromSeconds(5); | 216 event_page_suspending_time_ = base::TimeDelta::FromSeconds(5); |
| 215 unsigned suspending_time_msec = 0; | 217 unsigned suspending_time_msec = 0; |
| 216 if (base::StringToUint(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 218 if (base::StringToUint(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| (...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 } | 864 } |
| 863 | 865 |
| 864 bool IncognitoProcessManager::IsIncognitoEnabled(const Extension* extension) { | 866 bool IncognitoProcessManager::IsIncognitoEnabled(const Extension* extension) { |
| 865 // Keep in sync with duplicate in extension_info_map.cc. | 867 // Keep in sync with duplicate in extension_info_map.cc. |
| 866 ExtensionService* service = ExtensionSystem::GetForBrowserContext( | 868 ExtensionService* service = ExtensionSystem::GetForBrowserContext( |
| 867 GetBrowserContext())->extension_service(); | 869 GetBrowserContext())->extension_service(); |
| 868 return extension_util::IsIncognitoEnabled(extension->id(), service); | 870 return extension_util::IsIncognitoEnabled(extension->id(), service); |
| 869 } | 871 } |
| 870 | 872 |
| 871 } // namespace extensions | 873 } // namespace extensions |
| OLD | NEW |