OLD | NEW |
(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_RENDERER_RENDERER_WEBCOLORCHOOSER_IMPL_H_ |
| 6 #define CONTENT_RENDERER_RENDERER_WEBCOLORCHOOSER_IMPL_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "content/public/renderer/render_view_observer.h" |
| 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebColorChooser.h" |
| 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebColorChooserClient
.h" |
| 13 #include "third_party/skia/include/core/SkColor.h" |
| 14 |
| 15 class RenderViewImpl; |
| 16 |
| 17 class RendererWebColorChooserImpl : public WebKit::WebColorChooser, |
| 18 public content::RenderViewObserver { |
| 19 public: |
| 20 explicit RendererWebColorChooserImpl(RenderViewImpl* sender, |
| 21 WebKit::WebColorChooserClient*); |
| 22 virtual ~RendererWebColorChooserImpl(); |
| 23 |
| 24 virtual void setSelectedColor(const WebKit::WebColor); |
| 25 virtual void endChooser(); |
| 26 |
| 27 void Open(SkColor initial_color); |
| 28 |
| 29 virtual WebKit::WebColorChooserClient* client(); |
| 30 |
| 31 private: |
| 32 // RenderView::Observer implementation. |
| 33 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 34 |
| 35 void OnDidChooseColorResponse(unsigned color_chooser_id, |
| 36 const SkColor& color); |
| 37 void OnDidEndColorChooser(unsigned color_chooser_id); |
| 38 |
| 39 unsigned identifier_; |
| 40 scoped_ptr<WebKit::WebColorChooserClient> client_; |
| 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(RendererWebColorChooserImpl); |
| 43 }; |
| 44 |
| 45 #endif // CONTENT_RENDERER_RENDERER_WEBCOLORCHOOSER_IMPL_H_ |
OLD | NEW |