Chromium Code Reviews| Index: content/renderer/renderer_webcolorchooser_impl.h |
| diff --git a/content/renderer/renderer_webcolorchooser_impl.h b/content/renderer/renderer_webcolorchooser_impl.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b507944b8d7aaadec7ce916e3815dc7bf8ac6762 |
| --- /dev/null |
| +++ b/content/renderer/renderer_webcolorchooser_impl.h |
| @@ -0,0 +1,50 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_RENDERER_RENDERER_WEBCOLORCHOOSER_IMPL_H_ |
| +#define CONTENT_RENDERER_RENDERER_WEBCOLORCHOOSER_IMPL_H_ |
| +#pragma once |
| + |
| +#include "base/memory/scoped_ptr.h" |
| +#include "content/public/renderer/render_view_observer.h" |
| +#include "third_party/WebKit/Source/WebKit/chromium/public/WebColorChooser.h" |
| +#include "third_party/WebKit/Source/WebKit/chromium/public/WebColorChooserClient.h" |
| +#include "third_party/skia/include/core/SkColor.h" |
| + |
| +namespace WebKit { |
| +class WebFrame; |
| +} |
| + |
| +class RenderViewImpl; |
| + |
| +class RendererWebColorChooserImpl : public WebKit::WebColorChooser, |
| + public content::RenderViewObserver { |
| + public: |
| + explicit RendererWebColorChooserImpl(RenderViewImpl* sender, |
| + WebKit::WebColorChooserClient*); |
| + virtual ~RendererWebColorChooserImpl(); |
| + |
| + virtual void setSelectedColor(const WebKit::WebColor); |
| + virtual void endChooser(); |
| + |
| + void Open(SkColor initial_color); |
| + |
| + virtual WebKit::WebColorChooserClient* client(); |
|
jam
2012/02/22 02:55:20
why is this virtual?
also, per C++ style guide on
keishi
2012/02/24 14:38:54
Removed virtual. Turned it into inline getter.
|
| + |
| + private: |
| + // RenderViewObserver implementation. |
| + virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| + virtual void FrameWillClose(WebKit::WebFrame* frame) OVERRIDE; |
| + |
| + void OnDidChooseColorResponse(int color_chooser_id, |
| + const SkColor& color); |
| + void OnDidEndColorChooser(int color_chooser_id); |
| + |
| + int identifier_; |
| + scoped_ptr<WebKit::WebColorChooserClient> client_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(RendererWebColorChooserImpl); |
| +}; |
| + |
| +#endif // CONTENT_RENDERER_RENDERER_WEBCOLORCHOOSER_IMPL_H_ |