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/browser_permissions_policy_delegate.h" | 5 #include "chrome/browser/extensions/browser_permissions_policy_delegate.h" |
6 | 6 |
7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/profiles/profile_manager.h" | 9 #include "chrome/browser/profiles/profile_manager.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
11 #include "extensions/common/manifest_constants.h" | 11 #include "extensions/common/manifest_constants.h" |
12 | 12 |
13 #if !defined(OS_CHROMEOS) | 13 #if !defined(OS_CHROMEOS) |
14 #include "chrome/browser/signin/signin_manager.h" | 14 #include "chrome/browser/signin/chrome_signin_client.h" |
15 #include "chrome/browser/signin/signin_manager_factory.h" | 15 #include "chrome/browser/signin/chrome_signin_client_factory.h" |
16 #endif | 16 #endif |
17 | 17 |
18 namespace extensions { | 18 namespace extensions { |
19 | 19 |
20 namespace errors = manifest_errors; | 20 namespace errors = manifest_errors; |
21 | 21 |
22 BrowserPermissionsPolicyDelegate::BrowserPermissionsPolicyDelegate() { | 22 BrowserPermissionsPolicyDelegate::BrowserPermissionsPolicyDelegate() { |
23 PermissionsData::SetPolicyDelegate(this); | 23 PermissionsData::SetPolicyDelegate(this); |
24 } | 24 } |
25 BrowserPermissionsPolicyDelegate::~BrowserPermissionsPolicyDelegate() { | 25 BrowserPermissionsPolicyDelegate::~BrowserPermissionsPolicyDelegate() { |
(...skipping 15 matching lines...) Expand all Loading... |
41 if (!g_browser_process->profile_manager()) | 41 if (!g_browser_process->profile_manager()) |
42 return true; | 42 return true; |
43 | 43 |
44 // We don't have a Profile in this context. That's OK - for our purposes, | 44 // We don't have a Profile in this context. That's OK - for our purposes, |
45 // we can just check every Profile for its signin process. If any of them | 45 // we can just check every Profile for its signin process. If any of them |
46 // match, block script access. | 46 // match, block script access. |
47 std::vector<Profile*> profiles = | 47 std::vector<Profile*> profiles = |
48 g_browser_process->profile_manager()->GetLoadedProfiles(); | 48 g_browser_process->profile_manager()->GetLoadedProfiles(); |
49 for (std::vector<Profile*>::iterator profile = profiles.begin(); | 49 for (std::vector<Profile*>::iterator profile = profiles.begin(); |
50 profile != profiles.end(); ++profile) { | 50 profile != profiles.end(); ++profile) { |
51 SigninManager* signin_manager = | 51 ChromeSigninClient* signin_client = |
52 SigninManagerFactory::GetForProfile(*profile); | 52 ChromeSigninClientFactory::GetForProfile(*profile); |
53 if (signin_manager && signin_manager->IsSigninProcess(process_id)) { | 53 if (signin_client && signin_client->IsSigninProcess(process_id)) { |
54 if (error) | 54 if (error) |
55 *error = errors::kCannotScriptSigninPage; | 55 *error = errors::kCannotScriptSigninPage; |
56 return false; | 56 return false; |
57 } | 57 } |
58 } | 58 } |
59 #endif | 59 #endif |
60 | 60 |
61 return true; | 61 return true; |
62 } | 62 } |
63 | 63 |
64 } // namespace extensions | 64 } // namespace extensions |
OLD | NEW |