| Index: chrome/browser/ui/views/external_tab_container_win.h
|
| diff --git a/chrome/browser/ui/views/external_tab_container_win.h b/chrome/browser/ui/views/external_tab_container_win.h
|
| index 3d06fecf3dc1af2e602c5d2d2d38e6a16002dbc5..30e42f16f83a72c2a89d518a6c20b3bc3fab57cb 100644
|
| --- a/chrome/browser/ui/views/external_tab_container_win.h
|
| +++ b/chrome/browser/ui/views/external_tab_container_win.h
|
| @@ -25,7 +25,6 @@
|
| #include "content/public/browser/web_contents_delegate.h"
|
| #include "content/public/browser/web_contents_observer.h"
|
| #include "ui/base/accelerators/accelerator.h"
|
| -#include "ui/views/widget/native_widget_win.h"
|
|
|
| class AutomationProvider;
|
| class Browser;
|
| @@ -39,9 +38,20 @@ class ViewProp;
|
| }
|
|
|
| namespace views {
|
| +class View;
|
| class WebView;
|
| +class Widget;
|
| }
|
|
|
| +// A delegate interface through which an ExternalTabContainerWin is notified
|
| +// when its native widget experiences a lifecycle event.
|
| +class WidgetLifecycleDelegate {
|
| + public:
|
| + virtual void OnNativeWidgetCreated() = 0;
|
| + virtual void OnNativeWidgetDestroying() = 0;
|
| + virtual void OnNativeWidgetDestroyed() = 0;
|
| +};
|
| +
|
| // This class serves as the container window for an external tab.
|
| // An external tab is a Chrome tab that is meant to displayed in an
|
| // external process. This class provides the FocusManger needed by the
|
| @@ -50,7 +60,7 @@ class ExternalTabContainerWin : public ExternalTabContainer,
|
| public content::WebContentsDelegate,
|
| public content::WebContentsObserver,
|
| public content::NotificationObserver,
|
| - public views::NativeWidgetWin,
|
| + public WidgetLifecycleDelegate,
|
| public ui::AcceleratorTarget,
|
| public InfoBarContainer::Delegate,
|
| public BlockedContentTabHelperDelegate {
|
| @@ -79,9 +89,10 @@ class ExternalTabContainerWin : public ExternalTabContainer,
|
| virtual void Uninitialize() OVERRIDE;
|
| virtual bool Reinitialize(AutomationProvider* automation_provider,
|
| AutomationResourceMessageFilter* filter,
|
| - gfx::NativeWindow parent_window) OVERRIDE;
|
| + HWND parent_window) OVERRIDE;
|
| virtual content::WebContents* GetWebContents() const OVERRIDE;
|
| - virtual gfx::NativeView GetExternalTabNativeView() const OVERRIDE;
|
| + virtual HWND GetExternalTabHWND() const OVERRIDE;
|
| + virtual HWND GetContentHWND() const OVERRIDE;
|
| virtual void SetTabHandle(int handle) OVERRIDE;
|
| virtual int GetTabHandle() const OVERRIDE;
|
| virtual bool ExecuteContextMenuCommand(int command) OVERRIDE;
|
| @@ -90,16 +101,6 @@ class ExternalTabContainerWin : public ExternalTabContainer,
|
| virtual void FocusThroughTabTraversal(bool reverse,
|
| bool restore_focus_to_view) OVERRIDE;
|
|
|
| - // A helper method that tests whether the given window is an
|
| - // ExternalTabContainerWin window.
|
| - static bool IsExternalTabContainer(HWND window);
|
| -
|
| - // A helper function that returns a pointer to the ExternalTabContainerWin
|
| - // instance associated with a native view. Returns NULL if the window
|
| - // is not an ExternalTabContainerWin.
|
| - static ExternalTabContainer* GetExternalContainerFromNativeWindow(
|
| - gfx::NativeView native_window);
|
| -
|
| // Overridden from content::WebContentsDelegate:
|
| virtual content::WebContents* OpenURLFromTab(
|
| content::WebContents* source,
|
| @@ -219,15 +220,10 @@ class ExternalTabContainerWin : public ExternalTabContainer,
|
| protected:
|
| virtual ~ExternalTabContainerWin();
|
|
|
| - // Overridden from views::NativeWidgetWin:
|
| - virtual bool PreHandleMSG(UINT message,
|
| - WPARAM w_param,
|
| - LPARAM l_param,
|
| - LRESULT* result) OVERRIDE;
|
| - virtual void PostHandleMSG(UINT message,
|
| - WPARAM w_param,
|
| - LPARAM l_param) OVERRIDE;
|
| - virtual void OnFinalMessage(HWND window);
|
| + // WidgetLifecycleDelegate overrides.
|
| + virtual void OnNativeWidgetCreated() OVERRIDE;
|
| + virtual void OnNativeWidgetDestroying() OVERRIDE;
|
| + virtual void OnNativeWidgetDestroyed() OVERRIDE;
|
|
|
| bool InitNavigationInfo(NavigationInfo* nav_info,
|
| content::NavigationType nav_type,
|
| @@ -257,6 +253,7 @@ class ExternalTabContainerWin : public ExternalTabContainer,
|
| // ExternalTabContainerWin.
|
| void SetupExternalTabView();
|
|
|
| + views::Widget* widget_;
|
| scoped_ptr<content::WebContents> web_contents_;
|
| scoped_refptr<AutomationProvider> automation_;
|
|
|
| @@ -284,6 +281,11 @@ class ExternalTabContainerWin : public ExternalTabContainer,
|
| // whether top level URL requests are to be handled by the automation client.
|
| bool handle_top_level_requests_;
|
|
|
| + // set to true if the host needs to get notified of all top level navigations
|
| + // in this page. This typically applies to hosts which would render the new
|
| + // page without chrome frame.
|
| + bool route_all_top_level_navigations_;
|
| +
|
| // Contains ExternalTabContainers that have not been connected to as yet.
|
| static base::LazyInstance<PendingTabs> pending_tabs_;
|
|
|
| @@ -322,11 +324,6 @@ class ExternalTabContainerWin : public ExternalTabContainer,
|
|
|
| IPC::Message* unload_reply_message_;
|
|
|
| - // set to true if the host needs to get notified of all top level navigations
|
| - // in this page. This typically applies to hosts which would render the new
|
| - // page without chrome frame.
|
| - bool route_all_top_level_navigations_;
|
| -
|
| scoped_ptr<ui::ViewProp> prop_;
|
|
|
| // if this tab is a popup
|
|
|