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

Side by Side Diff: content/public/browser/color_chooser.h

Issue 9203001: Implement input type=color UI (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebased Created 8 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
« no previous file with comments | « content/content_renderer.gypi ('k') | content/public/browser/web_contents.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 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 #ifndef CONTENT_PUBLIC_BROWSER_COLOR_CHOOSER_H_
6 #define CONTENT_PUBLIC_BROWSER_COLOR_CHOOSER_H_
7 #pragma once
8
9 #include "third_party/skia/include/core/SkColor.h"
10
11 namespace content {
12
13 class RenderViewHost;
14 class WebContents;
15
16 // Abstraction object for color choosers for each platform.
17 class ColorChooser {
18 public:
19 static ColorChooser* Create(int identifier,
20 WebContents* tab,
21 SkColor initial_color);
22 ColorChooser(int identifier) : identifier_(identifier) {}
23 virtual ~ColorChooser() {}
24
25 // Returns a unique identifier for this chooser. Identifiers are unique
26 // across a renderer process. This avoids race conditions in synchronizing
27 // the browser and renderer processes. For example, if a renderer closes one
28 // chooser and opens another, and simultaneously the user picks a color in the
29 // first chooser, the IDs can be used to drop the "chose a color" message
30 // rather than erroneously tell the renderer that the user picked a color in
31 // the second chooser.
32 int identifier() const { return identifier_; }
33
34 // Ends connection with color chooser. Closes color chooser depending on the
35 // platform.
36 virtual void End() = 0;
37
38 // Sets the selected color.
39 virtual void SetSelectedColor(SkColor color) = 0;
40
41 private:
42 int identifier_;
43 };
44
45 }
46
47 #endif // CONTENT_PUBLIC_BROWSER_COLOR_CHOOSER_H_
OLDNEW
« no previous file with comments | « content/content_renderer.gypi ('k') | content/public/browser/web_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698