| 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/renderer_webcolorchooser_impl.h" | 5 #include "content/renderer/renderer_webcolorchooser_impl.h" |
| 6 | 6 |
| 7 #include "content/common/view_messages.h" | 7 #include "content/common/view_messages.h" |
| 8 #include "content/renderer/render_view_impl.h" | 8 #include "content/renderer/render_view_impl.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 void RendererWebColorChooserImpl::setSelectedColor(WebKit::WebColor color) { | 41 void RendererWebColorChooserImpl::setSelectedColor(WebKit::WebColor color) { |
| 42 Send(new ViewHostMsg_SetSelectedColorInColorChooser(routing_id(), identifier_, | 42 Send(new ViewHostMsg_SetSelectedColorInColorChooser(routing_id(), identifier_, |
| 43 static_cast<SkColor>(color))); | 43 static_cast<SkColor>(color))); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void RendererWebColorChooserImpl::endChooser() { | 46 void RendererWebColorChooserImpl::endChooser() { |
| 47 Send(new ViewHostMsg_EndColorChooser(routing_id(), identifier_)); | 47 Send(new ViewHostMsg_EndColorChooser(routing_id(), identifier_)); |
| 48 } | 48 } |
| 49 | 49 |
| 50 void RendererWebColorChooserImpl::Open(SkColor initial_color) { | 50 void RendererWebColorChooserImpl::Open( |
| 51 Send(new ViewHostMsg_OpenColorChooser(routing_id(), identifier_, | 51 SkColor initial_color, |
| 52 initial_color)); | 52 const std::vector<SkColor>& suggestions, |
| 53 const std::vector<string16>& suggestion_labels) { |
| 54 Send(new ViewHostMsg_OpenColorChooser(routing_id(), |
| 55 identifier_, |
| 56 initial_color, |
| 57 suggestions, |
| 58 suggestion_labels)); |
| 53 } | 59 } |
| 54 | 60 |
| 55 void RendererWebColorChooserImpl::OnDidChooseColorResponse(int color_chooser_id, | 61 void RendererWebColorChooserImpl::OnDidChooseColorResponse(int color_chooser_id, |
| 56 SkColor color) { | 62 SkColor color) { |
| 57 DCHECK(identifier_ == color_chooser_id); | 63 DCHECK(identifier_ == color_chooser_id); |
| 58 | 64 |
| 59 client_->didChooseColor(static_cast<WebKit::WebColor>(color)); | 65 client_->didChooseColor(static_cast<WebKit::WebColor>(color)); |
| 60 } | 66 } |
| 61 | 67 |
| 62 void RendererWebColorChooserImpl::OnDidEndColorChooser(int color_chooser_id) { | 68 void RendererWebColorChooserImpl::OnDidEndColorChooser(int color_chooser_id) { |
| 63 if (identifier_ != color_chooser_id) | 69 if (identifier_ != color_chooser_id) |
| 64 return; | 70 return; |
| 65 client_->didEndChooser(); | 71 client_->didEndChooser(); |
| 66 } | 72 } |
| 67 | 73 |
| 68 } // namespace content | 74 } // namespace content |
| OLD | NEW |