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_BROWSER_CHROME_CONTENT_BROWSER_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_CHROME_CONTENT_BROWSER_CLIENT_H_ |
6 #define CHROME_BROWSER_CHROME_CONTENT_BROWSER_CLIENT_H_ | 6 #define CHROME_BROWSER_CHROME_CONTENT_BROWSER_CLIENT_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "base/memory/scoped_ptr.h" |
15 #include "chrome/common/chrome_version_info.h" | 16 #include "chrome/common/chrome_version_info.h" |
16 #include "content/public/browser/content_browser_client.h" | 17 #include "content/public/browser/content_browser_client.h" |
17 | 18 |
18 #if defined(OS_ANDROID) | |
19 #include "base/memory/scoped_ptr.h" | |
20 #endif | |
21 | |
22 namespace base { | 19 namespace base { |
23 class CommandLine; | 20 class CommandLine; |
24 } | 21 } |
25 | 22 |
26 namespace content { | 23 namespace content { |
27 class QuotaPermissionContext; | 24 class QuotaPermissionContext; |
28 } | 25 } |
29 | 26 |
30 namespace extensions { | 27 namespace extensions { |
31 class BrowserPermissionsPolicyDelegate; | 28 class BrowserPermissionsPolicyDelegate; |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 bool user_gesture, | 203 bool user_gesture, |
207 base::Callback<void(bool)> result_callback, | 204 base::Callback<void(bool)> result_callback, |
208 base::Closure* cancel_callback) OVERRIDE; | 205 base::Closure* cancel_callback) OVERRIDE; |
209 virtual void RequestMidiSysExPermission( | 206 virtual void RequestMidiSysExPermission( |
210 content::WebContents* web_contents, | 207 content::WebContents* web_contents, |
211 int bridge_id, | 208 int bridge_id, |
212 const GURL& requesting_frame, | 209 const GURL& requesting_frame, |
213 bool user_gesture, | 210 bool user_gesture, |
214 base::Callback<void(bool)> result_callback, | 211 base::Callback<void(bool)> result_callback, |
215 base::Closure* cancel_callback) OVERRIDE; | 212 base::Closure* cancel_callback) OVERRIDE; |
| 213 virtual void DidUseGeolocationPermission(content::WebContents* web_contents, |
| 214 const GURL& frame_url, |
| 215 const GURL& main_frame_url) OVERRIDE; |
216 virtual void RequestProtectedMediaIdentifierPermission( | 216 virtual void RequestProtectedMediaIdentifierPermission( |
217 content::WebContents* web_contents, | 217 content::WebContents* web_contents, |
218 const GURL& origin, | 218 const GURL& origin, |
219 base::Callback<void(bool)> result_callback, | 219 base::Callback<void(bool)> result_callback, |
220 base::Closure* cancel_callback) OVERRIDE; | 220 base::Closure* cancel_callback) OVERRIDE; |
221 virtual bool CanCreateWindow(const GURL& opener_url, | 221 virtual bool CanCreateWindow(const GURL& opener_url, |
222 const GURL& opener_top_level_frame_url, | 222 const GURL& opener_top_level_frame_url, |
223 const GURL& source_origin, | 223 const GURL& source_origin, |
224 WindowContainerType container_type, | 224 WindowContainerType container_type, |
225 const GURL& target_url, | 225 const GURL& target_url, |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 int child_process_id, | 288 int child_process_id, |
289 std::vector<content::FileDescriptorInfo>* mappings) OVERRIDE; | 289 std::vector<content::FileDescriptorInfo>* mappings) OVERRIDE; |
290 #endif | 290 #endif |
291 #if defined(OS_WIN) | 291 #if defined(OS_WIN) |
292 virtual const wchar_t* GetResourceDllName() OVERRIDE; | 292 virtual const wchar_t* GetResourceDllName() OVERRIDE; |
293 virtual void PreSpawnRenderer(sandbox::TargetPolicy* policy, | 293 virtual void PreSpawnRenderer(sandbox::TargetPolicy* policy, |
294 bool* success) OVERRIDE; | 294 bool* success) OVERRIDE; |
295 #endif | 295 #endif |
296 | 296 |
297 private: | 297 private: |
| 298 friend class DisableWebRtcEncryptionFlagTest; |
| 299 |
298 #if defined(ENABLE_WEBRTC) | 300 #if defined(ENABLE_WEBRTC) |
299 // Copies disable WebRTC encryption switch depending on the channel. | 301 // Copies disable WebRTC encryption switch depending on the channel. |
300 static void MaybeCopyDisableWebRtcEncryptionSwitch( | 302 static void MaybeCopyDisableWebRtcEncryptionSwitch( |
301 base::CommandLine* to_command_line, | 303 base::CommandLine* to_command_line, |
302 const base::CommandLine& from_command_line, | 304 const base::CommandLine& from_command_line, |
303 VersionInfo::Channel channel); | 305 VersionInfo::Channel channel); |
304 #endif | 306 #endif |
305 | 307 |
306 void FileSystemAccessed( | 308 void FileSystemAccessed( |
307 const GURL& url, | 309 const GURL& url, |
308 const std::vector<std::pair<int, int> >& render_frames, | 310 const std::vector<std::pair<int, int> >& render_frames, |
309 base::Callback<void(bool)> callback, | 311 base::Callback<void(bool)> callback, |
310 bool allow); | 312 bool allow); |
311 | 313 |
312 #if defined(ENABLE_EXTENSIONS) | 314 #if defined(ENABLE_EXTENSIONS) |
313 void GuestPermissionRequestHelper( | 315 void GuestPermissionRequestHelper( |
314 const GURL& url, | 316 const GURL& url, |
315 const std::vector<std::pair<int, int> >& render_frames, | 317 const std::vector<std::pair<int, int> >& render_frames, |
316 base::Callback<void(bool)> callback, | 318 base::Callback<void(bool)> callback, |
317 bool allow); | 319 bool allow); |
318 | 320 |
319 static void RequestFileSystemPermissionOnUIThread( | 321 static void RequestFileSystemPermissionOnUIThread( |
320 int render_process_id, | 322 int render_process_id, |
321 int render_frame_id, | 323 int render_frame_id, |
322 const GURL& url, | 324 const GURL& url, |
323 bool allowed_by_default, | 325 bool allowed_by_default, |
324 const base::Callback<void(bool)>& callback); | 326 const base::Callback<void(bool)>& callback); |
325 #endif | 327 #endif |
326 | 328 |
327 #if defined(ENABLE_PLUGINS) | 329 #if defined(ENABLE_PLUGINS) |
328 // Set of origins that can use TCP/UDP private APIs from NaCl. | 330 // Set of origins that can use TCP/UDP private APIs from NaCl. |
329 std::set<std::string> allowed_socket_origins_; | 331 std::set<std::string> allowed_socket_origins_; |
330 // Set of origins that can get a handle for FileIO from NaCl. | 332 // Set of origins that can get a handle for FileIO from NaCl. |
331 std::set<std::string> allowed_file_handle_origins_; | 333 std::set<std::string> allowed_file_handle_origins_; |
332 // Set of origins that can use "dev chanel" APIs from NaCl, even on stable | 334 // Set of origins that can use "dev chanel" APIs from NaCl, even on stable |
333 // versions of Chrome. | 335 // versions of Chrome. |
334 std::set<std::string> allowed_dev_channel_origins_; | 336 std::set<std::string> allowed_dev_channel_origins_; |
335 #endif | 337 #endif |
336 scoped_ptr<extensions::BrowserPermissionsPolicyDelegate> | 338 scoped_ptr<extensions::BrowserPermissionsPolicyDelegate> |
337 permissions_policy_delegate_; | 339 permissions_policy_delegate_; |
338 | 340 |
339 // The prerender tracker used to determine whether a render process is used | 341 // The prerender tracker used to determine whether a render process is used |
340 // for prerendering and an override cookie store must be provided. | 342 // for prerendering and an override cookie store must be provided. |
341 // This needs to be kept as a member rather than just looked up from | 343 // This needs to be kept as a member rather than just looked up from |
342 // the profile due to initialization ordering, as well as due to threading. | 344 // the profile due to initialization ordering, as well as due to threading. |
343 // It is initialized on the UI thread when the ResoureDispatcherHost is | 345 // It is initialized on the UI thread when the ResoureDispatcherHost is |
344 // created. It is used only the IO thread. | 346 // created. It is used only the IO thread. |
345 prerender::PrerenderTracker* prerender_tracker_; | 347 prerender::PrerenderTracker* prerender_tracker_; |
346 | 348 |
347 base::WeakPtrFactory<ChromeContentBrowserClient> weak_factory_; | 349 base::WeakPtrFactory<ChromeContentBrowserClient> weak_factory_; |
348 | |
349 friend class DisableWebRtcEncryptionFlagTest; | |
350 | 350 |
351 DISALLOW_COPY_AND_ASSIGN(ChromeContentBrowserClient); | 351 DISALLOW_COPY_AND_ASSIGN(ChromeContentBrowserClient); |
352 }; | 352 }; |
353 | 353 |
354 } // namespace chrome | 354 } // namespace chrome |
355 | 355 |
356 #endif // CHROME_BROWSER_CHROME_CONTENT_BROWSER_CLIENT_H_ | 356 #endif // CHROME_BROWSER_CHROME_CONTENT_BROWSER_CLIENT_H_ |
OLD | NEW |