Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / apps / ui / views / app_window_frame_view.h
index 1781476..f29046f 100644 (file)
@@ -40,22 +40,29 @@ class AppWindowFrameView : public views::NonClientFrameView,
  public:
   static const char kViewClassName[];
 
-  explicit AppWindowFrameView();
+  // AppWindowFrameView is used to draw frames for app windows when a non
+  // standard frame is needed. This occurs if there is no frame needed, or if
+  // there is a frame color.
+  // If |draw_frame| is true, the view draws its own window title area and
+  // controls, using |frame_color|. If |draw_frame| is not true, no frame is
+  // drawn.
+  // TODO(benwells): Refactor this to split out frameless and colored frame
+  // views. See http://crbug.com/359432.
+  AppWindowFrameView(views::Widget* widget,
+                     NativeAppWindow* window,
+                     bool draw_frame,
+                     const SkColor& active_frame_color,
+                     const SkColor& inactive_frame_color);
   virtual ~AppWindowFrameView();
 
-  // Initializes this for |widget|. Sets the number of pixels for which a click
-  // is interpreted as a resize for the inner and outer border of the window
-  // and the lower-right corner resize handle. If |draw_frame|, the view draws
-  // its own window title area and controls, using |frame_color| (otherwise
-  // |frame_color| is ignored).
-  void Init(views::Widget* widget,
-            NativeAppWindow* window,
-            bool draw_frame,
-            const SkColor& frame_color,
-            int resize_inside_bounds_size,
-            int resize_outside_bounds_size,
-            int resize_outside_scale_for_touch,
-            int resize_area_corner_size);
+  void Init();
+
+  void SetResizeSizes(int resize_inside_bounds_size,
+                      int resize_outside_bounds_size,
+                      int resize_area_corner_size);
+  int resize_inside_bounds_size() const {
+    return resize_inside_bounds_size_;
+  };
 
  private:
   // views::NonClientFrameView implementation.
@@ -81,10 +88,18 @@ class AppWindowFrameView : public views::NonClientFrameView,
   virtual void ButtonPressed(views::Button* sender,
                              const ui::Event& event) OVERRIDE;
 
+  // Some button images we use depend on the color of the frame. This
+  // will set these images based on the color of the frame.
+  void SetButtonImagesForFrame();
+
+  // Return the current frame color based on the active state of the window.
+  SkColor CurrentFrameColor();
+
   views::Widget* widget_;
   NativeAppWindow* window_;
   bool draw_frame_;
-  SkColor frame_color_;
+  SkColor active_frame_color_;
+  SkColor inactive_frame_color_;
   views::ImageButton* close_button_;
   views::ImageButton* maximize_button_;
   views::ImageButton* restore_button_;