| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ | 5 #ifndef CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ |
| 6 #define CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ | 6 #define CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 // - Denied if the embedder explicitly denied. | 267 // - Denied if the embedder explicitly denied. |
| 268 // - Determined by the guest's content settings if the embedder does not | 268 // - Determined by the guest's content settings if the embedder does not |
| 269 // perform an explicit action. | 269 // perform an explicit action. |
| 270 // If access was blocked due to the page's content settings, | 270 // If access was blocked due to the page's content settings, |
| 271 // |blocked_by_policy| should be true, and this function should invoke | 271 // |blocked_by_policy| should be true, and this function should invoke |
| 272 // OnContentBlocked. | 272 // OnContentBlocked. |
| 273 static void FileSystemAccessedSync(int render_process_id, | 273 static void FileSystemAccessedSync(int render_process_id, |
| 274 int render_frame_id, | 274 int render_frame_id, |
| 275 const GURL& url, | 275 const GURL& url, |
| 276 bool blocked_by_policy, | 276 bool blocked_by_policy, |
| 277 IPC::Message* reply_msg); | 277 base::Callback<void(bool)> callback); |
| 278 | 278 |
| 279 private: | 279 private: |
| 280 virtual ~WebViewGuest(); | 280 virtual ~WebViewGuest(); |
| 281 | 281 |
| 282 // A map to store the callback for a request keyed by the request's id. | 282 // A map to store the callback for a request keyed by the request's id. |
| 283 struct PermissionResponseInfo { | 283 struct PermissionResponseInfo { |
| 284 PermissionResponseCallback callback; | 284 PermissionResponseCallback callback; |
| 285 WebViewPermissionType permission_type; | 285 WebViewPermissionType permission_type; |
| 286 bool allowed_by_default; | 286 bool allowed_by_default; |
| 287 PermissionResponseInfo(); | 287 PermissionResponseInfo(); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 void OnWebViewNewWindowResponse(int new_window_instance_id, | 329 void OnWebViewNewWindowResponse(int new_window_instance_id, |
| 330 bool allow, | 330 bool allow, |
| 331 const std::string& user_input); | 331 const std::string& user_input); |
| 332 | 332 |
| 333 static void FileSystemAccessedAsyncResponse(int render_process_id, | 333 static void FileSystemAccessedAsyncResponse(int render_process_id, |
| 334 int render_frame_id, | 334 int render_frame_id, |
| 335 int request_id, | 335 int request_id, |
| 336 const GURL& url, | 336 const GURL& url, |
| 337 bool allowed); | 337 bool allowed); |
| 338 | 338 |
| 339 static void FileSystemAccessedSyncResponse(int render_process_id, | 339 static void FileSystemAccessedSyncResponse( |
| 340 int render_frame_id, | 340 int render_process_id, |
| 341 const GURL& url, | 341 int render_frame_id, |
| 342 IPC::Message* reply_msg, | 342 const GURL& url, |
| 343 bool allowed); | 343 base::Callback<void(bool)> callback, |
| 344 bool allowed); |
| 344 | 345 |
| 345 // WebContentsObserver implementation. | 346 // WebContentsObserver implementation. |
| 346 virtual void DidCommitProvisionalLoadForFrame( | 347 virtual void DidCommitProvisionalLoadForFrame( |
| 347 int64 frame_id, | 348 int64 frame_id, |
| 348 const base::string16& frame_unique_name, | 349 const base::string16& frame_unique_name, |
| 349 bool is_main_frame, | 350 bool is_main_frame, |
| 350 const GURL& url, | 351 const GURL& url, |
| 351 content::PageTransition transition_type, | 352 content::PageTransition transition_type, |
| 352 content::RenderViewHost* render_view_host) OVERRIDE; | 353 content::RenderViewHost* render_view_host) OVERRIDE; |
| 353 virtual void DidFailProvisionalLoad( | 354 virtual void DidFailProvisionalLoad( |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 name(name) {} | 503 name(name) {} |
| 503 }; | 504 }; |
| 504 | 505 |
| 505 typedef std::map<WebViewGuest*, NewWindowInfo> PendingWindowMap; | 506 typedef std::map<WebViewGuest*, NewWindowInfo> PendingWindowMap; |
| 506 PendingWindowMap pending_new_windows_; | 507 PendingWindowMap pending_new_windows_; |
| 507 | 508 |
| 508 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); | 509 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); |
| 509 }; | 510 }; |
| 510 | 511 |
| 511 #endif // CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ | 512 #endif // CHROME_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ |
| OLD | NEW |