| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 11 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 11 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
| 12 #include "content/public/browser/web_contents_delegate.h" | 12 #include "content/public/browser/web_contents_delegate.h" |
| 13 #include "content/public/browser/web_contents_observer.h" | 13 #include "content/public/browser/web_contents_observer.h" |
| 14 #include "content/public/common/page_zoom.h" |
| 14 | 15 |
| 15 class ExtensionWindowController; | 16 class ExtensionWindowController; |
| 16 class FaviconTabHelper; | 17 class FaviconTabHelper; |
| 17 class GURL; | 18 class GURL; |
| 18 class Panel; | 19 class Panel; |
| 19 class Profile; | 20 class Profile; |
| 20 | 21 |
| 21 namespace content { | 22 namespace content { |
| 22 class WebContents; | 23 class WebContents; |
| 23 } | 24 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 46 virtual void NavigationStateChanged(const content::WebContents* source, | 47 virtual void NavigationStateChanged(const content::WebContents* source, |
| 47 unsigned changed_flags) OVERRIDE; | 48 unsigned changed_flags) OVERRIDE; |
| 48 virtual void ActivateContents(content::WebContents* contents) OVERRIDE; | 49 virtual void ActivateContents(content::WebContents* contents) OVERRIDE; |
| 49 virtual void DeactivateContents(content::WebContents* contents) OVERRIDE; | 50 virtual void DeactivateContents(content::WebContents* contents) OVERRIDE; |
| 50 virtual void LoadingStateChanged(content::WebContents* source) OVERRIDE; | 51 virtual void LoadingStateChanged(content::WebContents* source) OVERRIDE; |
| 51 virtual void CloseContents(content::WebContents* source) OVERRIDE; | 52 virtual void CloseContents(content::WebContents* source) OVERRIDE; |
| 52 virtual void MoveContents(content::WebContents* source, | 53 virtual void MoveContents(content::WebContents* source, |
| 53 const gfx::Rect& pos) OVERRIDE; | 54 const gfx::Rect& pos) OVERRIDE; |
| 54 virtual bool IsPopupOrPanel( | 55 virtual bool IsPopupOrPanel( |
| 55 const content::WebContents* source) const OVERRIDE; | 56 const content::WebContents* source) const OVERRIDE; |
| 57 virtual void ContentsZoomChange(bool zoom_in) OVERRIDE; |
| 56 virtual bool IsApplication() const OVERRIDE; | 58 virtual bool IsApplication() const OVERRIDE; |
| 59 virtual bool HandleContextMenu( |
| 60 const content::ContextMenuParams& params) OVERRIDE; |
| 61 virtual void HandleKeyboardEvent( |
| 62 const content::NativeWebKeyboardEvent& event) OVERRIDE; |
| 57 virtual void ResizeDueToAutoResize(content::WebContents* web_contents, | 63 virtual void ResizeDueToAutoResize(content::WebContents* web_contents, |
| 58 const gfx::Size& new_size) OVERRIDE; | 64 const gfx::Size& new_size) OVERRIDE; |
| 59 | 65 |
| 60 // content::WebContentsObserver overrides. | 66 // content::WebContentsObserver overrides. |
| 61 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; | 67 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; |
| 62 virtual void WebContentsDestroyed( | 68 virtual void WebContentsDestroyed( |
| 63 content::WebContents* web_contents) OVERRIDE; | 69 content::WebContents* web_contents) OVERRIDE; |
| 64 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 70 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 65 | 71 |
| 66 // ExtensionFunctionDispatcher::Delegate overrides. | 72 // ExtensionFunctionDispatcher::Delegate overrides. |
| 67 virtual ExtensionWindowController* GetExtensionWindowController() const | 73 virtual ExtensionWindowController* GetExtensionWindowController() const |
| 68 OVERRIDE; | 74 OVERRIDE; |
| 69 virtual content::WebContents* GetAssociatedWebContents() const OVERRIDE; | 75 virtual content::WebContents* GetAssociatedWebContents() const OVERRIDE; |
| 70 | 76 |
| 77 // Actions on web contents. |
| 78 void Reload(); |
| 79 void ReloadIgnoringCache(); |
| 80 void StopLoading(); |
| 81 void Zoom(content::PageZoom zoom); |
| 82 |
| 71 private: | 83 private: |
| 72 // Helper to close panel via the message loop. | 84 // Helper to close panel via the message loop. |
| 73 void ClosePanel(); | 85 void ClosePanel(); |
| 74 | 86 |
| 75 // Message handlers. | 87 // Message handlers. |
| 76 void OnRequest(const ExtensionHostMsg_Request_Params& params); | 88 void OnRequest(const ExtensionHostMsg_Request_Params& params); |
| 77 | 89 |
| 78 Panel* panel_; // Weak, owns us. | 90 Panel* panel_; // Weak, owns us. |
| 79 Profile* profile_; | 91 Profile* profile_; |
| 80 ExtensionFunctionDispatcher extension_function_dispatcher_; | 92 ExtensionFunctionDispatcher extension_function_dispatcher_; |
| 81 | 93 |
| 82 // The following factory is used to close the panel via the message loop. | 94 // The following factory is used to close the panel via the message loop. |
| 83 base::WeakPtrFactory<PanelHost> weak_factory_; | 95 base::WeakPtrFactory<PanelHost> weak_factory_; |
| 84 | 96 |
| 85 scoped_ptr<FaviconTabHelper> favicon_tab_helper_; | 97 scoped_ptr<FaviconTabHelper> favicon_tab_helper_; |
| 86 scoped_ptr<content::WebContents> web_contents_; | 98 scoped_ptr<content::WebContents> web_contents_; |
| 87 | 99 |
| 88 DISALLOW_COPY_AND_ASSIGN(PanelHost); | 100 DISALLOW_COPY_AND_ASSIGN(PanelHost); |
| 89 }; | 101 }; |
| 90 | 102 |
| 91 #endif // CHROME_BROWSER_UI_PANELS_PANEL_HOST_H_ | 103 #endif // CHROME_BROWSER_UI_PANELS_PANEL_HOST_H_ |
| OLD | NEW |