Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / ash / frame / default_header_painter.h
index e06c312..4c875c0 100644 (file)
@@ -8,9 +8,10 @@
 #include "ash/ash_export.h"
 #include "ash/frame/header_painter.h"
 #include "base/basictypes.h"
-#include "base/compiler_specific.h"  // OVERRIDE
+#include "base/compiler_specific.h"  // override
 #include "base/gtest_prod_util.h"
 #include "base/memory/scoped_ptr.h"
+#include "third_party/skia/include/core/SkColor.h"
 #include "ui/gfx/animation/animation_delegate.h"
 
 namespace gfx {
@@ -31,30 +32,34 @@ class ASH_EXPORT DefaultHeaderPainter : public HeaderPainter,
                                         public gfx::AnimationDelegate {
  public:
   DefaultHeaderPainter();
-  virtual ~DefaultHeaderPainter();
+  ~DefaultHeaderPainter() override;
 
   // DefaultHeaderPainter does not take ownership of any of the parameters.
   void Init(views::Widget* frame,
             views::View* header_view,
-            views::View* window_icon,
             FrameCaptionButtonContainerView* caption_button_container);
 
   // HeaderPainter overrides:
-  virtual int GetMinimumHeaderWidth() const OVERRIDE;
-  virtual void PaintHeader(gfx::Canvas* canvas, Mode mode) OVERRIDE;
-  virtual void LayoutHeader() OVERRIDE;
-  virtual int GetHeaderHeightForPainting() const OVERRIDE;
-  virtual void SetHeaderHeightForPainting(int height) OVERRIDE;
-  virtual void SchedulePaintForTitle() OVERRIDE;
+  int GetMinimumHeaderWidth() const override;
+  void PaintHeader(gfx::Canvas* canvas, Mode mode) override;
+  void LayoutHeader() override;
+  int GetHeaderHeightForPainting() const override;
+  void SetHeaderHeightForPainting(int height) override;
+  void SchedulePaintForTitle() override;
+  void UpdateLeftViewXInset(int left_view_x_inset) override;
 
-  // Sets the window icon for the header. Passing NULL removes the window icon.
-  void UpdateWindowIcon(views::View* window_icon, int icon_size);
+  // Sets the left header view for the header. Passing NULL removes the view.
+  void UpdateLeftHeaderView(views::View* left_header_view);
+
+  // Sets the active and inactive frame colors. Note the inactive frame color
+  // will have some transparency added when the frame is drawn.
+  void SetFrameColors(SkColor active_frame_color, SkColor inactive_frame_color);
 
  private:
   FRIEND_TEST_ALL_PREFIXES(DefaultHeaderPainterTest, TitleIconAlignment);
 
   // gfx::AnimationDelegate override:
-  virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE;
+  void AnimationProgressed(const gfx::Animation* animation) override;
 
   // Paints highlight around the edge of the header for inactive restored
   // windows.
@@ -66,6 +71,12 @@ class ASH_EXPORT DefaultHeaderPainter : public HeaderPainter,
   // Paints the header/content separator.
   void PaintHeaderContentSeparator(gfx::Canvas* canvas);
 
+  // Layout the left header view.
+  void LayoutLeftHeaderView();
+
+  // Updates the size button's images.
+  void UpdateSizeButtonImages();
+
   // Returns the header bounds in the coordinates of |view_|. The header is
   // assumed to be positioned at the top left corner of |view_| and to have the
   // same width as |view_|.
@@ -74,16 +85,15 @@ class ASH_EXPORT DefaultHeaderPainter : public HeaderPainter,
   // Returns the bounds for the title.
   gfx::Rect GetTitleBounds() const;
 
-  // Returns the frame image to use when |frame_| is active.
-  gfx::ImageSkia* GetActiveFrameImage() const;
-
-  // Returns the frame image to use when |frame_| is inactive.
-  gfx::ImageSkia* GetInactiveFrameImage() const;
+  // Returns the frame color to use when |frame_| is inactive.
+  SkColor GetInactiveFrameColor() const;
 
   views::Widget* frame_;
   views::View* view_;
-  views::View* window_icon_;  // May be NULL.
-  int window_icon_size_;
+  views::View* left_header_view_;  // May be NULL.
+  int left_view_x_inset_;
+  SkColor active_frame_color_;
+  SkColor inactive_frame_color_;
   FrameCaptionButtonContainerView* caption_button_container_;
 
   // The height of the header including the header/content separator.