Index: chrome/browser/ui/views/color_chooser_dialog.h |
diff --git a/chrome/browser/ui/views/color_chooser_dialog.h b/chrome/browser/ui/views/color_chooser_dialog.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2e8a5a30a8388a2d98e815deabd59a9d92b1f85d |
--- /dev/null |
+++ b/chrome/browser/ui/views/color_chooser_dialog.h |
@@ -0,0 +1,55 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_UI_VIEWS_COLOR_CHOOSER_DIALOG_H_ |
+#define CHROME_BROWSER_UI_VIEWS_COLOR_CHOOSER_DIALOG_H_ |
+#pragma once |
+ |
+#include "base/memory/ref_counted.h" |
+#include "chrome/browser/ui/base_shell_dialog.h" |
+#include "chrome/browser/ui/views/color_chooser_dialog.h" |
+#include "chrome/browser/ui/views/base_shell_dialog_win.h" |
+#include "third_party/skia/include/core/SkColor.h" |
+ |
+ |
+class ColorChooserDialog |
+ : public base::RefCountedThreadSafe<ColorChooserDialog>, |
+ public BaseShellDialog, |
+ public BaseShellDialogImpl { |
+ public: |
+ // An interface implemented by a Listener object wishing to know about the |
+ // the results from the color chooser dialog. |
+ class Listener { |
+ public: |
+ virtual ~Listener() {} |
+ virtual void DidChooseColor(SkColor color) = 0; |
+ virtual void DidEnd() = 0; |
+ }; |
+ |
+ explicit ColorChooserDialog(Listener* listener, |
Peter Kasting
2012/02/29 01:40:07
Nit: No explicit
keishi
2012/02/29 13:05:22
Done.
|
+ SkColor initial_color, |
+ gfx::NativeWindow owning_window); |
+ virtual ~ColorChooserDialog(); |
+ |
+ virtual bool IsRunning(HWND owning_hwnd) const OVERRIDE; |
Peter Kasting
2012/02/29 01:40:07
Nit: Add "// BaseShellDialog:" comment above these
keishi
2012/02/29 13:05:22
Done.
|
+ virtual void ListenerDestroyed() OVERRIDE; |
+ |
+ private: |
+ struct ExecuteOpenParams { |
+ ExecuteOpenParams(SkColor color, RunState run_state, HWND owner); |
+ SkColor color; |
+ RunState run_state; |
+ HWND owner; |
+ }; |
Peter Kasting
2012/02/29 01:40:07
Nit: DISALLOW_COPY_AND_ASSIGN()?
keishi
2012/02/29 13:05:22
Should I do DISALLOW_COPY_AND_ASSIGN(ExecuteOpenPa
Peter Kasting
2012/03/01 20:44:18
Hmm, I guess you need to be able to copy these. N
|
+ void ExecuteOpen(const ExecuteOpenParams& params); |
+ void DidChooseColor(SkColor color, RunState run_state); |
+ void DidDetach(RunState run_state); |
+ |
+ COLORREF custom_colors_[16]; |
+ Listener* listener_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ColorChooserDialog); |
+}; |
+ |
+#endif // CHROME_BROWSER_UI_VIEWS_COLOR_CHOOSER_DIALOG_H_ |