Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Side by Side Diff: chrome/browser/extensions/browser_permissions_policy_delegate.cc

Issue 321533003: Separate PermissionsData::CanExecuteScriptOnPage into two functions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 13 matching lines...) Expand all
24 } 24 }
25 BrowserPermissionsPolicyDelegate::~BrowserPermissionsPolicyDelegate() { 25 BrowserPermissionsPolicyDelegate::~BrowserPermissionsPolicyDelegate() {
26 PermissionsData::SetPolicyDelegate(NULL); 26 PermissionsData::SetPolicyDelegate(NULL);
27 } 27 }
28 28
29 bool BrowserPermissionsPolicyDelegate::CanExecuteScriptOnPage( 29 bool BrowserPermissionsPolicyDelegate::CanExecuteScriptOnPage(
30 const Extension* extension, 30 const Extension* extension,
31 const GURL& document_url, 31 const GURL& document_url,
32 const GURL& top_document_url, 32 const GURL& top_document_url,
33 int tab_id, 33 int tab_id,
34 const UserScript* script,
35 int process_id, 34 int process_id,
36 std::string* error) { 35 std::string* error) {
37 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 36 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
38 37
39 #if !defined(OS_CHROMEOS) 38 #if !defined(OS_CHROMEOS)
40 // NULL in unit tests. 39 // NULL in unit tests.
41 if (!g_browser_process->profile_manager()) 40 if (!g_browser_process->profile_manager())
42 return true; 41 return true;
43 42
44 // We don't have a Profile in this context. That's OK - for our purposes, 43 // We don't have a Profile in this context. That's OK - for our purposes,
(...skipping 10 matching lines...) Expand all
55 *error = errors::kCannotScriptSigninPage; 54 *error = errors::kCannotScriptSigninPage;
56 return false; 55 return false;
57 } 56 }
58 } 57 }
59 #endif 58 #endif
60 59
61 return true; 60 return true;
62 } 61 }
63 62
64 } // namespace extensions 63 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698