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

Side by Side Diff: chrome/browser/ui/color_chooser_controller.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: Created 7 years, 9 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 unified diff | Download patch
OLDNEW
(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_controller.h"
6
7 #include "chrome/browser/browser_process.h"
8 #include "content/public/browser/color_chooser.h"
9
10 using content::WebContents;
11
12 ColorChooserController::ColorChooserController() {
13 }
14
15 ColorChooserController::~ColorChooserController() {
16 }
17
18 // static
19 ColorChooserController* ColorChooserController::GetInstance() {
20 if (!g_browser_process)
21 return NULL;
22 return g_browser_process->color_chooser_controller();
23 }
24
25 content::ColorChooser* ColorChooserController::OpenColorChooser(
26 SkColor initial_color, WebContents* web_contents, int color_chooser_id) {
27 #if !defined(USE_AURA) && defined(OS_WIN)
28 // On Windows, only create a color chooser if one doesn't exist, because we
29 // can't close the old color chooser dialog.
30 if (color_chooser_.get())
Ben Goodger (Google) 2013/03/29 14:56:50 It seems a little unusual to consider this case a
31 return NULL;
32 #else
33 if (color_chooser_.get())
34 color_chooser_->End();
35 #endif
36 color_chooser_.reset(content::ColorChooser::Create(color_chooser_id,
37 web_contents,
38 initial_color));
39 return color_chooser_.get();
Ben Goodger (Google) 2013/03/29 14:56:50 It does seem like unnecessary indirection to have
40 }
41
42 void ColorChooserController::DidEndColorChooser() {
43 color_chooser_.reset();
44 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698