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 <queue> | 8 #include <queue> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 // This value is only valid after attachment or first navigation. | 264 // This value is only valid after attachment or first navigation. |
265 int proxy_routing_id() const { return guest_proxy_routing_id_; } | 265 int proxy_routing_id() const { return guest_proxy_routing_id_; } |
266 | 266 |
267 // Destroy this guest. | 267 // Destroy this guest. |
268 void Destroy(); | 268 void Destroy(); |
269 | 269 |
270 // Saves the attach state of the custom element hosting this GuestView. | 270 // Saves the attach state of the custom element hosting this GuestView. |
271 void SetAttachParams(const base::DictionaryValue& params); | 271 void SetAttachParams(const base::DictionaryValue& params); |
272 void SetOpener(GuestViewBase* opener); | 272 void SetOpener(GuestViewBase* opener); |
273 | 273 |
274 // BrowserPluginGuestDelegate implementation. | |
275 content::WebContents* CreateNewGuestWindow( | 274 content::WebContents* CreateNewGuestWindow( |
276 const content::WebContents::CreateParams& create_params) final; | 275 const content::WebContents::CreateParams& create_params) final; |
277 void DidAttach(int guest_proxy_routing_id) final; | 276 void DidAttach(int guest_proxy_routing_id) final; |
278 void DidDetach() final; | 277 void DidDetach() final; |
279 content::WebContents* GetOwnerWebContents() const final; | 278 content::WebContents* GetOwnerWebContents() const final; |
280 bool Find(int request_id, | 279 bool Find(int request_id, |
281 const base::string16& search_text, | 280 const base::string16& search_text, |
282 const blink::WebFindOptions& options) final; | 281 const blink::WebFindOptions& options) final; |
283 bool StopFinding(content::StopFindAction action) final; | 282 bool StopFinding(content::StopFindAction action) final; |
284 void GuestSizeChanged(const gfx::Size& new_size) final; | 283 void GuestSizeChanged(const gfx::Size& new_size) final; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 // Signals that the guest view is ready. The default implementation signals | 355 // Signals that the guest view is ready. The default implementation signals |
357 // immediately, but derived class can override this if they need to do | 356 // immediately, but derived class can override this if they need to do |
358 // asynchronous setup. | 357 // asynchronous setup. |
359 virtual void SignalWhenReady(const base::Closure& callback); | 358 virtual void SignalWhenReady(const base::Closure& callback); |
360 | 359 |
361 // Returns true if this guest should handle find requests for its | 360 // Returns true if this guest should handle find requests for its |
362 // embedder. This should generally be true for guests that make up the | 361 // embedder. This should generally be true for guests that make up the |
363 // entirety of the embedder's content. | 362 // entirety of the embedder's content. |
364 virtual bool ShouldHandleFindRequestsForEmbedder() const; | 363 virtual bool ShouldHandleFindRequestsForEmbedder() const; |
365 | 364 |
| 365 // BrowserPluginGuestDelegate implementation. |
| 366 void SetContextMenuPosition(const gfx::Point& position) override; |
| 367 |
366 private: | 368 private: |
367 class OwnerContentsObserver; | 369 class OwnerContentsObserver; |
368 | 370 |
369 class OpenerLifetimeObserver; | 371 class OpenerLifetimeObserver; |
370 | 372 |
371 void SendQueuedEvents(); | 373 void SendQueuedEvents(); |
372 | 374 |
373 void CompleteInit(scoped_ptr<base::DictionaryValue> create_params, | 375 void CompleteInit(scoped_ptr<base::DictionaryValue> create_params, |
374 const WebContentsCreatedCallback& callback, | 376 const WebContentsCreatedCallback& callback, |
375 content::WebContents* guest_web_contents); | 377 content::WebContents* guest_web_contents); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 // This is used to ensure pending tasks will not fire after this object is | 466 // This is used to ensure pending tasks will not fire after this object is |
465 // destroyed. | 467 // destroyed. |
466 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; | 468 base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; |
467 | 469 |
468 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); | 470 DISALLOW_COPY_AND_ASSIGN(GuestViewBase); |
469 }; | 471 }; |
470 | 472 |
471 } // namespace guest_view | 473 } // namespace guest_view |
472 | 474 |
473 #endif // COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_BASE_H_ | 475 #endif // COMPONENTS_GUEST_VIEW_BROWSER_GUEST_VIEW_BASE_H_ |
OLD | NEW |