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_CONSTRAINED_WINDOW_H_ | 5 #ifndef CHROME_BROWSER_UI_CONSTRAINED_WINDOW_H_ |
6 #define CHROME_BROWSER_UI_CONSTRAINED_WINDOW_H_ | 6 #define CHROME_BROWSER_UI_CONSTRAINED_WINDOW_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "third_party/skia/include/core/SkColor.h" | |
9 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
10 | 11 |
11 /////////////////////////////////////////////////////////////////////////////// | 12 /////////////////////////////////////////////////////////////////////////////// |
12 // ConstrainedWindow | 13 // ConstrainedWindow |
13 // | 14 // |
14 // This interface represents a window that is constrained to a | 15 // This interface represents a window that is constrained to a |
15 // WebContentsView's bounds. | 16 // WebContentsView's bounds. |
16 // | 17 // |
17 class ConstrainedWindow { | 18 class ConstrainedWindow { |
18 public: | 19 public: |
20 const int kFoo = 23; | |
19 // Makes the Constrained Window visible. Only one Constrained Window is shown | 21 // Makes the Constrained Window visible. Only one Constrained Window is shown |
20 // at a time per tab. | 22 // at a time per tab. |
21 virtual void ShowConstrainedWindow() = 0; | 23 virtual void ShowConstrainedWindow() = 0; |
22 | 24 |
23 // Closes the Constrained Window. | 25 // Closes the Constrained Window. |
24 virtual void CloseConstrainedWindow() = 0; | 26 virtual void CloseConstrainedWindow() = 0; |
25 | 27 |
26 // Sets focus on the Constrained Window. | 28 // Sets focus on the Constrained Window. |
27 virtual void FocusConstrainedWindow(); | 29 virtual void FocusConstrainedWindow(); |
28 | 30 |
29 // Returns the native window of the constrained window. | 31 // Returns the native window of the constrained window. |
30 virtual gfx::NativeWindow GetNativeWindow(); | 32 virtual gfx::NativeWindow GetNativeWindow(); |
31 | 33 |
32 protected: | 34 protected: |
33 virtual ~ConstrainedWindow() {} | 35 virtual ~ConstrainedWindow() {} |
34 }; | 36 }; |
35 | 37 |
38 namespace ConstrainedWindowStyle { | |
Ben Goodger (Google)
2012/08/03 23:09:07
we don't use namespaces like this. according to go
groby-ooo-7-16
2012/08/03 23:18:20
So make the constants part of the class, then? (Th
groby-ooo-7-16
2012/08/13 22:17:30
Done.
| |
39 | |
40 const int kVerticalPadding = 14; // top/bottom padding. | |
Ben Goodger (Google)
2012/08/03 23:09:07
I am also surprised to find all these constants in
groby-ooo-7-16
2012/08/03 23:18:20
According to the mocks, these are the same across
groby-ooo-7-16
2012/08/13 22:17:30
Done.
| |
41 const int kHorizontalPadding = 17; // left/right padding. | |
42 const int kRowPadding = 20; // Vertical margin between dialog rows. | |
43 const int kBorderRadius = 2; // Border radius for dialog corners. | |
44 | |
45 // Font sizes (in px) for title and dialog text. | |
46 #if defined(OS_CHROMEOS) || defined(OS_WIN) | |
47 const int kTitleFontSize = 16; | |
48 const int kTextFontSize = 13; | |
49 #else | |
50 const int kTitleFontSize = 15; | |
51 const int kTextFontSize = 13; | |
52 #endif | |
53 | |
54 extern const SkColor kBackgroundColor; // Dialog background color. | |
55 extern const SkColor kTextColor; // Dialog text color. | |
56 | |
57 extern const char kFont[]; | |
58 | |
59 } | |
60 | |
36 #endif // CHROME_BROWSER_UI_CONSTRAINED_WINDOW_H_ | 61 #endif // CHROME_BROWSER_UI_CONSTRAINED_WINDOW_H_ |
OLD | NEW |