| 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: |
| 19 // Makes the Constrained Window visible. Only one Constrained Window is shown | 20 // Makes the Constrained Window visible. Only one Constrained Window is shown |
| 20 // at a time per tab. | 21 // at a time per tab. |
| 21 virtual void ShowConstrainedWindow() = 0; | 22 virtual void ShowConstrainedWindow() = 0; |
| 22 | 23 |
| 23 // Closes the Constrained Window. | 24 // Closes the Constrained Window. |
| 24 virtual void CloseConstrainedWindow() = 0; | 25 virtual void CloseConstrainedWindow() = 0; |
| 25 | 26 |
| 26 // Sets focus on the Constrained Window. | 27 // Sets focus on the Constrained Window. |
| 27 virtual void FocusConstrainedWindow(); | 28 virtual void FocusConstrainedWindow(); |
| 28 | 29 |
| 29 // Returns the native window of the constrained window. | 30 // Returns the native window of the constrained window. |
| 30 virtual gfx::NativeWindow GetNativeWindow(); | 31 virtual gfx::NativeWindow GetNativeWindow(); |
| 31 | 32 |
| 32 protected: | 33 protected: |
| 33 virtual ~ConstrainedWindow() {} | 34 virtual ~ConstrainedWindow() {} |
| 34 }; | 35 }; |
| 35 | 36 |
| 37 namespace ConstrainedWindowStyle { |
| 38 |
| 39 const int kVerticalPadding = 14; // top/bottom padding. |
| 40 const int kHorizontalPadding = 17; // left/right padding. |
| 41 const int kRowPadding = 20; // Vertical margin between dialog rows. |
| 42 const int kBorderRadius = 2; // Border radius for dialog corners. |
| 43 |
| 44 // Font sizes (in px) for title and dialog text. |
| 45 #if defined(OS_CHROMEOS) || defined(OS_WIN) |
| 46 const int kTitleFontSize = 16; |
| 47 const int kTextFontSize = 13; |
| 48 #else |
| 49 const int kTitleFontSize = 15; |
| 50 const int kTextFontSize = 13; |
| 51 #endif |
| 52 |
| 53 extern const SkColor kBackgroundColor; // Dialog background color. |
| 54 extern const SkColor kTextColor; // Dialog text color. |
| 55 |
| 56 extern const char kFont[]; |
| 57 |
| 58 } |
| 59 |
| 36 #endif // CHROME_BROWSER_UI_CONSTRAINED_WINDOW_H_ | 60 #endif // CHROME_BROWSER_UI_CONSTRAINED_WINDOW_H_ |
| OLD | NEW |