| 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 "third_party/skia/include/core/SkColor.h" |
| 10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
| 11 #include "ui/gfx/insets.h" |
| 11 #include "ui/gfx/native_widget_types.h" | 12 #include "ui/gfx/native_widget_types.h" |
| 12 | 13 |
| 13 /////////////////////////////////////////////////////////////////////////////// | 14 /////////////////////////////////////////////////////////////////////////////// |
| 14 // ConstrainedWindow | 15 // ConstrainedWindow |
| 15 // | 16 // |
| 16 // This interface represents a window that is constrained to a | 17 // This interface represents a window that is constrained to a |
| 17 // WebContentsView's bounds. | 18 // WebContentsView's bounds. |
| 18 // | 19 // |
| 19 class ConstrainedWindow { | 20 class ConstrainedWindow { |
| 20 public: | 21 public: |
| 21 static int GetCloseButtonSize(); // Size of close button. | 22 static int GetCloseButtonSize(); // Size of close button. |
| 22 static SkColor GetBackgroundColor(); // Dialog background color. | 23 static SkColor GetBackgroundColor(); // Dialog background color. |
| 23 static SkColor GetTextColor(); // Dialog text color. | 24 static SkColor GetTextColor(); // Dialog text color. |
| 24 static SkColor GetLinkColor(); // Dialog link color. | 25 static SkColor GetLinkColor(); // Dialog link color. |
| 25 static SkColor GetSeparatorColor(); // Dialog separator color. | 26 static SkColor GetSeparatorColor(); // Dialog separator color. |
| 27 static gfx::Insets GetDefaultInsets(); // Default insets for the dialog. |
| 26 | 28 |
| 27 // Makes the Constrained Window visible. Only one Constrained Window is shown | 29 // Makes the Constrained Window visible. Only one Constrained Window is shown |
| 28 // at a time per tab. | 30 // at a time per tab. |
| 29 virtual void ShowConstrainedWindow() = 0; | 31 virtual void ShowConstrainedWindow() = 0; |
| 30 | 32 |
| 31 // Closes the Constrained Window. | 33 // Closes the Constrained Window. |
| 32 virtual void CloseConstrainedWindow() = 0; | 34 virtual void CloseConstrainedWindow() = 0; |
| 33 | 35 |
| 34 // Sets focus on the Constrained Window. | 36 // Sets focus on the Constrained Window. |
| 35 virtual void FocusConstrainedWindow(); | 37 virtual void FocusConstrainedWindow(); |
| 36 | 38 |
| 37 // Runs a pulse animation for the constrained window. | 39 // Runs a pulse animation for the constrained window. |
| 38 virtual void PulseConstrainedWindow(); | 40 virtual void PulseConstrainedWindow(); |
| 39 | 41 |
| 40 // Checks if the constrained window can be shown. | 42 // Checks if the constrained window can be shown. |
| 41 virtual bool CanShowConstrainedWindow(); | 43 virtual bool CanShowConstrainedWindow(); |
| 42 | 44 |
| 43 // Returns the native window of the constrained window. | 45 // Returns the native window of the constrained window. |
| 44 virtual gfx::NativeWindow GetNativeWindow(); | 46 virtual gfx::NativeWindow GetNativeWindow(); |
| 45 | 47 |
| 46 protected: | 48 protected: |
| 47 virtual ~ConstrainedWindow() {} | 49 virtual ~ConstrainedWindow() {} |
| 48 }; | 50 }; |
| 49 | 51 |
| 50 #endif // CHROME_BROWSER_UI_CONSTRAINED_WINDOW_H_ | 52 #endif // CHROME_BROWSER_UI_CONSTRAINED_WINDOW_H_ |
| OLD | NEW |