Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_H_ | |
| 6 #define CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "chrome/browser/ui/browser_window.h" | |
| 10 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" | |
| 11 | |
| 12 namespace extensions { | |
| 13 class Extension; | |
| 14 } | |
| 15 | |
| 16 class NativePanel; | |
| 17 class Panel; | |
| 18 | |
| 19 // A platform independent implementation of BrowserWindow for Panels. This | |
| 20 // class gets the first crack at all the BrowserWindow calls for Panels and | |
| 21 // do one or more of the following: | |
| 22 // - Do nothing. The function is not relevant to Panels. | |
| 23 // - Throw an exception. The function shouldn't be called for Panels. | |
| 24 // - Instruct Panel to do panel-specific platform independent processing | |
| 25 // and then invoke the function on the platform specific BrowserWindow member. | |
| 26 // - Invoke the function on the platform specific BrowserWindow member direclty. | |
| 27 class PanelBrowserWindow : public BrowserWindow, | |
|
Ben Goodger (Google)
2012/05/21 21:38:43
why do you need this?
jennb
2012/05/21 21:44:54
I haven't removed any logic that depends on Browse
| |
| 28 public TabStripModelObserver { | |
| 29 public: | |
| 30 PanelBrowserWindow(Browser* browser, Panel* panel, NativePanel* native_panel); | |
| 31 virtual ~PanelBrowserWindow(); | |
| 32 | |
| 33 // BaseWindow overrides. | |
| 34 virtual bool IsActive() const OVERRIDE; | |
| 35 virtual bool IsMaximized() const OVERRIDE; | |
| 36 virtual bool IsMinimized() const OVERRIDE; | |
| 37 virtual bool IsFullscreen() const OVERRIDE; | |
| 38 virtual gfx::Rect GetRestoredBounds() const OVERRIDE; | |
| 39 virtual gfx::Rect GetBounds() const OVERRIDE; | |
| 40 virtual void Show() OVERRIDE; | |
| 41 virtual void ShowInactive() OVERRIDE; | |
| 42 virtual void Close() OVERRIDE; | |
| 43 virtual void Activate() OVERRIDE; | |
| 44 virtual void Deactivate() OVERRIDE; | |
| 45 virtual void Maximize() OVERRIDE; | |
| 46 virtual void Minimize() OVERRIDE; | |
| 47 virtual void Restore() OVERRIDE; | |
| 48 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; | |
| 49 virtual void SetDraggableRegion(SkRegion* region) OVERRIDE; | |
| 50 virtual void FlashFrame(bool flash) OVERRIDE; | |
| 51 virtual bool IsAlwaysOnTop() const OVERRIDE; | |
| 52 | |
| 53 // BrowserWindow overrides. | |
| 54 virtual gfx::NativeWindow GetNativeHandle() OVERRIDE; | |
| 55 virtual BrowserWindowTesting* GetBrowserWindowTesting() OVERRIDE; | |
| 56 virtual StatusBubble* GetStatusBubble() OVERRIDE; | |
| 57 virtual void ToolbarSizeChanged(bool is_animating) OVERRIDE; | |
| 58 virtual void UpdateTitleBar() OVERRIDE; | |
| 59 virtual void BookmarkBarStateChanged( | |
| 60 BookmarkBar::AnimateChangeType change_type) OVERRIDE; | |
| 61 virtual void UpdateDevTools() OVERRIDE; | |
| 62 virtual void SetDevToolsDockSide(DevToolsDockSide side) OVERRIDE; | |
| 63 virtual void UpdateLoadingAnimations(bool should_animate) OVERRIDE; | |
| 64 virtual void SetStarredState(bool is_starred) OVERRIDE; | |
| 65 virtual void EnterFullscreen( | |
| 66 const GURL& url, FullscreenExitBubbleType type) OVERRIDE; | |
| 67 virtual void ExitFullscreen() OVERRIDE; | |
| 68 virtual void UpdateFullscreenExitBubbleContent( | |
| 69 const GURL& url, | |
| 70 FullscreenExitBubbleType bubble_type) OVERRIDE; | |
| 71 virtual bool IsFullscreenBubbleVisible() const OVERRIDE; | |
| 72 virtual LocationBar* GetLocationBar() const OVERRIDE; | |
| 73 virtual void SetFocusToLocationBar(bool select_all) OVERRIDE; | |
| 74 virtual void UpdateReloadStopState(bool is_loading, bool force) OVERRIDE; | |
| 75 virtual void UpdateToolbar(TabContentsWrapper* contents, | |
| 76 bool should_restore_state) OVERRIDE; | |
| 77 virtual void FocusToolbar() OVERRIDE; | |
| 78 virtual void FocusAppMenu() OVERRIDE; | |
| 79 virtual void FocusBookmarksToolbar() OVERRIDE; | |
| 80 virtual void RotatePaneFocus(bool forwards) OVERRIDE; | |
| 81 virtual bool IsBookmarkBarVisible() const OVERRIDE; | |
| 82 virtual bool IsBookmarkBarAnimating() const OVERRIDE; | |
| 83 virtual bool IsTabStripEditable() const OVERRIDE; | |
| 84 virtual bool IsToolbarVisible() const OVERRIDE; | |
| 85 virtual gfx::Rect GetRootWindowResizerRect() const OVERRIDE; | |
| 86 virtual bool IsPanel() const OVERRIDE; | |
| 87 virtual void DisableInactiveFrame() OVERRIDE; | |
| 88 virtual void ConfirmAddSearchProvider(TemplateURL* template_url, | |
| 89 Profile* profile) OVERRIDE; | |
| 90 virtual void ToggleBookmarkBar() OVERRIDE; | |
| 91 virtual void ShowAboutChromeDialog() OVERRIDE; | |
| 92 virtual void ShowUpdateChromeDialog() OVERRIDE; | |
| 93 virtual void ShowTaskManager() OVERRIDE; | |
| 94 virtual void ShowBackgroundPages() OVERRIDE; | |
| 95 virtual void ShowBookmarkBubble( | |
| 96 const GURL& url, bool already_bookmarked) OVERRIDE; | |
| 97 virtual void ShowChromeToMobileBubble() OVERRIDE; | |
| 98 #if defined(ENABLE_ONE_CLICK_SIGNIN) | |
| 99 virtual void ShowOneClickSigninBubble( | |
| 100 const base::Closure& learn_more_callback, | |
| 101 const base::Closure& advanced_callback) OVERRIDE; | |
| 102 #endif | |
| 103 virtual bool IsDownloadShelfVisible() const OVERRIDE; | |
| 104 virtual DownloadShelf* GetDownloadShelf() OVERRIDE; | |
| 105 virtual void ConfirmBrowserCloseWithPendingDownloads() OVERRIDE; | |
| 106 virtual void UserChangedTheme() OVERRIDE; | |
| 107 virtual int GetExtraRenderViewHeight() const OVERRIDE; | |
| 108 virtual void WebContentsFocused(content::WebContents* contents) OVERRIDE; | |
| 109 virtual void ShowPageInfo(Profile* profile, | |
| 110 const GURL& url, | |
| 111 const content::SSLStatus& ssl, | |
| 112 bool show_history) OVERRIDE; | |
| 113 virtual void ShowWebsiteSettings(Profile* profile, | |
| 114 TabContentsWrapper* tab_contents_wrapper, | |
| 115 const GURL& url, | |
| 116 const content::SSLStatus& ssl, | |
| 117 bool show_history) OVERRIDE; | |
| 118 virtual void ShowAppMenu() OVERRIDE; | |
| 119 virtual bool PreHandleKeyboardEvent( | |
| 120 const content::NativeWebKeyboardEvent& event, | |
| 121 bool* is_keyboard_shortcut) OVERRIDE; | |
| 122 virtual void HandleKeyboardEvent( | |
| 123 const content::NativeWebKeyboardEvent& event) OVERRIDE; | |
| 124 virtual void ShowCreateWebAppShortcutsDialog( | |
| 125 TabContentsWrapper* tab_contents) OVERRIDE; | |
| 126 virtual void ShowCreateChromeAppShortcutsDialog( | |
| 127 Profile* profile, const extensions::Extension* app) OVERRIDE; | |
| 128 virtual void Cut() OVERRIDE; | |
| 129 virtual void Copy() OVERRIDE; | |
| 130 virtual void Paste() OVERRIDE; | |
| 131 #if defined(OS_MACOSX) | |
| 132 virtual void OpenTabpose() OVERRIDE; | |
| 133 virtual void EnterPresentationMode( | |
| 134 const GURL& url, | |
| 135 FullscreenExitBubbleType bubble_type) OVERRIDE; | |
| 136 virtual void ExitPresentationMode() OVERRIDE; | |
| 137 virtual bool InPresentationMode() OVERRIDE; | |
| 138 #endif | |
| 139 virtual void ShowInstant(TabContentsWrapper* preview) OVERRIDE; | |
| 140 virtual void HideInstant() OVERRIDE; | |
| 141 virtual gfx::Rect GetInstantBounds() OVERRIDE; | |
| 142 virtual WindowOpenDisposition GetDispositionForPopupBounds( | |
| 143 const gfx::Rect& bounds) OVERRIDE; | |
| 144 virtual FindBar* CreateFindBar() OVERRIDE; | |
| 145 virtual void ResizeDueToAutoResize(content::WebContents* web_contents, | |
| 146 const gfx::Size& new_size) OVERRIDE; | |
| 147 virtual void ShowAvatarBubble(content::WebContents* web_contents, | |
| 148 const gfx::Rect& rect) OVERRIDE; | |
| 149 virtual void ShowAvatarBubbleFromAvatarButton() OVERRIDE; | |
| 150 | |
| 151 // TabStripModelObserver overrides. | |
| 152 virtual void TabInsertedAt(TabContentsWrapper* contents, | |
| 153 int index, | |
| 154 bool foreground) OVERRIDE; | |
| 155 | |
| 156 protected: | |
| 157 virtual void DestroyBrowser() OVERRIDE; | |
| 158 | |
| 159 private: | |
| 160 friend class BasePanelBrowserTest; | |
| 161 friend class PanelBrowserWindowCocoaTest; | |
| 162 Panel* panel() const { return panel_; } // only for tests | |
| 163 | |
| 164 Browser* browser_; // Weak, owned by native panel. | |
| 165 | |
| 166 Panel* panel_; // Weak pointer. Owns us. | |
| 167 | |
| 168 // Platform specifc implementation for panels. It'd be one of | |
| 169 // PanelBrowserWindowGtk/PanelBrowserView/PanelBrowserWindowCocoa. | |
| 170 NativePanel* native_panel_; // Weak, owns us (through ownership of Panel). | |
| 171 | |
| 172 DISALLOW_COPY_AND_ASSIGN(PanelBrowserWindow); | |
| 173 }; | |
| 174 | |
| 175 #endif // CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_H_ | |
| OLD | NEW |