OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_VIEWS_FRAME_BROWSER_EXTENDER_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_FRAME_BROWSER_EXTENDER_H_ |
6 #define CHROME_BROWSER_VIEWS_FRAME_BROWSER_EXTENDER_H_ | 6 #define CHROME_BROWSER_VIEWS_FRAME_BROWSER_EXTENDER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/gfx/rect.h" | 9 #include "base/gfx/rect.h" |
10 | 10 |
11 class BrowserView; | 11 class BrowserView; |
12 | 12 |
13 namespace views { | 13 namespace views { |
14 class Window; | 14 class Window; |
15 } // namespace views | 15 } // namespace views |
16 | 16 |
17 | 17 |
18 // BrowserExtender adds chromeos specific features to BrowserView. | 18 // BrowserExtender adds chromeos specific features to BrowserView. |
19 // The factory method |Create(BrowserView*)| creates different types | 19 // The factory method |Create(BrowserView*)| creates different types |
20 // of extender depending on the type of BrowserView and target platform. | 20 // of extender depending on the type of BrowserView and target platform. |
21 // Please see chromeos_browser_extender.cc for ChromeOS extenders, and | 21 // Please see chromeos_browser_extenders.cc for ChromeOS extenders, and |
22 // standard_extender.cc for Chrome browser. | 22 // standard_extender.cc for Chrome browser. |
23 class BrowserExtender { | 23 class BrowserExtender { |
24 public: | 24 public: |
25 // Factory method to create a BrowserExtender for given | 25 // Factory method to create a BrowserExtender for given |
26 // BrowserView object. Please see the class description for details. | 26 // BrowserView object. Please see the class description for details. |
27 static BrowserExtender* Create(BrowserView* browser_view); | 27 static BrowserExtender* Create(BrowserView* browser_view); |
28 | 28 |
29 virtual ~BrowserExtender() {} | 29 virtual ~BrowserExtender() {} |
30 | 30 |
31 // Initializes the extender. | 31 // Initializes the extender. |
32 virtual void Init() = 0; | 32 virtual void Init() = 0; |
33 | 33 |
34 // Layouts controls within the given bounds and returns the remaining | 34 // Layouts controls within the given bounds and returns the remaining |
35 // bounds for tabstip to be layed out. | 35 // bounds for tabstip to be layed out. |
36 virtual gfx::Rect Layout(const gfx::Rect& bounds) { return bounds; } | 36 virtual gfx::Rect Layout(const gfx::Rect& bounds) = 0; |
37 | 37 |
38 // Tests if the given |point|, which is given in BrowserView coordinates, | 38 // Tests if the given |point|, which is given in BrowserView coordinates, |
39 // hits any of controls. | 39 // hits any of controls. |
40 virtual bool NonClientHitTest(const gfx::Point& browser_view_point) = 0; | 40 virtual bool NonClientHitTest(const gfx::Point& browser_view_point) = 0; |
41 | 41 |
42 // Updates the title bar (if any). | 42 // Updates the title bar (if any). |
43 virtual void UpdateTitleBar() {} | 43 virtual void UpdateTitleBar() = 0; |
44 | 44 |
45 // Called when the BrowserView is shown. | 45 // Called when the BrowserView is shown. |
46 virtual void Show() = 0; | 46 virtual void Show() = 0; |
47 | 47 |
48 // Called when the BrowserView is closed. | 48 // Called when the BrowserView is closed. |
49 virtual void Close() {} | 49 virtual void Close() = 0; |
50 | 50 |
51 // Called when the browser window is either activated or deactivated. | 51 // Called when the browser window is either activated or deactivated. |
52 virtual void ActivationChanged() {} | 52 virtual void ActivationChanged() = 0; |
| 53 |
| 54 // Returns true to hide the toolbar for the window, or false |
| 55 // to use the regular logic to decide. |
| 56 virtual bool ShouldForceHideToolbar() = 0; |
| 57 |
| 58 // Toggles the visibility of CompactNavigationBar. |
| 59 virtual void ToggleCompactNavigationBar() = 0; |
53 | 60 |
54 // Tells if the browser can be closed. | 61 // Tells if the browser can be closed. |
55 bool can_close() const { | 62 bool can_close() const { |
56 return can_close_; | 63 return can_close_; |
57 } | 64 } |
58 | 65 |
59 // Specifies if the browser can be closed or not. This typically set | 66 // Specifies if the browser can be closed or not. This typically set |
60 // to false when the browser is being dragged. | 67 // to false when the browser is being dragged. |
61 void set_can_close(bool b) { | 68 void set_can_close(bool b) { |
62 can_close_ = b; | 69 can_close_ = b; |
(...skipping 13 matching lines...) Expand all Loading... |
76 // BrowserView to be extended. | 83 // BrowserView to be extended. |
77 BrowserView* browser_view_; | 84 BrowserView* browser_view_; |
78 | 85 |
79 // True if the browser can be closed. See set_can_close method for setails. | 86 // True if the browser can be closed. See set_can_close method for setails. |
80 bool can_close_; | 87 bool can_close_; |
81 | 88 |
82 DISALLOW_COPY_AND_ASSIGN(BrowserExtender); | 89 DISALLOW_COPY_AND_ASSIGN(BrowserExtender); |
83 }; | 90 }; |
84 | 91 |
85 #endif // CHROME_BROWSER_CHROMEOS_BROWSER_EXTENDER_H_ | 92 #endif // CHROME_BROWSER_CHROMEOS_BROWSER_EXTENDER_H_ |
86 | |
OLD | NEW |