1 // Copyright 2013 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.
5 #ifndef CHROME_BROWSER_UI_VIEWS_COLOR_CHOOSER_AURA_H_
6 #define CHROME_BROWSER_UI_VIEWS_COLOR_CHOOSER_AURA_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "content/public/browser/color_chooser.h"
11 #include "ui/views/color_chooser/color_chooser_listener.h"
18 class ColorChooserView;
22 // TODO(mukai): rename this as -Ash and move to c/b/ui/ash after Linux-aura
23 // switches to its native color chooser.
24 class ColorChooserAura : public content::ColorChooser,
25 public views::ColorChooserListener {
27 static ColorChooserAura* Open(content::WebContents* web_contents,
28 SkColor initial_color);
31 ColorChooserAura(content::WebContents* web_contents, SkColor initial_color);
33 // content::ColorChooser overrides:
34 virtual void End() OVERRIDE;
35 virtual void SetSelectedColor(SkColor color) OVERRIDE;
37 // views::ColorChooserListener overrides:
38 virtual void OnColorChosen(SkColor color) OVERRIDE;
39 virtual void OnColorChooserDialogClosed() OVERRIDE;
41 void DidEndColorChooser();
43 // The actual view of the color chooser. No ownership because its parent
44 // view will take care of its lifetime.
45 views::ColorChooserView* view_;
47 // The widget for the color chooser. No ownership because it's released
48 // automatically when closed.
49 views::Widget* widget_;
51 // The web contents invoking the color chooser. No ownership because it will
52 // outlive this class.
53 content::WebContents* web_contents_;
55 DISALLOW_COPY_AND_ASSIGN(ColorChooserAura);
58 #endif // CHROME_BROWSER_UI_VIEWS_COLOR_CHOOSER_AURA_H_