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

Unified Diff: chrome/browser/ui/color_chooser_dialog.h

Issue 9203001: Implement input type=color UI (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fixed issues/removed color_select_helper/added color_chooser_id Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/color_chooser_dialog.h
diff --git a/chrome/browser/ui/color_chooser_dialog.h b/chrome/browser/ui/color_chooser_dialog.h
new file mode 100644
index 0000000000000000000000000000000000000000..947562bd6adcadb84ef7090115b7b7869501fd13
--- /dev/null
+++ b/chrome/browser/ui/color_chooser_dialog.h
@@ -0,0 +1,40 @@
+// 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_COLOR_CHOOSER_DIALOG_H_
+#define CHROME_BROWSER_UI_COLOR_CHOOSER_DIALOG_H_
+#pragma once
+
+#include "base/memory/ref_counted.h"
+#include "chrome/browser/ui/base_shell_dialog.h"
+#include "third_party/skia/include/core/SkColor.h"
+
+// Shows a dialog for choosing color.
+class ColorChooserDialog
Peter Kasting 2012/02/07 01:46:24 ColorChooserDialogWin is the only implementer of t
keishi 2012/02/17 11:31:05 Done.
+ : public base::RefCountedThreadSafe<ColorChooserDialog>,
+ public BaseShellDialog {
+ 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;
+ };
+
+ // Creates a dialog box helper. This object is ref-counted, but the returned
+ // object will have no reference (refcount is 0).
+ static ColorChooserDialog* Create(Listener* listener);
Peter Kasting 2012/02/07 01:46:24 Nit: The combined class can just use a standard co
keishi 2012/02/17 11:31:05 Done.
+
+ // Opens the color chooser dialog.
+ virtual void SelectColor(SkColor initial_color,
+ gfx::NativeWindow owning_window) = 0;
Peter Kasting 2012/02/07 01:46:24 Nit: Why aren't these args to the constructor inst
keishi 2012/02/17 11:31:05 Done.
+
+ explicit ColorChooserDialog() { }
Peter Kasting 2012/02/07 01:46:24 Nit: Don't use "explicit" on no-arg constructor fo
keishi 2012/02/17 11:31:05 Done.
+
+ DISALLOW_COPY_AND_ASSIGN(ColorChooserDialog);
+};
+
+#endif // CHROME_BROWSER_UI_COLOR_CHOOSER_DIALOG_H_

Powered by Google App Engine
This is Rietveld 408576698