[email protected] | 8643e6d | 2012-01-18 20:26:10 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | 5f9de588 | 2011-09-30 23:36:28 | [diff] [blame] | 5 | #ifndef CHROME_BROWSER_UI_CONSTRAINED_WINDOW_H_ |
6 | #define CHROME_BROWSER_UI_CONSTRAINED_WINDOW_H_ | ||||
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 7 | |
8 | #include "build/build_config.h" | ||||
[email protected] | c0c50a0 | 2012-08-17 04:30:41 | [diff] [blame] | 9 | #include "third_party/skia/include/core/SkColor.h" |
10 | #include "ui/base/resource/resource_bundle.h" | ||||
[email protected] | c433f18 | 2011-11-04 21:22:24 | [diff] [blame] | 11 | #include "ui/gfx/native_widget_types.h" |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 12 | |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 13 | /////////////////////////////////////////////////////////////////////////////// |
14 | // ConstrainedWindow | ||||
15 | // | ||||
[email protected] | 5f9de588 | 2011-09-30 23:36:28 | [diff] [blame] | 16 | // This interface represents a window that is constrained to a |
[email protected] | 8643e6d | 2012-01-18 20:26:10 | [diff] [blame] | 17 | // WebContentsView's bounds. |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 18 | // |
19 | class ConstrainedWindow { | ||||
20 | public: | ||||
[email protected] | c0c50a0 | 2012-08-17 04:30:41 | [diff] [blame] | 21 | static const int kVerticalPadding = 14; // top/bottom padding. |
22 | static const int kHorizontalPadding = 17; // left/right padding. | ||||
23 | static const int kRowPadding = 20; // Vertical margin between dialog rows. | ||||
24 | static const int kBorderRadius = 2; // Border radius for dialog corners. | ||||
25 | |||||
26 | // Font style for dialog text. | ||||
27 | static const ui::ResourceBundle::FontStyle kTextFontStyle = | ||||
28 | ui::ResourceBundle::BaseFont; | ||||
29 | // Font style for dialog title. | ||||
30 | static const ui::ResourceBundle::FontStyle kTitleFontStyle = | ||||
31 | ui::ResourceBundle::MediumFont; | ||||
32 | |||||
[email protected] | 2f93421 | 2012-09-02 21:49:39 | [diff] [blame] | 33 | static SkColor GetBackgroundColor(); // Dialog background color. |
34 | static SkColor GetTextColor(); // Dialog text color. | ||||
[email protected] | c0c50a0 | 2012-08-17 04:30:41 | [diff] [blame] | 35 | |
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 36 | // Makes the Constrained Window visible. Only one Constrained Window is shown |
37 | // at a time per tab. | ||||
38 | virtual void ShowConstrainedWindow() = 0; | ||||
39 | |||||
40 | // Closes the Constrained Window. | ||||
41 | virtual void CloseConstrainedWindow() = 0; | ||||
42 | |||||
43 | // Sets focus on the Constrained Window. | ||||
[email protected] | c433f18 | 2011-11-04 21:22:24 | [diff] [blame] | 44 | virtual void FocusConstrainedWindow(); |
45 | |||||
[email protected] | 85fd03e | 2012-09-04 22:50:14 | [diff] [blame] | 46 | // Checks if the constrained window can be shown. |
47 | virtual bool CanShowConstrainedWindow(); | ||||
48 | |||||
[email protected] | c433f18 | 2011-11-04 21:22:24 | [diff] [blame] | 49 | // Returns the native window of the constrained window. |
50 | virtual gfx::NativeWindow GetNativeWindow(); | ||||
[email protected] | 0dd3a0ab | 2011-02-18 08:17:44 | [diff] [blame] | 51 | |
52 | protected: | ||||
53 | virtual ~ConstrainedWindow() {} | ||||
54 | }; | ||||
55 | |||||
[email protected] | 5f9de588 | 2011-09-30 23:36:28 | [diff] [blame] | 56 | #endif // CHROME_BROWSER_UI_CONSTRAINED_WINDOW_H_ |