OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 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_UI_COLOR_CHOOSER_H_ | |
6 #define CHROME_BROWSER_UI_COLOR_CHOOSER_H_ | |
7 #pragma once | |
8 | |
9 #include "base/memory/singleton.h" | |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebColor.h" | |
11 #include "ui/gfx/native_widget_types.h" | |
12 | |
13 // Abstraction object for color choosers of each platforms. | |
14 class ColorChooser { | |
15 public: | |
16 // An interface implemented by a Listener object wishing to know about the | |
17 // the results from the color chooser. | |
18 class Listener { | |
19 public: | |
20 virtual void DidChooseColor(WebKit::WebColor color) = 0; | |
21 virtual void DidEnd() = 0; | |
22 }; | |
23 | |
24 // Returns singleton instance of ColorChooser. | |
Peter Kasting
2012/01/17 20:53:10
This seems wrong -- why can't multiple tabs ask fo
keishi
2012/01/27 04:34:08
Multiple tabs could ask for color choosers but the
| |
25 static ColorChooser* GetInstance(); | |
26 | |
27 virtual void open(Listener* listener, WebKit::WebColor initial_color) = 0; | |
Peter Kasting
2012/01/17 20:53:10
Use Chrome-style function names, not WebKit-style.
keishi
2012/01/27 04:34:08
Done.
| |
28 virtual void end(Listener* listener) = 0; | |
29 virtual void setSelectedColor(WebKit::WebColor color) = 0; | |
30 | |
31 protected: | |
32 virtual ~ColorChooser() {} | |
33 }; | |
34 | |
35 #endif // CHROME_BROWSER_UI_COLOR_CHOOSER_H_ | |
OLD | NEW |