OLD | NEW |
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_CHROME_CONTENT_RENDERER_CLIENT_H_ | 5 #ifndef CHROME_RENDERER_CHROME_CONTENT_RENDERER_CLIENT_H_ |
6 #define CHROME_RENDERER_CHROME_CONTENT_RENDERER_CLIENT_H_ | 6 #define CHROME_RENDERER_CHROME_CONTENT_RENDERER_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 const GURL& first_party_for_cookies, | 112 const GURL& first_party_for_cookies, |
113 std::string* cookies) OVERRIDE; | 113 std::string* cookies) OVERRIDE; |
114 virtual bool HandleSetCookieRequest(content::RenderView* sender, | 114 virtual bool HandleSetCookieRequest(content::RenderView* sender, |
115 const GURL& url, | 115 const GURL& url, |
116 const GURL& first_party_for_cookies, | 116 const GURL& first_party_for_cookies, |
117 const std::string& value) OVERRIDE; | 117 const std::string& value) OVERRIDE; |
118 virtual bool AllowBrowserPlugin( | 118 virtual bool AllowBrowserPlugin( |
119 WebKit::WebPluginContainer* container) const OVERRIDE; | 119 WebKit::WebPluginContainer* container) const OVERRIDE; |
120 virtual void RegisterPPAPIInterfaceFactories( | 120 virtual void RegisterPPAPIInterfaceFactories( |
121 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) OVERRIDE; | 121 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) OVERRIDE; |
122 virtual bool IsRequestOSFileHandleAllowedForURL( | |
123 const GURL& url) const OVERRIDE; | |
124 | 122 |
125 // For testing. | 123 // For testing. |
126 void SetExtensionDispatcher(extensions::Dispatcher* extension_dispatcher); | 124 void SetExtensionDispatcher(extensions::Dispatcher* extension_dispatcher); |
127 | 125 |
128 // Sets a new |spellcheck|. Used for low-mem restart and testing only. | 126 // Sets a new |spellcheck|. Used for low-mem restart and testing only. |
129 // Takes ownership of |spellcheck|. | 127 // Takes ownership of |spellcheck|. |
130 void SetSpellcheck(SpellCheck* spellcheck); | 128 void SetSpellcheck(SpellCheck* spellcheck); |
131 | 129 |
132 // Called in low-memory conditions to dump the memory used by the spellchecker | 130 // Called in low-memory conditions to dump the memory used by the spellchecker |
133 // and start over. | 131 // and start over. |
134 void OnPurgeMemory(); | 132 void OnPurgeMemory(); |
135 | 133 |
136 static WebKit::WebPlugin* CreatePlugin( | 134 static WebKit::WebPlugin* CreatePlugin( |
137 content::RenderView* render_view, | 135 content::RenderView* render_view, |
138 WebKit::WebFrame* frame, | 136 WebKit::WebFrame* frame, |
139 const WebKit::WebPluginParams& params, | 137 const WebKit::WebPluginParams& params, |
140 const ChromeViewHostMsg_GetPluginInfo_Output& output); | 138 const ChromeViewHostMsg_GetPluginInfo_Output& output); |
141 | 139 |
142 // TODO(mpcomplete): remove after we collect histogram data. | 140 // TODO(mpcomplete): remove after we collect histogram data. |
143 // http://crbug.com/100411 | 141 // http://crbug.com/100411 |
144 static bool IsAdblockInstalled(); | 142 static bool IsAdblockInstalled(); |
145 static bool IsAdblockPlusInstalled(); | 143 static bool IsAdblockPlusInstalled(); |
146 static bool IsAdblockWithWebRequestInstalled(); | 144 static bool IsAdblockWithWebRequestInstalled(); |
147 static bool IsAdblockPlusWithWebRequestInstalled(); | 145 static bool IsAdblockPlusWithWebRequestInstalled(); |
148 static bool IsOtherExtensionWithWebRequestInstalled(); | 146 static bool IsOtherExtensionWithWebRequestInstalled(); |
149 | 147 |
150 private: | 148 private: |
151 FRIEND_TEST_ALL_PREFIXES(ChromeContentRendererClientTest, NaClRestriction); | 149 FRIEND_TEST_ALL_PREFIXES(ChromeContentRendererClientTest, NaClRestriction); |
152 FRIEND_TEST_ALL_PREFIXES(ChromeContentRendererClientTest, | |
153 IsRequestOSFileHandleAllowedForURL); | |
154 | 150 |
155 const extensions::Extension* GetExtension( | 151 const extensions::Extension* GetExtension( |
156 const WebKit::WebSecurityOrigin& origin) const; | 152 const WebKit::WebSecurityOrigin& origin) const; |
157 | 153 |
158 // Returns true if the frame is navigating to an URL either into or out of an | 154 // Returns true if the frame is navigating to an URL either into or out of an |
159 // extension app's extent. | 155 // extension app's extent. |
160 bool CrossesExtensionExtents(WebKit::WebFrame* frame, | 156 bool CrossesExtensionExtents(WebKit::WebFrame* frame, |
161 const GURL& new_url, | 157 const GURL& new_url, |
162 const ExtensionSet& extensions, | 158 const ExtensionSet& extensions, |
163 bool is_extension_url, | 159 bool is_extension_url, |
164 bool is_initial_navigation); | 160 bool is_initial_navigation); |
165 | 161 |
166 static GURL GetNaClContentHandlerURL(const std::string& actual_mime_type, | 162 static GURL GetNaClContentHandlerURL(const std::string& actual_mime_type, |
167 const webkit::WebPluginInfo& plugin); | 163 const webkit::WebPluginInfo& plugin); |
168 static bool IsNaClAllowed(const GURL& manifest_url, | 164 static bool IsNaClAllowed(const GURL& manifest_url, |
169 const GURL& top_url, | 165 const GURL& top_url, |
170 bool is_nacl_unrestricted, | 166 bool is_nacl_unrestricted, |
171 const extensions::Extension* extension, | 167 const extensions::Extension* extension, |
172 WebKit::WebPluginParams* params); | 168 WebKit::WebPluginParams* params); |
173 | 169 |
174 void RegisterRequestOSFileHandleAllowedHosts( | |
175 const std::string& allowed_list); | |
176 | |
177 scoped_ptr<ChromeRenderProcessObserver> chrome_observer_; | 170 scoped_ptr<ChromeRenderProcessObserver> chrome_observer_; |
178 scoped_ptr<extensions::Dispatcher> extension_dispatcher_; | 171 scoped_ptr<extensions::Dispatcher> extension_dispatcher_; |
179 scoped_ptr<RendererNetPredictor> net_predictor_; | 172 scoped_ptr<RendererNetPredictor> net_predictor_; |
180 scoped_ptr<SpellCheck> spellcheck_; | 173 scoped_ptr<SpellCheck> spellcheck_; |
181 scoped_ptr<components::VisitedLinkSlave> visited_link_slave_; | 174 scoped_ptr<components::VisitedLinkSlave> visited_link_slave_; |
182 scoped_ptr<safe_browsing::PhishingClassifierFilter> phishing_classifier_; | 175 scoped_ptr<safe_browsing::PhishingClassifierFilter> phishing_classifier_; |
183 scoped_ptr<prerender::PrerenderDispatcher> prerender_dispatcher_; | 176 scoped_ptr<prerender::PrerenderDispatcher> prerender_dispatcher_; |
184 // The whitelist for RequestOSFileHandle specified by commandline. | |
185 std::vector<std::string> request_os_file_handle_allowed_hosts_; | |
186 }; | 177 }; |
187 | 178 |
188 } // namespace chrome | 179 } // namespace chrome |
189 | 180 |
190 #endif // CHROME_RENDERER_CHROME_CONTENT_RENDERER_CLIENT_H_ | 181 #endif // CHROME_RENDERER_CHROME_CONTENT_RENDERER_CLIENT_H_ |
OLD | NEW |