Home | History | Annotate | Download | only in frame
      1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_CHROMEOS_FRAME_BUBBLE_WINDOW_H_
      6 #define CHROME_BROWSER_CHROMEOS_FRAME_BUBBLE_WINDOW_H_
      7 #pragma once
      8 
      9 #include "third_party/skia/include/core/SkColor.h"
     10 #include "views/window/window_gtk.h"
     11 
     12 namespace gfx {
     13 class Rect;
     14 }
     15 
     16 namespace views {
     17 class Throbber;
     18 class WindowDelegate;
     19 }
     20 
     21 namespace chromeos {
     22 
     23 // A window that uses BubbleFrameView as its frame.
     24 class BubbleWindow : public views::WindowGtk {
     25  public:
     26   enum Style {
     27     STYLE_GENERIC = 0, // Default style.
     28     STYLE_XBAR = 1 << 0, // Show close button at the top right (left for RTL).
     29     STYLE_THROBBER = 1 << 1, // Show throbber for slow rendering.
     30     STYLE_XSHAPE = 1 << 2 // Trim the window margins and round corners.
     31   };
     32 
     33   static views::Window* Create(gfx::NativeWindow parent,
     34                                const gfx::Rect& bounds,
     35                                Style style,
     36                                views::WindowDelegate* window_delegate);
     37 
     38   static const SkColor kBackgroundColor;
     39 
     40  protected:
     41   explicit BubbleWindow(views::WindowDelegate* window_delegate);
     42 
     43   // Overidden from views::WindowGtk:
     44   virtual void InitWindow(GtkWindow* parent, const gfx::Rect& bounds);
     45 
     46   // Trims the window margins and rounds off the corners.
     47   void TrimMargins(int margin_left, int margin_right, int margin_top,
     48                    int margin_bottom, int border_radius);
     49 };
     50 
     51 }  // namespace chromeos
     52 
     53 #endif  // CHROME_BROWSER_CHROMEOS_FRAME_BUBBLE_WINDOW_H_
     54