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_H_ | 5 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_H_ |
6 #define CHROME_BROWSER_UI_PANELS_PANEL_H_ | 6 #define CHROME_BROWSER_UI_PANELS_PANEL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/ui/browser_window.h" | 9 #include "chrome/browser/ui/browser_window.h" |
10 | 10 |
11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "chrome/browser/tabs/tab_strip_model_observer.h" | 13 #include "chrome/browser/tabs/tab_strip_model_observer.h" |
14 #include "content/public/browser/notification_observer.h" | 14 #include "content/public/browser/notification_observer.h" |
15 #include "content/public/browser/notification_registrar.h" | 15 #include "content/public/browser/notification_registrar.h" |
16 #include "ui/gfx/rect.h" | 16 #include "ui/gfx/rect.h" |
17 | 17 |
18 class NativePanel; | 18 class NativePanel; |
19 class PanelManager; | 19 class PanelManager; |
20 | 20 |
| 21 // Type of the panel strip which currently manages the panel location, |
| 22 // visual state and size. |
| 23 // TODO(jianli): When we have PanelStrip base class, move it into PanelStrip. |
| 24 enum PanelStripType { |
| 25 DOCKED_STRIP, |
| 26 OVERFLOW_STRIP |
| 27 }; |
| 28 |
21 // A platform independent implementation of BrowserWindow for Panels. This | 29 // A platform independent implementation of BrowserWindow for Panels. This |
22 // class would get the first crack at all the BrowserWindow calls for Panels and | 30 // class would get the first crack at all the BrowserWindow calls for Panels and |
23 // do one or more of the following: | 31 // do one or more of the following: |
24 // - Do nothing. The function is not relevant to Panels. | 32 // - Do nothing. The function is not relevant to Panels. |
25 // - Throw an exceptions. The function shouldn't be called for Panels. | 33 // - Throw an exceptions. The function shouldn't be called for Panels. |
26 // - Do Panel specific platform independent processing and then invoke the | 34 // - Do Panel specific platform independent processing and then invoke the |
27 // function on the platform specific BrowserWindow member. For example, | 35 // function on the platform specific BrowserWindow member. For example, |
28 // Panel size is restricted to certain limits. | 36 // Panel size is restricted to certain limits. |
29 // - Invoke an appropriate PanelManager function to do stuff that might affect | 37 // - Invoke an appropriate PanelManager function to do stuff that might affect |
30 // other Panels. For example deleting a panel would rearrange other panels. | 38 // other Panels. For example deleting a panel would rearrange other panels. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 // changes i.e it gets called when an app goes into full screen mode or when | 72 // changes i.e it gets called when an app goes into full screen mode or when |
65 // an app exits full screen mode. Panel should respond by making sure | 73 // an app exits full screen mode. Panel should respond by making sure |
66 // a) it does not go on top when some app enters full screen mode. | 74 // a) it does not go on top when some app enters full screen mode. |
67 // b) it remains on top when an app exits full screen mode. | 75 // b) it remains on top when an app exits full screen mode. |
68 void FullScreenModeChanged(bool is_full_screen); | 76 void FullScreenModeChanged(bool is_full_screen); |
69 | 77 |
70 // Ensures that the panel is fully visible, that is, not obscured by other | 78 // Ensures that the panel is fully visible, that is, not obscured by other |
71 // top-most windows. | 79 // top-most windows. |
72 void EnsureFullyVisible(); | 80 void EnsureFullyVisible(); |
73 | 81 |
| 82 // TODO(jianli): When we can use Panel::currentStrip()->type(), the |
| 83 // 'newPanelStrip' parameter can be removed. |
| 84 void ApplyVisualStyleForStrip(PanelStripType newPanelStrip); |
| 85 |
74 int TitleOnlyHeight() const; | 86 int TitleOnlyHeight() const; |
75 | 87 |
76 // Returns the size of the panel when it is iconified, as shown on the | 88 // Returns the size of the panel when it is iconified, as shown on the |
77 // overflow area. | 89 // overflow area. |
78 gfx::Size IconOnlySize() const; | 90 gfx::Size IconOnlySize() const; |
79 | 91 |
80 // BrowserWindow overrides. | 92 // BrowserWindow overrides. |
81 virtual void Show() OVERRIDE; | 93 virtual void Show() OVERRIDE; |
82 virtual void ShowInactive() OVERRIDE; | 94 virtual void ShowInactive() OVERRIDE; |
83 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; | 95 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 | 328 |
317 // Indicates whether the panel app icon is visible in the taskbar. | 329 // Indicates whether the panel app icon is visible in the taskbar. |
318 bool app_icon_visible_; | 330 bool app_icon_visible_; |
319 | 331 |
320 content::NotificationRegistrar registrar_; | 332 content::NotificationRegistrar registrar_; |
321 | 333 |
322 DISALLOW_COPY_AND_ASSIGN(Panel); | 334 DISALLOW_COPY_AND_ASSIGN(Panel); |
323 }; | 335 }; |
324 | 336 |
325 #endif // CHROME_BROWSER_UI_PANELS_PANEL_H_ | 337 #endif // CHROME_BROWSER_UI_PANELS_PANEL_H_ |
OLD | NEW |