OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BROWSER_WINDOW_COCOA_H_ | 5 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_COCOA_H_ |
6 #define CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_COCOA_H_ | 6 #define CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_COCOA_H_ |
7 | 7 |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 public: | 25 public: |
26 PanelBrowserWindowCocoa(Browser* browser, Panel* panel, | 26 PanelBrowserWindowCocoa(Browser* browser, Panel* panel, |
27 const gfx::Rect& bounds); | 27 const gfx::Rect& bounds); |
28 virtual ~PanelBrowserWindowCocoa(); | 28 virtual ~PanelBrowserWindowCocoa(); |
29 | 29 |
30 // Overridden from NativePanel | 30 // Overridden from NativePanel |
31 virtual void ShowPanel() OVERRIDE; | 31 virtual void ShowPanel() OVERRIDE; |
32 virtual void ShowPanelInactive() OVERRIDE; | 32 virtual void ShowPanelInactive() OVERRIDE; |
33 virtual gfx::Rect GetPanelBounds() const OVERRIDE; | 33 virtual gfx::Rect GetPanelBounds() const OVERRIDE; |
34 virtual void SetPanelBounds(const gfx::Rect& bounds) OVERRIDE; | 34 virtual void SetPanelBounds(const gfx::Rect& bounds) OVERRIDE; |
| 35 virtual void SetPanelBoundsInstantly(const gfx::Rect& bounds) OVERRIDE; |
35 virtual void ClosePanel() OVERRIDE; | 36 virtual void ClosePanel() OVERRIDE; |
36 virtual void ActivatePanel() OVERRIDE; | 37 virtual void ActivatePanel() OVERRIDE; |
37 virtual void DeactivatePanel() OVERRIDE; | 38 virtual void DeactivatePanel() OVERRIDE; |
38 virtual bool IsPanelActive() const OVERRIDE; | 39 virtual bool IsPanelActive() const OVERRIDE; |
39 virtual gfx::NativeWindow GetNativePanelHandle() OVERRIDE; | 40 virtual gfx::NativeWindow GetNativePanelHandle() OVERRIDE; |
40 virtual void UpdatePanelTitleBar() OVERRIDE; | 41 virtual void UpdatePanelTitleBar() OVERRIDE; |
41 virtual void UpdatePanelLoadingAnimations(bool should_animate) OVERRIDE; | 42 virtual void UpdatePanelLoadingAnimations(bool should_animate) OVERRIDE; |
42 virtual void ShowTaskManagerForPanel() OVERRIDE; | 43 virtual void ShowTaskManagerForPanel() OVERRIDE; |
43 virtual FindBar* CreatePanelFindBar() OVERRIDE; | 44 virtual FindBar* CreatePanelFindBar() OVERRIDE; |
44 virtual void NotifyPanelOnUserChangedTheme() OVERRIDE; | 45 virtual void NotifyPanelOnUserChangedTheme() OVERRIDE; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 FRIEND_TEST_ALL_PREFIXES(PanelBrowserWindowCocoaTest, TitlebarViewSizing); | 89 FRIEND_TEST_ALL_PREFIXES(PanelBrowserWindowCocoaTest, TitlebarViewSizing); |
89 FRIEND_TEST_ALL_PREFIXES(PanelBrowserWindowCocoaTest, TitlebarViewClose); | 90 FRIEND_TEST_ALL_PREFIXES(PanelBrowserWindowCocoaTest, TitlebarViewClose); |
90 FRIEND_TEST_ALL_PREFIXES(PanelBrowserWindowCocoaTest, MenuItems); | 91 FRIEND_TEST_ALL_PREFIXES(PanelBrowserWindowCocoaTest, MenuItems); |
91 FRIEND_TEST_ALL_PREFIXES(PanelBrowserWindowCocoaTest, KeyEvent); | 92 FRIEND_TEST_ALL_PREFIXES(PanelBrowserWindowCocoaTest, KeyEvent); |
92 FRIEND_TEST_ALL_PREFIXES(PanelBrowserWindowCocoaTest, ThemeProvider); | 93 FRIEND_TEST_ALL_PREFIXES(PanelBrowserWindowCocoaTest, ThemeProvider); |
93 FRIEND_TEST_ALL_PREFIXES(PanelBrowserWindowCocoaTest, SetTitle); | 94 FRIEND_TEST_ALL_PREFIXES(PanelBrowserWindowCocoaTest, SetTitle); |
94 FRIEND_TEST_ALL_PREFIXES(PanelBrowserWindowCocoaTest, ActivatePanel); | 95 FRIEND_TEST_ALL_PREFIXES(PanelBrowserWindowCocoaTest, ActivatePanel); |
95 | 96 |
96 bool isClosed(); | 97 bool isClosed(); |
97 | 98 |
| 99 void setBoundsInternal(const gfx::Rect& bounds, bool animate); |
| 100 |
98 scoped_ptr<Browser> browser_; | 101 scoped_ptr<Browser> browser_; |
99 scoped_ptr<Panel> panel_; | 102 scoped_ptr<Panel> panel_; |
100 | 103 |
101 // These use platform-independent screen coordinates, with (0,0) at | 104 // These use platform-independent screen coordinates, with (0,0) at |
102 // top-left of the primary screen. They have to be converted to Cocoa | 105 // top-left of the primary screen. They have to be converted to Cocoa |
103 // screen coordinates before calling Cocoa API. | 106 // screen coordinates before calling Cocoa API. |
104 gfx::Rect bounds_; | 107 gfx::Rect bounds_; |
105 | 108 |
106 PanelWindowControllerCocoa* controller_; // Weak, owns us. | 109 PanelWindowControllerCocoa* controller_; // Weak, owns us. |
107 bool is_shown_; // Panel is hidden on creation, Show() changes that forever. | 110 bool is_shown_; // Panel is hidden on creation, Show() changes that forever. |
108 bool has_find_bar_; // Find bar should only be created once per panel. | 111 bool has_find_bar_; // Find bar should only be created once per panel. |
109 | 112 |
110 DISALLOW_COPY_AND_ASSIGN(PanelBrowserWindowCocoa); | 113 DISALLOW_COPY_AND_ASSIGN(PanelBrowserWindowCocoa); |
111 }; | 114 }; |
112 | 115 |
113 #endif // CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_COCOA_H_ | 116 #endif // CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_COCOA_H_ |
OLD | NEW |