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

Unified Diff: chrome/browser/ui/color_chooser.cc

Issue 13150004: Support color chooser inside extesions, apps, chrome frame, dev tool (Closed) Base URL: http://git.chromium.org/chromium/src.git@ngcolor
Patch Set: Open no longer returns NULL, protected ctor/dtor Created 7 years, 8 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.cc
diff --git a/chrome/browser/ui/color_chooser.cc b/chrome/browser/ui/color_chooser.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c50eb762584d1b9ea64098c2b11c60dc28aafdb6
--- /dev/null
+++ b/chrome/browser/ui/color_chooser.cc
@@ -0,0 +1,30 @@
+// Copyright 2013 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.
+
+#include "chrome/browser/ui/color_chooser.h"
+
+#include "content/public/browser/web_contents.h"
+
+ColorChooser* ColorChooser::current_color_chooser_ = NULL;
+
+ColorChooser::ColorChooser(content::WebContents* web_contents)
+ : web_contents_(web_contents) {
+ DCHECK(!current_color_chooser_);
+ current_color_chooser_ = this;
+}
+
+ColorChooser::~ColorChooser() {
+ DCHECK(current_color_chooser_ != this);
+}
+
+void ColorChooser::DidChooseColor(SkColor color) {
Ben Goodger (Google) 2013/04/17 15:34:15 ... but looking at how little this class does make
+ if (web_contents_)
+ web_contents_->DidChooseColorInColorChooser(color);
+}
+
+void ColorChooser::DidEndColorChooser() {
+ current_color_chooser_ = NULL;
+ if (web_contents_)
+ web_contents_->DidEndColorChooser();
+}

Powered by Google App Engine
This is Rietveld 408576698