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

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

Issue 10827107: Allow transitions to WebUI pages which are extension urls (new tab page is the relevant example). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 (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_EXTENSION_RESOURCE_REQUEST_POLICY_H_ 5 #ifndef CHROME_RENDERER_EXTENSIONS_EXTENSION_RESOURCE_REQUEST_POLICY_H_
6 #define CHROME_RENDERER_EXTENSIONS_EXTENSION_RESOURCE_REQUEST_POLICY_H_ 6 #define CHROME_RENDERER_EXTENSIONS_EXTENSION_RESOURCE_REQUEST_POLICY_H_
7 7
8 #include "content/public/common/page_transition_types.h"
9
8 class ExtensionSet; 10 class ExtensionSet;
9 class GURL; 11 class GURL;
10 namespace WebKit { 12 namespace WebKit {
11 class WebFrame; 13 class WebFrame;
12 } 14 }
13 15
14 // Encapsulates the policy for when chrome-extension:// and 16 // Encapsulates the policy for when chrome-extension:// and
15 // chrome-extension-resource:// URLs can be requested. 17 // chrome-extension-resource:// URLs can be requested.
16 class ExtensionResourceRequestPolicy { 18 class ExtensionResourceRequestPolicy {
17 public: 19 public:
18 // Returns true if the chrome-extension:// |resource_url| can be requested 20 // Returns true if the chrome-extension:// |resource_url| can be requested
19 // from |frame_url|. 21 // from |frame_url|.
Charlie Reis 2012/08/03 21:36:11 Can we say something in this comment about why the
Cris Neckar 2012/08/06 19:25:58 Done.
20 static bool CanRequestResource(const GURL& resource_url, 22 static bool CanRequestResource(const GURL& resource_url,
21 WebKit::WebFrame* frame, 23 WebKit::WebFrame* frame,
24 content::PageTransition transition_type,
22 const ExtensionSet* loaded_extensions); 25 const ExtensionSet* loaded_extensions);
23 // Returns true if the chrome-extension-resource:// |resource_url| can be 26 // Returns true if the chrome-extension-resource:// |resource_url| can be
24 // requested from |frame_url|. 27 // requested from |frame_url|.
25 static bool CanRequestExtensionResourceScheme( 28 static bool CanRequestExtensionResourceScheme(
26 const GURL& resource_url, 29 const GURL& resource_url,
27 WebKit::WebFrame* frame); 30 WebKit::WebFrame* frame);
28 31
29 private: 32 private:
30 ExtensionResourceRequestPolicy(); 33 ExtensionResourceRequestPolicy();
31 }; 34 };
32 35
33 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_RESOURCE_REQUEST_POLICY_H_ 36 #endif // CHROME_RENDERER_EXTENSIONS_EXTENSION_RESOURCE_REQUEST_POLICY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698