| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2013 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 #include "chrome/browser/ui/color_chooser.h" |
| 6 |
| 7 #include "content/public/browser/web_contents.h" |
| 8 |
| 9 ColorChooser* ColorChooser::current_color_chooser_ = NULL; |
| 10 |
| 11 ColorChooser::ColorChooser(content::WebContents* web_contents) |
| 12 : web_contents_(web_contents) { |
| 13 DCHECK(!current_color_chooser_); |
| 14 current_color_chooser_ = this; |
| 15 } |
| 16 |
| 17 ColorChooser::~ColorChooser() { |
| 18 DCHECK(current_color_chooser_ != this); |
| 19 } |
| 20 |
| 21 void ColorChooser::DidChooseColor(SkColor color) { |
| 22 if (web_contents_) |
| 23 web_contents_->DidChooseColorInColorChooser(color); |
| 24 } |
| 25 |
| 26 void ColorChooser::DidEndColorChooser() { |
| 27 current_color_chooser_ = NULL; |
| 28 if (web_contents_) |
| 29 web_contents_->DidEndColorChooser(); |
| 30 } |
| OLD | NEW |