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

Side by Side Diff: public/web/WebColorSuggestion.h

Issue 23236002: Prepare for color input datalist support on Android (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed, added color suggestion struct Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 10 matching lines...) Expand all
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef WebMenuItemInfo_h 31 #ifndef WebColorSuggestion_h
32 #define WebMenuItemInfo_h 32 #define WebColorSuggestion_h
33 33
34 #include "../platform/WebCommon.h" 34 #include "../platform/WebColor.h"
35 #include "../platform/WebString.h" 35 #include "../platform/WebString.h"
36 #include "../platform/WebVector.h" 36
37 #include "WebTextDirection.h" 37 #if INSIDE_WEBKIT
38 #include "core/platform/ColorChooserClient.h"
tkent 2013/08/25 22:26:01 Should it be ColorSuggestion.h?
keishi 2013/08/26 05:29:15 Done.
39 #else
40 namespace WebCore {
41 class ColorSuggestion;
42 }
43 #endif
38 44
39 namespace WebKit { 45 namespace WebKit {
40 46
41 struct WebMenuItemInfo { 47 struct WebColorSuggestion {
42 enum Type { 48 WebColor colorValue;
43 Option, 49 WebString displayValue;
44 CheckableOption, 50 WebString label;
45 Group,
46 Separator,
47 SubMenu
48 };
49 51
50 WebMenuItemInfo() 52 #if INSIDE_WEBKIT
51 : type(Option) 53 BLINK_COMMON_EXPORT WebColorSuggestion(const WebCore::ColorSuggestion& sugge stion)
52 , action(0) 54 : colorValue(static_cast<WebColor>(suggestion.colorValue.rgb()))
53 , textDirection(WebTextDirectionDefault) 55 , displayValue(suggestion.displayValue)
54 , hasTextDirectionOverride(false) 56 , label(suggestion.label)
55 , enabled(false)
56 , checked(false)
57 { 57 {
58 } 58 }
59 59
60 WebString label; 60 BLINK_COMMON_EXPORT WebColorSuggestion& operator=(const WebCore::ColorSugges tion& suggestion)
61 WebString toolTip; 61 {
62 Type type; 62 colorValue = static_cast<WebColor>(suggestion.colorValue.rgb());
63 unsigned action; 63 displayValue = suggestion.displayValue;
64 WebTextDirection textDirection; 64 label = suggestion.label;
65 WebVector<WebMenuItemInfo> subMenuItems; 65 return *this;
66 bool hasTextDirectionOverride; 66 }
67 bool enabled; 67 #endif
68 bool checked;
69 }; 68 };
70 69
71 } // namespace WebKit 70 } // namespace WebKit
72 71
73 #endif 72 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698