OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 #include "third_party/WebKit/public/platform/WebSocketStreamHandle.h" | 149 #include "third_party/WebKit/public/platform/WebSocketStreamHandle.h" |
150 #include "third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h" | 150 #include "third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h" |
151 #include "third_party/WebKit/public/platform/WebString.h" | 151 #include "third_party/WebKit/public/platform/WebString.h" |
152 #include "third_party/WebKit/public/platform/WebURL.h" | 152 #include "third_party/WebKit/public/platform/WebURL.h" |
153 #include "third_party/WebKit/public/platform/WebURLError.h" | 153 #include "third_party/WebKit/public/platform/WebURLError.h" |
154 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 154 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
155 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 155 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
156 #include "third_party/WebKit/public/platform/WebVector.h" | 156 #include "third_party/WebKit/public/platform/WebVector.h" |
157 #include "third_party/WebKit/public/web/WebAXObject.h" | 157 #include "third_party/WebKit/public/web/WebAXObject.h" |
158 #include "third_party/WebKit/public/web/WebColorName.h" | 158 #include "third_party/WebKit/public/web/WebColorName.h" |
| 159 #include "third_party/WebKit/public/web/WebColorSuggestion.h" |
159 #include "third_party/WebKit/public/web/WebDOMEvent.h" | 160 #include "third_party/WebKit/public/web/WebDOMEvent.h" |
160 #include "third_party/WebKit/public/web/WebDOMMessageEvent.h" | 161 #include "third_party/WebKit/public/web/WebDOMMessageEvent.h" |
161 #include "third_party/WebKit/public/web/WebDataSource.h" | 162 #include "third_party/WebKit/public/web/WebDataSource.h" |
162 #include "third_party/WebKit/public/web/WebDateTimeChooserCompletion.h" | 163 #include "third_party/WebKit/public/web/WebDateTimeChooserCompletion.h" |
163 #include "third_party/WebKit/public/web/WebDateTimeChooserParams.h" | 164 #include "third_party/WebKit/public/web/WebDateTimeChooserParams.h" |
164 #include "third_party/WebKit/public/web/WebDevToolsAgent.h" | 165 #include "third_party/WebKit/public/web/WebDevToolsAgent.h" |
165 #include "third_party/WebKit/public/web/WebDocument.h" | 166 #include "third_party/WebKit/public/web/WebDocument.h" |
166 #include "third_party/WebKit/public/web/WebElement.h" | 167 #include "third_party/WebKit/public/web/WebElement.h" |
167 #include "third_party/WebKit/public/web/WebFileChooserParams.h" | 168 #include "third_party/WebKit/public/web/WebFileChooserParams.h" |
168 #include "third_party/WebKit/public/web/WebFindOptions.h" | 169 #include "third_party/WebKit/public/web/WebFindOptions.h" |
(...skipping 2484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2653 GetFocusedNode())) | 2654 GetFocusedNode())) |
2654 break; | 2655 break; |
2655 did_execute_command = true; | 2656 did_execute_command = true; |
2656 } | 2657 } |
2657 | 2658 |
2658 return did_execute_command; | 2659 return did_execute_command; |
2659 } | 2660 } |
2660 | 2661 |
2661 blink::WebColorChooser* RenderViewImpl::createColorChooser( | 2662 blink::WebColorChooser* RenderViewImpl::createColorChooser( |
2662 blink::WebColorChooserClient* client, | 2663 blink::WebColorChooserClient* client, |
2663 const blink::WebColor& initial_color) { | 2664 const blink::WebColor& initial_color, |
| 2665 const blink::WebVector<blink::WebColorSuggestion>& suggestions) { |
2664 RendererWebColorChooserImpl* color_chooser = | 2666 RendererWebColorChooserImpl* color_chooser = |
2665 new RendererWebColorChooserImpl(this, client); | 2667 new RendererWebColorChooserImpl(this, client); |
2666 color_chooser->Open(static_cast<SkColor>(initial_color)); | 2668 std::vector<content::ColorSuggestion> color_suggestions; |
| 2669 for (size_t i = 0; i < suggestions.size(); i++) { |
| 2670 color_suggestions.push_back(content::ColorSuggestion(suggestions[i])); |
| 2671 } |
| 2672 color_chooser->Open(static_cast<SkColor>(initial_color), color_suggestions); |
2667 return color_chooser; | 2673 return color_chooser; |
2668 } | 2674 } |
2669 | 2675 |
2670 bool RenderViewImpl::runFileChooser( | 2676 bool RenderViewImpl::runFileChooser( |
2671 const blink::WebFileChooserParams& params, | 2677 const blink::WebFileChooserParams& params, |
2672 WebFileChooserCompletion* chooser_completion) { | 2678 WebFileChooserCompletion* chooser_completion) { |
2673 // Do not open the file dialog in a hidden RenderView. | 2679 // Do not open the file dialog in a hidden RenderView. |
2674 if (is_hidden()) | 2680 if (is_hidden()) |
2675 return false; | 2681 return false; |
2676 FileChooserParams ipc_params; | 2682 FileChooserParams ipc_params; |
(...skipping 4002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6679 for (size_t i = 0; i < icon_urls.size(); i++) { | 6685 for (size_t i = 0; i < icon_urls.size(); i++) { |
6680 WebURL url = icon_urls[i].iconURL(); | 6686 WebURL url = icon_urls[i].iconURL(); |
6681 if (!url.isEmpty()) | 6687 if (!url.isEmpty()) |
6682 urls.push_back(FaviconURL(url, | 6688 urls.push_back(FaviconURL(url, |
6683 ToFaviconType(icon_urls[i].iconType()))); | 6689 ToFaviconType(icon_urls[i].iconType()))); |
6684 } | 6690 } |
6685 SendUpdateFaviconURL(urls); | 6691 SendUpdateFaviconURL(urls); |
6686 } | 6692 } |
6687 | 6693 |
6688 } // namespace content | 6694 } // namespace content |
OLD | NEW |