| 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 EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ | 5 #ifndef EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ |
| 6 #define EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ | 6 #define EXTENSIONS_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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 std::string* error); | 91 std::string* error); |
| 92 | 92 |
| 93 // GuestViewBase implementation. | 93 // GuestViewBase implementation. |
| 94 bool CanRunInDetachedState() const override; | 94 bool CanRunInDetachedState() const override; |
| 95 void CreateWebContents(const base::DictionaryValue& create_params, | 95 void CreateWebContents(const base::DictionaryValue& create_params, |
| 96 const WebContentsCreatedCallback& callback) override; | 96 const WebContentsCreatedCallback& callback) override; |
| 97 void DidAttachToEmbedder() override; | 97 void DidAttachToEmbedder() override; |
| 98 void DidDropLink(const GURL& url) override; | 98 void DidDropLink(const GURL& url) override; |
| 99 void DidInitialize(const base::DictionaryValue& create_params) override; | 99 void DidInitialize(const base::DictionaryValue& create_params) override; |
| 100 void DidStopLoading() override; | 100 void DidStopLoading() override; |
| 101 void EmbedderFullscreenToggled(bool entered_fullscreen) override; |
| 101 void EmbedderWillBeDestroyed() override; | 102 void EmbedderWillBeDestroyed() override; |
| 102 const char* GetAPINamespace() const override; | 103 const char* GetAPINamespace() const override; |
| 103 int GetTaskPrefix() const override; | 104 int GetTaskPrefix() const override; |
| 104 void GuestDestroyed() override; | 105 void GuestDestroyed() override; |
| 105 void GuestReady() override; | 106 void GuestReady() override; |
| 106 void GuestSizeChangedDueToAutoSize(const gfx::Size& old_size, | 107 void GuestSizeChangedDueToAutoSize(const gfx::Size& old_size, |
| 107 const gfx::Size& new_size) override; | 108 const gfx::Size& new_size) override; |
| 108 bool IsAutoSizeSupported() const override; | 109 bool IsAutoSizeSupported() const override; |
| 109 bool IsDragAndDropEnabled() const override; | 110 bool IsDragAndDropEnabled() const override; |
| 110 void WillAttachToEmbedder() override; | 111 void WillAttachToEmbedder() override; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 bool user_gesture, | 158 bool user_gesture, |
| 158 bool* was_blocked) override; | 159 bool* was_blocked) override; |
| 159 content::WebContents* OpenURLFromTab( | 160 content::WebContents* OpenURLFromTab( |
| 160 content::WebContents* source, | 161 content::WebContents* source, |
| 161 const content::OpenURLParams& params) override; | 162 const content::OpenURLParams& params) override; |
| 162 void WebContentsCreated(content::WebContents* source_contents, | 163 void WebContentsCreated(content::WebContents* source_contents, |
| 163 int opener_render_frame_id, | 164 int opener_render_frame_id, |
| 164 const base::string16& frame_name, | 165 const base::string16& frame_name, |
| 165 const GURL& target_url, | 166 const GURL& target_url, |
| 166 content::WebContents* new_contents) override; | 167 content::WebContents* new_contents) override; |
| 168 void EnterFullscreenModeForTab(content::WebContents* web_contents, |
| 169 const GURL& origin) override; |
| 170 void ExitFullscreenModeForTab(content::WebContents* web_contents) override; |
| 171 bool IsFullscreenForTabOrPending( |
| 172 const content::WebContents* web_contents) const override; |
| 167 | 173 |
| 168 // NotificationObserver implementation. | 174 // NotificationObserver implementation. |
| 169 void Observe(int type, | 175 void Observe(int type, |
| 170 const content::NotificationSource& source, | 176 const content::NotificationSource& source, |
| 171 const content::NotificationDetails& details) override; | 177 const content::NotificationDetails& details) override; |
| 172 | 178 |
| 173 // Returns the current zoom factor. | 179 // Returns the current zoom factor. |
| 174 double zoom() const { return current_zoom_factor_; } | 180 double zoom() const { return current_zoom_factor_; } |
| 175 | 181 |
| 176 // Begin or continue a find request. | 182 // Begin or continue a find request. |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 explicit WebViewGuest(content::WebContents* owner_web_contents); | 249 explicit WebViewGuest(content::WebContents* owner_web_contents); |
| 244 | 250 |
| 245 ~WebViewGuest() override; | 251 ~WebViewGuest() override; |
| 246 | 252 |
| 247 void AttachWebViewHelpers(content::WebContents* contents); | 253 void AttachWebViewHelpers(content::WebContents* contents); |
| 248 | 254 |
| 249 void OnWebViewNewWindowResponse(int new_window_instance_id, | 255 void OnWebViewNewWindowResponse(int new_window_instance_id, |
| 250 bool allow, | 256 bool allow, |
| 251 const std::string& user_input); | 257 const std::string& user_input); |
| 252 | 258 |
| 259 void OnFullscreenPermissionDecided(const GURL& origin, |
| 260 bool allowed, |
| 261 const std::string& user_input); |
| 262 void SetFullscreenState(bool is_fullscreen); |
| 263 |
| 253 // WebContentsObserver implementation. | 264 // WebContentsObserver implementation. |
| 254 void DidCommitProvisionalLoadForFrame( | 265 void DidCommitProvisionalLoadForFrame( |
| 255 content::RenderFrameHost* render_frame_host, | 266 content::RenderFrameHost* render_frame_host, |
| 256 const GURL& url, | 267 const GURL& url, |
| 257 ui::PageTransition transition_type) override; | 268 ui::PageTransition transition_type) override; |
| 258 void DidFailProvisionalLoad(content::RenderFrameHost* render_frame_host, | 269 void DidFailProvisionalLoad(content::RenderFrameHost* render_frame_host, |
| 259 const GURL& validated_url, | 270 const GURL& validated_url, |
| 260 int error_code, | 271 int error_code, |
| 261 const base::string16& error_description) override; | 272 const base::string16& error_description) override; |
| 262 void DidStartProvisionalLoadForFrame( | 273 void DidStartProvisionalLoadForFrame( |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 }; | 373 }; |
| 363 | 374 |
| 364 using PendingWindowMap = std::map<WebViewGuest*, NewWindowInfo>; | 375 using PendingWindowMap = std::map<WebViewGuest*, NewWindowInfo>; |
| 365 PendingWindowMap pending_new_windows_; | 376 PendingWindowMap pending_new_windows_; |
| 366 | 377 |
| 367 // Stores the current zoom factor. | 378 // Stores the current zoom factor. |
| 368 double current_zoom_factor_; | 379 double current_zoom_factor_; |
| 369 | 380 |
| 370 // Determines if this guest accepts pinch-zoom gestures. | 381 // Determines if this guest accepts pinch-zoom gestures. |
| 371 bool allow_scaling_; | 382 bool allow_scaling_; |
| 383 bool is_guest_fullscreen_; |
| 384 bool is_embedder_fullscreen_; |
| 385 bool last_fullscreen_permission_was_allowed_by_embedder_; |
| 372 | 386 |
| 373 // This is used to ensure pending tasks will not fire after this object is | 387 // This is used to ensure pending tasks will not fire after this object is |
| 374 // destroyed. | 388 // destroyed. |
| 375 base::WeakPtrFactory<WebViewGuest> weak_ptr_factory_; | 389 base::WeakPtrFactory<WebViewGuest> weak_ptr_factory_; |
| 376 | 390 |
| 377 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); | 391 DISALLOW_COPY_AND_ASSIGN(WebViewGuest); |
| 378 }; | 392 }; |
| 379 | 393 |
| 380 } // namespace extensions | 394 } // namespace extensions |
| 381 | 395 |
| 382 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ | 396 #endif // EXTENSIONS_BROWSER_GUEST_VIEW_WEB_VIEW_WEB_VIEW_GUEST_H_ |
| OLD | NEW |