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 #ifndef CONTENT_RENDERER_RENDERER_WEBCOLORCHOOSER_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_RENDERER_WEBCOLORCHOOSER_IMPL_H_ |
6 #define CONTENT_RENDERER_RENDERER_WEBCOLORCHOOSER_IMPL_H_ | 6 #define CONTENT_RENDERER_RENDERER_WEBCOLORCHOOSER_IMPL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 virtual ~RendererWebColorChooserImpl(); | 29 virtual ~RendererWebColorChooserImpl(); |
30 | 30 |
31 virtual void setSelectedColor(const blink::WebColor); | 31 virtual void setSelectedColor(const blink::WebColor); |
32 virtual void endChooser(); | 32 virtual void endChooser(); |
33 | 33 |
34 void Open(SkColor initial_color, | 34 void Open(SkColor initial_color, |
35 const std::vector<content::ColorSuggestion>& suggestions); | 35 const std::vector<content::ColorSuggestion>& suggestions); |
36 | 36 |
37 blink::WebColorChooserClient* client() { return client_; } | 37 blink::WebColorChooserClient* client() { return client_; } |
38 | 38 |
| 39 // Don't destroy the RendererWebColorChooserImpl when the RenderViewImpl goes |
| 40 // away. RendererWebColorChooserImpl is owned by |
| 41 // blink::ColorChooserUIController. |
| 42 virtual void OnDestruct() OVERRIDE {} |
| 43 |
39 private: | 44 private: |
40 // RenderViewObserver implementation. | 45 // RenderViewObserver implementation. |
41 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 46 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
42 | 47 |
43 void OnDidChooseColorResponse(int color_chooser_id, SkColor color); | 48 void OnDidChooseColorResponse(int color_chooser_id, SkColor color); |
44 void OnDidEndColorChooser(int color_chooser_id); | 49 void OnDidEndColorChooser(int color_chooser_id); |
45 | 50 |
46 int identifier_; | 51 int identifier_; |
47 blink::WebColorChooserClient* client_; | 52 blink::WebColorChooserClient* client_; |
48 | 53 |
49 DISALLOW_COPY_AND_ASSIGN(RendererWebColorChooserImpl); | 54 DISALLOW_COPY_AND_ASSIGN(RendererWebColorChooserImpl); |
50 }; | 55 }; |
51 | 56 |
52 } // namespace content | 57 } // namespace content |
53 | 58 |
54 #endif // CONTENT_RENDERER_RENDERER_WEBCOLORCHOOSER_IMPL_H_ | 59 #endif // CONTENT_RENDERER_RENDERER_WEBCOLORCHOOSER_IMPL_H_ |
OLD | NEW |