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

Side by Side Diff: chrome/browser/extensions/api/web_request/web_request_permissions.cc

Issue 254763005: Move some content url constants to /url. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve a merge conflict. Created 6 years, 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/api/web_request/web_request_permissions.h" 5 #include "chrome/browser/extensions/api/web_request/web_request_permissions.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "chrome/browser/extensions/extension_renderer_state.h" 9 #include "chrome/browser/extensions/extension_renderer_state.h"
10 #include "chrome/common/extensions/extension_constants.h" 10 #include "chrome/common/extensions/extension_constants.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } 65 }
66 66
67 // Returns true if the scheme is one we want to allow extensions to have access 67 // Returns true if the scheme is one we want to allow extensions to have access
68 // to. Extensions still need specific permissions for a given URL, which is 68 // to. Extensions still need specific permissions for a given URL, which is
69 // covered by CanExtensionAccessURL. 69 // covered by CanExtensionAccessURL.
70 bool HasWebRequestScheme(const GURL& url) { 70 bool HasWebRequestScheme(const GURL& url) {
71 return (url.SchemeIs(content::kAboutScheme) || 71 return (url.SchemeIs(content::kAboutScheme) ||
72 url.SchemeIs(content::kFileScheme) || 72 url.SchemeIs(content::kFileScheme) ||
73 url.SchemeIs(content::kFileSystemScheme) || 73 url.SchemeIs(content::kFileSystemScheme) ||
74 url.SchemeIs(content::kFtpScheme) || 74 url.SchemeIs(content::kFtpScheme) ||
75 url.SchemeIs(content::kHttpScheme) || 75 url.SchemeIs(url::kHttpScheme) ||
76 url.SchemeIs(content::kHttpsScheme) || 76 url.SchemeIs(url::kHttpsScheme) ||
77 url.SchemeIs(extensions::kExtensionScheme)); 77 url.SchemeIs(extensions::kExtensionScheme));
78 } 78 }
79 79
80 } // namespace 80 } // namespace
81 81
82 // static 82 // static
83 bool WebRequestPermissions::HideRequest( 83 bool WebRequestPermissions::HideRequest(
84 const extensions::InfoMap* extension_info_map, 84 const extensions::InfoMap* extension_info_map,
85 const net::URLRequest* request) { 85 const net::URLRequest* request) {
86 // Hide requests from the Chrome WebStore App or signin process. 86 // Hide requests from the Chrome WebStore App or signin process.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 } 139 }
140 break; 140 break;
141 case REQUIRE_ALL_URLS: 141 case REQUIRE_ALL_URLS:
142 if (!extensions::PermissionsData::HasEffectiveAccessToAllHosts(extension)) 142 if (!extensions::PermissionsData::HasEffectiveAccessToAllHosts(extension))
143 return false; 143 return false;
144 break; 144 break;
145 } 145 }
146 146
147 return true; 147 return true;
148 } 148 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/web_navigation/frame_navigation_state.cc ('k') | chrome/browser/history/history_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698