| 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 COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_BASE_H_ | 5 #ifndef COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_BASE_H_ |
| 6 #define COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_BASE_H_ | 6 #define COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_BASE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <queue> | 9 #include <queue> |
| 10 | 10 |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 // that the clean-up on the browser side is done appropriately. Remove this | 215 // that the clean-up on the browser side is done appropriately. Remove this |
| 216 // method when BrowserPlugin is removed (https://crbug.com/535197). | 216 // method when BrowserPlugin is removed (https://crbug.com/535197). |
| 217 virtual void OnRenderFrameHostDeleted(int process_id, int routing_id); | 217 virtual void OnRenderFrameHostDeleted(int process_id, int routing_id); |
| 218 | 218 |
| 219 // WebContentsDelegate implementation. | 219 // WebContentsDelegate implementation. |
| 220 void HandleKeyboardEvent( | 220 void HandleKeyboardEvent( |
| 221 content::WebContents* source, | 221 content::WebContents* source, |
| 222 const content::NativeWebKeyboardEvent& event) override; | 222 const content::NativeWebKeyboardEvent& event) override; |
| 223 bool PreHandleGestureEvent(content::WebContents* source, | 223 bool PreHandleGestureEvent(content::WebContents* source, |
| 224 const blink::WebGestureEvent& event) override; | 224 const blink::WebGestureEvent& event) override; |
| 225 void FindReply(content::WebContents* source, | |
| 226 int request_id, | |
| 227 int number_of_matches, | |
| 228 const gfx::Rect& selection_rect, | |
| 229 int active_match_ordinal, | |
| 230 bool final_update) override; | |
| 231 | 225 |
| 232 // WebContentsObserver implementation. | 226 // WebContentsObserver implementation. |
| 233 void DidFinishNavigation( | 227 void DidFinishNavigation( |
| 234 content::NavigationHandle* navigation_handle) override; | 228 content::NavigationHandle* navigation_handle) override; |
| 235 | 229 |
| 236 // Given a set of initialization parameters, a concrete subclass of | 230 // Given a set of initialization parameters, a concrete subclass of |
| 237 // GuestViewBase can create a specialized WebContents that it returns back to | 231 // GuestViewBase can create a specialized WebContents that it returns back to |
| 238 // GuestViewBase. | 232 // GuestViewBase. |
| 239 virtual void CreateWebContents( | 233 virtual void CreateWebContents( |
| 240 const base::DictionaryValue& create_params, | 234 const base::DictionaryValue& create_params, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 | 283 |
| 290 // This method is invoked when the contents preferred size changes. This will | 284 // This method is invoked when the contents preferred size changes. This will |
| 291 // only ever fire if IsPreferredSizeSupported returns true. | 285 // only ever fire if IsPreferredSizeSupported returns true. |
| 292 virtual void OnPreferredSizeChanged(const gfx::Size& pref_size) {} | 286 virtual void OnPreferredSizeChanged(const gfx::Size& pref_size) {} |
| 293 | 287 |
| 294 // Signals that the guest view is ready. The default implementation signals | 288 // Signals that the guest view is ready. The default implementation signals |
| 295 // immediately, but derived class can override this if they need to do | 289 // immediately, but derived class can override this if they need to do |
| 296 // asynchronous setup. | 290 // asynchronous setup. |
| 297 virtual void SignalWhenReady(const base::Closure& callback); | 291 virtual void SignalWhenReady(const base::Closure& callback); |
| 298 | 292 |
| 299 // Returns true if this guest should handle find requests for its | |
| 300 // embedder. This should generally be true for guests that make up the | |
| 301 // entirety of the embedder's content. | |
| 302 virtual bool ShouldHandleFindRequestsForEmbedder() const; | |
| 303 | |
| 304 // This method is called immediately before suspended resource loads have been | 293 // This method is called immediately before suspended resource loads have been |
| 305 // resumed on attachment to an embedder. | 294 // resumed on attachment to an embedder. |
| 306 // | 295 // |
| 307 // This method can be overriden by subclasses. This gives the derived class | 296 // This method can be overriden by subclasses. This gives the derived class |
| 308 // an opportunity to perform setup actions before attachment. | 297 // an opportunity to perform setup actions before attachment. |
| 309 virtual void WillAttachToEmbedder() {} | 298 virtual void WillAttachToEmbedder() {} |
| 310 | 299 |
| 311 // This method is called when the guest WebContents is about to be destroyed. | 300 // This method is called when the guest WebContents is about to be destroyed. |
| 312 // | 301 // |
| 313 // This gives the derived class an opportunity to perform some cleanup prior | 302 // This gives the derived class an opportunity to perform some cleanup prior |
| (...skipping 24 matching lines...) Expand all Loading... |
| 338 | 327 |
| 339 class OwnerContentsObserver; | 328 class OwnerContentsObserver; |
| 340 class OpenerLifetimeObserver; | 329 class OpenerLifetimeObserver; |
| 341 | 330 |
| 342 // BrowserPluginGuestDelegate implementation. | 331 // BrowserPluginGuestDelegate implementation. |
| 343 content::WebContents* CreateNewGuestWindow( | 332 content::WebContents* CreateNewGuestWindow( |
| 344 const content::WebContents::CreateParams& create_params) final; | 333 const content::WebContents::CreateParams& create_params) final; |
| 345 void DidAttach(int guest_proxy_routing_id) final; | 334 void DidAttach(int guest_proxy_routing_id) final; |
| 346 void DidDetach() final; | 335 void DidDetach() final; |
| 347 content::WebContents* GetOwnerWebContents() const final; | 336 content::WebContents* GetOwnerWebContents() const final; |
| 348 bool HandleFindForEmbedder(int request_id, | |
| 349 const base::string16& search_text, | |
| 350 const blink::WebFindOptions& options) final; | |
| 351 bool HandleStopFindingForEmbedder(content::StopFindAction action) final; | |
| 352 void GuestSizeChanged(const gfx::Size& new_size) final; | 337 void GuestSizeChanged(const gfx::Size& new_size) final; |
| 353 void SetGuestHost(content::GuestHost* guest_host) final; | 338 void SetGuestHost(content::GuestHost* guest_host) final; |
| 354 void WillAttach(content::WebContents* embedder_web_contents, | 339 void WillAttach(content::WebContents* embedder_web_contents, |
| 355 int browser_plugin_instance_id, | 340 int browser_plugin_instance_id, |
| 356 bool is_full_page_plugin, | 341 bool is_full_page_plugin, |
| 357 const base::Closure& callback) final; | 342 const base::Closure& callback) final; |
| 358 | 343 |
| 359 // WebContentsDelegate implementation. | 344 // WebContentsDelegate implementation. |
| 360 void ActivateContents(content::WebContents* contents) final; | 345 void ActivateContents(content::WebContents* contents) final; |
| 361 void ContentsMouseEvent(content::WebContents* source, | 346 void ContentsMouseEvent(content::WebContents* source, |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 // This is used to ensure pending tasks will not fire after this object is | 472 // This is used to ensure pending tasks will not fire after this object is |
| 488 // destroyed. | 473 // destroyed. |
| 489 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; | 474 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; |
| 490 | 475 |
| 491 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); | 476 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); |
| 492 }; | 477 }; |
| 493 | 478 |
| 494 } // namespace guest_view | 479 } // namespace guest_view |
| 495 | 480 |
| 496 #endif // COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_BASE_H_ | 481 #endif // COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_BASE_H_ |
| OLD | NEW |