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" |
(...skipping 30 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 ChromeSigninClient* signin_client = | 51 SigninClient* signin_client = |
52 ChromeSigninClientFactory::GetForProfile(*profile); | 52 ChromeSigninClientFactory::GetForProfile(*profile); |
53 if (signin_client && signin_client->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 |