blob: c6f394abcc4eedda20d2216954e79f36f2d09971 [file] [log] [blame]
[email protected]8643e6d2012-01-18 20:26:101// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]0dd3a0ab2011-02-18 08:17:442// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]5f9de5882011-09-30 23:36:285#ifndef CHROME_BROWSER_UI_CONSTRAINED_WINDOW_H_
6#define CHROME_BROWSER_UI_CONSTRAINED_WINDOW_H_
[email protected]0dd3a0ab2011-02-18 08:17:447
8#include "build/build_config.h"
[email protected]c0c50a02012-08-17 04:30:419#include "third_party/skia/include/core/SkColor.h"
10#include "ui/base/resource/resource_bundle.h"
[email protected]c433f182011-11-04 21:22:2411#include "ui/gfx/native_widget_types.h"
[email protected]0dd3a0ab2011-02-18 08:17:4412
[email protected]0dd3a0ab2011-02-18 08:17:4413///////////////////////////////////////////////////////////////////////////////
14// ConstrainedWindow
15//
[email protected]5f9de5882011-09-30 23:36:2816// This interface represents a window that is constrained to a
[email protected]8643e6d2012-01-18 20:26:1017// WebContentsView's bounds.
[email protected]0dd3a0ab2011-02-18 08:17:4418//
19class ConstrainedWindow {
20 public:
[email protected]c0c50a02012-08-17 04:30:4121 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]2f934212012-09-02 21:49:3933 static SkColor GetBackgroundColor(); // Dialog background color.
34 static SkColor GetTextColor(); // Dialog text color.
[email protected]c0c50a02012-08-17 04:30:4135
[email protected]0dd3a0ab2011-02-18 08:17:4436 // 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]c433f182011-11-04 21:22:2444 virtual void FocusConstrainedWindow();
45
[email protected]85fd03e2012-09-04 22:50:1446 // Checks if the constrained window can be shown.
47 virtual bool CanShowConstrainedWindow();
48
[email protected]c433f182011-11-04 21:22:2449 // Returns the native window of the constrained window.
50 virtual gfx::NativeWindow GetNativeWindow();
[email protected]0dd3a0ab2011-02-18 08:17:4451
52 protected:
53 virtual ~ConstrainedWindow() {}
54};
55
[email protected]5f9de5882011-09-30 23:36:2856#endif // CHROME_BROWSER_UI_CONSTRAINED_WINDOW_H_