OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_process_manager_delegate.h" | 5 #include "chrome/browser/extensions/chrome_process_manager_delegate.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 content::NotificationService::AllSources()); | 34 content::NotificationService::AllSources()); |
35 } | 35 } |
36 | 36 |
37 ChromeProcessManagerDelegate::~ChromeProcessManagerDelegate() { | 37 ChromeProcessManagerDelegate::~ChromeProcessManagerDelegate() { |
38 } | 38 } |
39 | 39 |
40 bool ChromeProcessManagerDelegate::IsBackgroundPageAllowed( | 40 bool ChromeProcessManagerDelegate::IsBackgroundPageAllowed( |
41 content::BrowserContext* context) const { | 41 content::BrowserContext* context) const { |
42 Profile* profile = static_cast<Profile*>(context); | 42 Profile* profile = static_cast<Profile*>(context); |
43 | 43 |
44 bool is_normal_session = !profile->IsGuestSession(); | 44 bool is_normal_session = !profile->IsGuestSession() && |
| 45 !profile->IsSystemProfile(); |
45 #if defined(OS_CHROMEOS) | 46 #if defined(OS_CHROMEOS) |
46 is_normal_session = is_normal_session && | 47 is_normal_session = is_normal_session && |
47 user_manager::UserManager::Get()->IsUserLoggedIn(); | 48 user_manager::UserManager::Get()->IsUserLoggedIn(); |
48 #endif | 49 #endif |
49 | 50 |
50 // Disallow if the current session is a Guest mode session or login screen but | 51 // Disallow if the current session is a Guest mode session or login screen but |
51 // the current browser context is *not* off-the-record. Such context is | 52 // the current browser context is *not* off-the-record. Such context is |
52 // artificial and background page shouldn't be created in it. | 53 // artificial and background page shouldn't be created in it. |
53 // http://crbug.com/329498 | 54 // http://crbug.com/329498 |
54 return is_normal_session || profile->IsOffTheRecord(); | 55 return is_normal_session || profile->IsOffTheRecord(); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 ProcessManager* incognito_manager = | 163 ProcessManager* incognito_manager = |
163 ProcessManagerFactory::GetForBrowserContextIfExists( | 164 ProcessManagerFactory::GetForBrowserContextIfExists( |
164 profile->GetOffTheRecordProfile()); | 165 profile->GetOffTheRecordProfile()); |
165 if (incognito_manager) { | 166 if (incognito_manager) { |
166 incognito_manager->CloseBackgroundHosts(); | 167 incognito_manager->CloseBackgroundHosts(); |
167 } | 168 } |
168 } | 169 } |
169 } | 170 } |
170 | 171 |
171 } // namespace extensions | 172 } // namespace extensions |
OLD | NEW |