Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: ui/views/color_chooser/color_chooser_view.h

Issue 10442020: Initial implementation of ColorChooser for Aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 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 UI_VIEWS_COLOR_CHOOSER_COLOR_CHOOSER_VIEW_H_
6 #define UI_VIEWS_COLOR_CHOOSER_COLOR_CHOOSER_VIEW_H_
7 #pragma once
8
9 #include "third_party/skia/include/core/SkColor.h"
10 #include "third_party/skia/include/core/SkScalar.h"
11 #include "ui/views/controls/textfield/textfield_controller.h"
12 #include "ui/views/views_export.h"
13 #include "ui/views/widget/widget_delegate.h"
14
15 namespace views {
16
17 class ColorChooserListener;
18 class KeyEvent;
19 class Textfield;
20
21 // Pure views implementation of color chooser UI.
22 class VIEWS_EXPORT ColorChooserView : public views::WidgetDelegateView,
tfarina 2012/05/25 19:37:38 nit: remove views:: throughout in this file and in
Jun Mukai 2012/05/25 19:47:38 Done.
23 public views::TextfieldController {
24 public:
25 ColorChooserView(ColorChooserListener* listener, SkColor initial_color);
26 virtual ~ColorChooserView();
27
28 // Called when its owning window is closed.
29 void OnOwningWindowClosed();
30
31 // Called when its color value is changed in the web contents.
32 void OnColorChanged(SkColor color);
33
34 // Called when the user chooses a hue from the UI.
35 void OnHueChosen(float hue);
36
37 // Called when the user chooses saturation/value from the UI.
38 void OnSaturationValueChosen(float saturation, float value);
39
40 float hue() const { return hsv_[0]; }
41 float saturation() const { return hsv_[1]; }
42 float value() const { return hsv_[2]; }
43
44 private:
45 class HueView;
46 class SaturationValueView;
47
48 // views::WidgetDelegate overrides:
49 virtual ui::ModalType GetModalType() const OVERRIDE;
tfarina 2012/05/25 19:37:38 nit: please include compiler_specific.h for OVERRI
Jun Mukai 2012/05/25 19:47:38 Done.
50 virtual void WindowClosing() OVERRIDE;
51 virtual views::View* GetContentsView() OVERRIDE;
52
53 // views::TextfieldController overrides:
54 virtual void ContentsChanged(views::Textfield* sender,
55 const string16& new_contents) OVERRIDE;
56 virtual bool HandleKeyEvent(views::Textfield* sender,
57 const views::KeyEvent& key_event) OVERRIDE;
58
59 SkScalar hsv_[3];
60 ColorChooserListener* listener_;
61 HueView* hue_;
62 SaturationValueView* saturation_value_;
63 views::Textfield* textfield_;
64 };
tfarina 2012/05/25 19:37:38 DISALLOW_COPY_AND_ASSIGN and basictypes.h
Jun Mukai 2012/05/25 19:47:38 Done.
65
66 } // namespace views
67
68 #endif // UI_VIEWS_COLOR_CHOOSER_COLOR_CHOOSER_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698