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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 content::NotificationService::AllSources()); | 196 content::NotificationService::AllSources()); |
197 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CREATED, | 197 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CREATED, |
198 content::Source<BrowserContext>(original_context)); | 198 content::Source<BrowserContext>(original_context)); |
199 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, | 199 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, |
200 content::Source<BrowserContext>(context)); | 200 content::Source<BrowserContext>(context)); |
201 if (context->IsOffTheRecord()) { | 201 if (context->IsOffTheRecord()) { |
202 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, | 202 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, |
203 content::Source<BrowserContext>(original_context)); | 203 content::Source<BrowserContext>(original_context)); |
204 } | 204 } |
205 | 205 |
| 206 // Note: event_page_idle_time_ must be sufficiently larger (e.g. 2x) than |
| 207 // kKeepaliveThrottleIntervalInSeconds in ppapi/proxy/plugin_globals. |
206 event_page_idle_time_ = base::TimeDelta::FromSeconds(10); | 208 event_page_idle_time_ = base::TimeDelta::FromSeconds(10); |
207 unsigned idle_time_msec = 0; | 209 unsigned idle_time_msec = 0; |
208 if (base::StringToUint(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 210 if (base::StringToUint(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
209 extensions::switches::kEventPageIdleTime), &idle_time_msec)) { | 211 extensions::switches::kEventPageIdleTime), &idle_time_msec)) { |
210 CHECK(idle_time_msec > 0); // OnKeepaliveImpulseCheck requires non zero. | 212 CHECK(idle_time_msec > 0); // OnKeepaliveImpulseCheck requires non zero. |
211 event_page_idle_time_ = base::TimeDelta::FromMilliseconds(idle_time_msec); | 213 event_page_idle_time_ = base::TimeDelta::FromMilliseconds(idle_time_msec); |
212 } | 214 } |
213 event_page_suspending_time_ = base::TimeDelta::FromSeconds(5); | 215 event_page_suspending_time_ = base::TimeDelta::FromSeconds(5); |
214 unsigned suspending_time_msec = 0; | 216 unsigned suspending_time_msec = 0; |
215 if (base::StringToUint(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 217 if (base::StringToUint(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
846 } | 848 } |
847 | 849 |
848 bool IncognitoProcessManager::IsIncognitoEnabled(const Extension* extension) { | 850 bool IncognitoProcessManager::IsIncognitoEnabled(const Extension* extension) { |
849 // Keep in sync with duplicate in extension_info_map.cc. | 851 // Keep in sync with duplicate in extension_info_map.cc. |
850 ExtensionService* service = ExtensionSystem::GetForBrowserContext( | 852 ExtensionService* service = ExtensionSystem::GetForBrowserContext( |
851 GetBrowserContext())->extension_service(); | 853 GetBrowserContext())->extension_service(); |
852 return extension_util::IsIncognitoEnabled(extension->id(), service); | 854 return extension_util::IsIncognitoEnabled(extension->id(), service); |
853 } | 855 } |
854 | 856 |
855 } // namespace extensions | 857 } // namespace extensions |
OLD | NEW |