Refactor management of overview window copy lifetime into a separate class.
[chromium-blink-merge.git] / content / renderer / renderer_webcolorchooser_impl.h
blobbd8f235528a0be4c596f00b066a945066f983921
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.
5 #ifndef CONTENT_RENDERER_RENDERER_WEBCOLORCHOOSER_IMPL_H_
6 #define CONTENT_RENDERER_RENDERER_WEBCOLORCHOOSER_IMPL_H_
8 #include "base/compiler_specific.h"
9 #include "content/public/renderer/render_view_observer.h"
10 #include "third_party/WebKit/public/web/WebColorChooser.h"
11 #include "third_party/WebKit/public/web/WebColorChooserClient.h"
12 #include "third_party/skia/include/core/SkColor.h"
14 namespace WebKit {
15 class WebFrame;
18 namespace content {
19 class RenderViewImpl;
21 class RendererWebColorChooserImpl : public WebKit::WebColorChooser,
22 public RenderViewObserver {
23 public:
24 explicit RendererWebColorChooserImpl(RenderViewImpl* sender,
25 WebKit::WebColorChooserClient*);
26 virtual ~RendererWebColorChooserImpl();
28 virtual void setSelectedColor(const WebKit::WebColor);
29 virtual void endChooser();
31 void Open(SkColor initial_color);
33 WebKit::WebColorChooserClient* client() { return client_; }
35 private:
36 // RenderViewObserver implementation.
37 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
39 void OnDidChooseColorResponse(int color_chooser_id, SkColor color);
40 void OnDidEndColorChooser(int color_chooser_id);
42 int identifier_;
43 WebKit::WebColorChooserClient* client_;
45 DISALLOW_COPY_AND_ASSIGN(RendererWebColorChooserImpl);
48 } // namespace content
50 #endif // CONTENT_RENDERER_RENDERER_WEBCOLORCHOOSER_IMPL_H_