Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(523)

Side by Side Diff: content/browser/web_contents/web_contents_impl.h

Issue 10868012: Browser Plugin: New Implementation (Browser Side) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master-trial-obrowser
Patch Set: Address 3 issues: Cleaning up embedder on RVH swap, empty src handling fix, subframe's guest cleanu… Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 21 matching lines...) Expand all
32 #include "base/win/scoped_handle.h" 32 #include "base/win/scoped_handle.h"
33 #endif 33 #endif
34 34
35 class InterstitialPageImpl; 35 class InterstitialPageImpl;
36 class SavePackage; 36 class SavePackage;
37 class SessionStorageNamespaceImpl; 37 class SessionStorageNamespaceImpl;
38 class WebContentsImpl; 38 class WebContentsImpl;
39 struct ViewMsg_PostMessage_Params; 39 struct ViewMsg_PostMessage_Params;
40 40
41 namespace content { 41 namespace content {
42 class BrowserPluginEmbedder;
43 class BrowserPluginGuest;
42 class ColorChooser; 44 class ColorChooser;
43 class DownloadItem; 45 class DownloadItem;
44 class JavaScriptDialogCreator; 46 class JavaScriptDialogCreator;
45 class RenderViewHost; 47 class RenderViewHost;
46 class RenderViewHostDelegateView; 48 class RenderViewHostDelegateView;
47 class RenderViewHostImpl; 49 class RenderViewHostImpl;
48 class SiteInstance; 50 class SiteInstance;
49 class TestWebContents; 51 class TestWebContents;
50 class WebContentsDelegate; 52 class WebContentsDelegate;
51 class WebContentsObserver; 53 class WebContentsObserver;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 content::old::BrowserPluginHost* old_browser_plugin_host() const { 147 content::old::BrowserPluginHost* old_browser_plugin_host() const {
146 return old_browser_plugin_host_.get(); 148 return old_browser_plugin_host_.get();
147 } 149 }
148 150
149 // Like GetController from WebContents, but returns the concrete object. 151 // Like GetController from WebContents, but returns the concrete object.
150 NavigationControllerImpl& GetControllerImpl(); 152 NavigationControllerImpl& GetControllerImpl();
151 153
152 // Expose the render manager for testing. 154 // Expose the render manager for testing.
153 RenderViewHostManager* GetRenderManagerForTesting(); 155 RenderViewHostManager* GetRenderManagerForTesting();
154 156
157 // Sets guest to this WebContents embedder.
158 content::BrowserPluginGuest* SetBrowserPluginGuest(int instance_id);
159 // Returns guest browser plugin object, or NULL if this WebContents is not a
160 // guest.
161 content::BrowserPluginGuest* GetBrowserPluginGuest();
162 // Returns embedder browser plugin object, or NULL if this WebContents is not
163 // an embedder.
164 content::BrowserPluginEmbedder* GetBrowserPluginEmbedder();
165
155 // content::WebContents ------------------------------------------------------ 166 // content::WebContents ------------------------------------------------------
156 virtual const base::PropertyBag* GetPropertyBag() const OVERRIDE; 167 virtual const base::PropertyBag* GetPropertyBag() const OVERRIDE;
157 virtual base::PropertyBag* GetPropertyBag() OVERRIDE; 168 virtual base::PropertyBag* GetPropertyBag() OVERRIDE;
158 virtual content::WebContentsDelegate* GetDelegate() OVERRIDE; 169 virtual content::WebContentsDelegate* GetDelegate() OVERRIDE;
159 virtual void SetDelegate(content::WebContentsDelegate* delegate) OVERRIDE; 170 virtual void SetDelegate(content::WebContentsDelegate* delegate) OVERRIDE;
160 virtual content::NavigationController& GetController() OVERRIDE; 171 virtual content::NavigationController& GetController() OVERRIDE;
161 virtual const content::NavigationController& GetController() const OVERRIDE; 172 virtual const content::NavigationController& GetController() const OVERRIDE;
162 virtual content::BrowserContext* GetBrowserContext() const OVERRIDE; 173 virtual content::BrowserContext* GetBrowserContext() const OVERRIDE;
163 virtual content::RenderProcessHost* GetRenderProcessHost() const OVERRIDE; 174 virtual content::RenderProcessHost* GetRenderProcessHost() const OVERRIDE;
164 virtual content::RenderViewHost* GetRenderViewHost() const OVERRIDE; 175 virtual content::RenderViewHost* GetRenderViewHost() const OVERRIDE;
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 void OnAppCacheAccessed(const GURL& manifest_url, bool blocked_by_policy); 523 void OnAppCacheAccessed(const GURL& manifest_url, bool blocked_by_policy);
513 void OnOpenColorChooser(int color_chooser_id, SkColor color); 524 void OnOpenColorChooser(int color_chooser_id, SkColor color);
514 void OnEndColorChooser(int color_chooser_id); 525 void OnEndColorChooser(int color_chooser_id);
515 void OnSetSelectedColorInColorChooser(int color_chooser_id, SkColor color); 526 void OnSetSelectedColorInColorChooser(int color_chooser_id, SkColor color);
516 void OnPepperPluginHung(int plugin_child_id, 527 void OnPepperPluginHung(int plugin_child_id,
517 const FilePath& path, 528 const FilePath& path,
518 bool is_hung); 529 bool is_hung);
519 void OnWebUISend(const GURL& source_url, 530 void OnWebUISend(const GURL& source_url,
520 const std::string& name, 531 const std::string& name,
521 const base::ListValue& args); 532 const base::ListValue& args);
533 void OnBrowserPluginNavigateGuest(int instance_id,
534 int64 frame_id,
535 std::string src,
536 gfx::Size size);
522 537
523 // Changes the IsLoading state and notifies delegate as needed 538 // Changes the IsLoading state and notifies delegate as needed
524 // |details| is used to provide details on the load that just finished 539 // |details| is used to provide details on the load that just finished
525 // (but can be null if not applicable). Can be overridden. 540 // (but can be null if not applicable). Can be overridden.
526 void SetIsLoading(bool is_loading, 541 void SetIsLoading(bool is_loading,
527 content::LoadNotificationDetails* details); 542 content::LoadNotificationDetails* details);
528 543
529 // Called by derived classes to indicate that we're no longer waiting for a 544 // Called by derived classes to indicate that we're no longer waiting for a
530 // response. This won't actually update the throbber, but it will get picked 545 // response. This won't actually update the throbber, but it will get picked
531 // up at the next animation step if the throbber is going. 546 // up at the next animation step if the throbber is going.
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 void SaveURL(const GURL& url, 632 void SaveURL(const GURL& url,
618 const content::Referrer& referrer, 633 const content::Referrer& referrer,
619 bool is_main_frame); 634 bool is_main_frame);
620 635
621 content::RenderViewHostImpl* GetRenderViewHostImpl(); 636 content::RenderViewHostImpl* GetRenderViewHostImpl();
622 637
623 void GetBrowserPluginEmbedderInfo(content::RenderViewHost* render_view_host, 638 void GetBrowserPluginEmbedderInfo(content::RenderViewHost* render_view_host,
624 std::string* embedder_channel_name, 639 std::string* embedder_channel_name,
625 int* embedder_container_id); 640 int* embedder_container_id);
626 641
642 // Removes browser plugin embedder if there is one and its associated
643 // RenderViewHost has been swapped out.
644 void RemoveSwappedOutBrowserPluginEmbedder();
645
627 // Stores random bits of data for others to associate with this object. 646 // Stores random bits of data for others to associate with this object.
628 // WARNING: this needs to be deleted after NavigationController. 647 // WARNING: this needs to be deleted after NavigationController.
629 base::PropertyBag property_bag_; 648 base::PropertyBag property_bag_;
630 649
631 // Data for core operation --------------------------------------------------- 650 // Data for core operation ---------------------------------------------------
632 651
633 // Delegate for notifying our owner about stuff. Not owned by us. 652 // Delegate for notifying our owner about stuff. Not owned by us.
634 content::WebContentsDelegate* delegate_; 653 content::WebContentsDelegate* delegate_;
635 654
636 // Handles the back/forward list and loading. 655 // Handles the back/forward list and loading.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 687
669 // Manages creation and swapping of render views. 688 // Manages creation and swapping of render views.
670 RenderViewHostManager render_manager_; 689 RenderViewHostManager render_manager_;
671 690
672 // Manages injecting Java objects into all RenderViewHosts associated with 691 // Manages injecting Java objects into all RenderViewHosts associated with
673 // this WebContentsImpl. 692 // this WebContentsImpl.
674 scoped_ptr<JavaBridgeDispatcherHostManager> 693 scoped_ptr<JavaBridgeDispatcherHostManager>
675 java_bridge_dispatcher_host_manager_; 694 java_bridge_dispatcher_host_manager_;
676 695
677 // TODO(fsamuel): Remove this once upstreaming of the new browser plugin 696 // TODO(fsamuel): Remove this once upstreaming of the new browser plugin
678 // implmentation is complete. 697 // implementation is complete.
679 // Manages the browser plugin instances hosted by this WebContents. 698 // Manages the browser plugin instances hosted by this WebContents.
680 scoped_ptr<content::old::BrowserPluginHost> old_browser_plugin_host_; 699 scoped_ptr<content::old::BrowserPluginHost> old_browser_plugin_host_;
681 700
682 // SavePackage, lazily created. 701 // SavePackage, lazily created.
683 scoped_refptr<SavePackage> save_package_; 702 scoped_refptr<SavePackage> save_package_;
684 703
685 // Data for loading state ---------------------------------------------------- 704 // Data for loading state ----------------------------------------------------
686 705
687 // Indicates whether we're currently loading a resource. 706 // Indicates whether we're currently loading a resource.
688 bool is_loading_; 707 bool is_loading_;
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 // The intrinsic size of the page. 806 // The intrinsic size of the page.
788 gfx::Size preferred_size_; 807 gfx::Size preferred_size_;
789 808
790 // Content restrictions, used to disable print/copy etc based on content's 809 // Content restrictions, used to disable print/copy etc based on content's
791 // (full-page plugins for now only) permissions. 810 // (full-page plugins for now only) permissions.
792 int content_restrictions_; 811 int content_restrictions_;
793 812
794 // Color chooser that was opened by this tab. 813 // Color chooser that was opened by this tab.
795 content::ColorChooser* color_chooser_; 814 content::ColorChooser* color_chooser_;
796 815
816 // Manages the embedder state for browser plugins, if this WebContents is an
817 // embedder; NULL otherwise.
818 scoped_ptr<content::BrowserPluginEmbedder> browser_plugin_embedder_;
819 // Manages the guest state for browser plugin, if this WebContents is a guest;
820 // NULL otherwise.
821 scoped_ptr<content::BrowserPluginGuest> browser_plugin_guest_;
822
797 // This must be at the end, or else we might get notifications and use other 823 // This must be at the end, or else we might get notifications and use other
798 // member variables that are gone. 824 // member variables that are gone.
799 content::NotificationRegistrar registrar_; 825 content::NotificationRegistrar registrar_;
800 826
801 // Used during IPC message dispatching so that the handlers can get a pointer 827 // Used during IPC message dispatching so that the handlers can get a pointer
802 // to the RVH through which the message was received. 828 // to the RVH through which the message was received.
803 content::RenderViewHost* message_source_; 829 content::RenderViewHost* message_source_;
804 830
805 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl); 831 DISALLOW_COPY_AND_ASSIGN(WebContentsImpl);
806 }; 832 };
807 833
808 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_ 834 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698