| OLD | NEW |
| 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 CHROME_BROWSER_UI_PANELS_PANEL_HOST_H_ | 5 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_HOST_H_ |
| 6 #define CHROME_BROWSER_UI_PANELS_PANEL_HOST_H_ | 6 #define CHROME_BROWSER_UI_PANELS_PANEL_HOST_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 10 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
| 11 #include "content/public/browser/web_contents_delegate.h" | 11 #include "content/public/browser/web_contents_delegate.h" |
| 12 #include "content/public/browser/web_contents_observer.h" | 12 #include "content/public/browser/web_contents_observer.h" |
| 13 #include "content/public/common/page_zoom.h" | 13 #include "content/public/common/page_zoom.h" |
| 14 | 14 |
| 15 class ExtensionWindowController; | |
| 16 class FaviconTabHelper; | 15 class FaviconTabHelper; |
| 17 class GURL; | 16 class GURL; |
| 18 class Panel; | 17 class Panel; |
| 19 class Profile; | 18 class Profile; |
| 20 | 19 |
| 21 namespace content { | 20 namespace content { |
| 22 class WebContents; | 21 class WebContents; |
| 23 } | 22 } |
| 24 | 23 |
| 24 namespace extensions { |
| 25 class WindowController; |
| 26 } |
| 27 |
| 25 namespace gfx { | 28 namespace gfx { |
| 26 class Rect; | 29 class Rect; |
| 27 } | 30 } |
| 28 | 31 |
| 29 // Helper class for Panel, implementing WebContents hosting and Extension | 32 // Helper class for Panel, implementing WebContents hosting and Extension |
| 30 // delegates. Owned and used by Panel only. | 33 // delegates. Owned and used by Panel only. |
| 31 class PanelHost : public content::WebContentsDelegate, | 34 class PanelHost : public content::WebContentsDelegate, |
| 32 public content::WebContentsObserver, | 35 public content::WebContentsObserver, |
| 33 public ExtensionFunctionDispatcher::Delegate { | 36 public ExtensionFunctionDispatcher::Delegate { |
| 34 public: | 37 public: |
| (...skipping 27 matching lines...) Expand all Loading... |
| 62 virtual void ResizeDueToAutoResize(content::WebContents* web_contents, | 65 virtual void ResizeDueToAutoResize(content::WebContents* web_contents, |
| 63 const gfx::Size& new_size) OVERRIDE; | 66 const gfx::Size& new_size) OVERRIDE; |
| 64 | 67 |
| 65 // content::WebContentsObserver overrides. | 68 // content::WebContentsObserver overrides. |
| 66 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; | 69 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; |
| 67 virtual void WebContentsDestroyed( | 70 virtual void WebContentsDestroyed( |
| 68 content::WebContents* web_contents) OVERRIDE; | 71 content::WebContents* web_contents) OVERRIDE; |
| 69 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 72 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 70 | 73 |
| 71 // ExtensionFunctionDispatcher::Delegate overrides. | 74 // ExtensionFunctionDispatcher::Delegate overrides. |
| 72 virtual ExtensionWindowController* GetExtensionWindowController() const | 75 virtual extensions::WindowController* GetExtensionWindowController() const |
| 73 OVERRIDE; | 76 OVERRIDE; |
| 74 virtual content::WebContents* GetAssociatedWebContents() const OVERRIDE; | 77 virtual content::WebContents* GetAssociatedWebContents() const OVERRIDE; |
| 75 | 78 |
| 76 // Actions on web contents. | 79 // Actions on web contents. |
| 77 void Reload(); | 80 void Reload(); |
| 78 void ReloadIgnoringCache(); | 81 void ReloadIgnoringCache(); |
| 79 void StopLoading(); | 82 void StopLoading(); |
| 80 void Zoom(content::PageZoom zoom); | 83 void Zoom(content::PageZoom zoom); |
| 81 | 84 |
| 82 private: | 85 private: |
| (...skipping 10 matching lines...) Expand all Loading... |
| 93 // The following factory is used to close the panel via the message loop. | 96 // The following factory is used to close the panel via the message loop. |
| 94 base::WeakPtrFactory<PanelHost> weak_factory_; | 97 base::WeakPtrFactory<PanelHost> weak_factory_; |
| 95 | 98 |
| 96 scoped_ptr<FaviconTabHelper> favicon_tab_helper_; | 99 scoped_ptr<FaviconTabHelper> favicon_tab_helper_; |
| 97 scoped_ptr<content::WebContents> web_contents_; | 100 scoped_ptr<content::WebContents> web_contents_; |
| 98 | 101 |
| 99 DISALLOW_COPY_AND_ASSIGN(PanelHost); | 102 DISALLOW_COPY_AND_ASSIGN(PanelHost); |
| 100 }; | 103 }; |
| 101 | 104 |
| 102 #endif // CHROME_BROWSER_UI_PANELS_PANEL_HOST_H_ | 105 #endif // CHROME_BROWSER_UI_PANELS_PANEL_HOST_H_ |
| OLD | NEW |