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

Side by Side Diff: chrome/renderer/extensions/resource_request_policy.h

Issue 562603002: Move PageTransition from //content/public/common to //ui/base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 3 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 #ifndef CHROME_RENDERER_EXTENSIONS_RESOURCE_REQUEST_POLICY_H_ 5 #ifndef CHROME_RENDERER_EXTENSIONS_RESOURCE_REQUEST_POLICY_H_
6 #define CHROME_RENDERER_EXTENSIONS_RESOURCE_REQUEST_POLICY_H_ 6 #define CHROME_RENDERER_EXTENSIONS_RESOURCE_REQUEST_POLICY_H_
7 7
8 #include "content/public/common/page_transition_types.h" 8 #include "ui/base/page_transition_types.h"
9 9
10 class GURL; 10 class GURL;
11 11
12 namespace blink { 12 namespace blink {
13 class WebFrame; 13 class WebFrame;
14 } 14 }
15 15
16 namespace extensions { 16 namespace extensions {
17 17
18 class ExtensionSet; 18 class ExtensionSet;
19 19
20 // Encapsulates the policy for when chrome-extension:// and 20 // Encapsulates the policy for when chrome-extension:// and
21 // chrome-extension-resource:// URLs can be requested. 21 // chrome-extension-resource:// URLs can be requested.
22 class ResourceRequestPolicy { 22 class ResourceRequestPolicy {
23 public: 23 public:
24 // Returns true if the chrome-extension:// |resource_url| can be requested 24 // Returns true if the chrome-extension:// |resource_url| can be requested
25 // from |frame_url|. In some cases this decision is made based upon how 25 // from |frame_url|. In some cases this decision is made based upon how
26 // this request was generated. Web triggered transitions are more restrictive 26 // this request was generated. Web triggered transitions are more restrictive
27 // than those triggered through UI. 27 // than those triggered through UI.
28 static bool CanRequestResource(const GURL& resource_url, 28 static bool CanRequestResource(const GURL& resource_url,
29 blink::WebFrame* frame, 29 blink::WebFrame* frame,
30 content::PageTransition transition_type, 30 ui::PageTransition transition_type,
31 const ExtensionSet* loaded_extensions); 31 const ExtensionSet* loaded_extensions);
32 // Returns true if the chrome-extension-resource:// |resource_url| can be 32 // Returns true if the chrome-extension-resource:// |resource_url| can be
33 // requested from |frame_url|. 33 // requested from |frame_url|.
34 static bool CanRequestExtensionResourceScheme(const GURL& resource_url, 34 static bool CanRequestExtensionResourceScheme(const GURL& resource_url,
35 blink::WebFrame* frame); 35 blink::WebFrame* frame);
36 36
37 private: 37 private:
38 ResourceRequestPolicy(); 38 ResourceRequestPolicy();
39 }; 39 };
40 40
41 } // namespace extensions 41 } // namespace extensions
42 42
43 #endif // CHROME_RENDERER_EXTENSIONS_RESOURCE_REQUEST_POLICY_H_ 43 #endif // CHROME_RENDERER_EXTENSIONS_RESOURCE_REQUEST_POLICY_H_
OLDNEW
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | chrome/renderer/extensions/resource_request_policy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698