OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_PUBLIC_BROWSER_WEB_UI_MESSAGE_HANDLER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_UI_MESSAGE_HANDLER_H_ |
6 #define CONTENT_PUBLIC_BROWSER_WEB_UI_MESSAGE_HANDLER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_UI_MESSAGE_HANDLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 12 #include "testing/gtest/include/gtest/gtest_prod.h" |
12 | 13 |
13 class GURL; | 14 class GURL; |
14 class WebUI; | 15 class WebUIImpl; |
15 class WebUIBrowserTest; | 16 class WebUIBrowserTest; |
16 | 17 |
17 namespace base { | 18 namespace base { |
18 class DictionaryValue; | 19 class DictionaryValue; |
19 class ListValue; | 20 class ListValue; |
20 } | 21 } |
21 | 22 |
22 namespace content { | 23 namespace content { |
23 | 24 |
24 class WebUI; | 25 class WebUI; |
(...skipping 27 matching lines...) Expand all Loading... |
52 | 53 |
53 // This is where subclasses specify which messages they'd like to handle and | 54 // This is where subclasses specify which messages they'd like to handle and |
54 // perform any additional initialization.. At this point web_ui() will return | 55 // perform any additional initialization.. At this point web_ui() will return |
55 // the associated WebUI object. | 56 // the associated WebUI object. |
56 virtual void RegisterMessages() = 0; | 57 virtual void RegisterMessages() = 0; |
57 | 58 |
58 // Returns the attached WebUI for this handler. | 59 // Returns the attached WebUI for this handler. |
59 WebUI* web_ui() const { return web_ui_; } | 60 WebUI* web_ui() const { return web_ui_; } |
60 | 61 |
61 private: | 62 private: |
62 friend class ::WebUI; | 63 friend class ::WebUIImpl; |
63 friend class ::WebUIBrowserTest; | 64 friend class ::WebUIBrowserTest; |
| 65 FRIEND_TEST(WebUIMessageHandlerTest, ExtractIntegerValue); |
| 66 FRIEND_TEST(WebUIMessageHandlerTest, ExtractDoubleValue); |
| 67 FRIEND_TEST(WebUIMessageHandlerTest, ExtractStringValue); |
64 | 68 |
65 void set_web_ui(WebUI* web_ui) { web_ui_ = web_ui; } | 69 void set_web_ui(WebUI* web_ui) { web_ui_ = web_ui; } |
66 | 70 |
67 WebUI* web_ui_; | 71 WebUI* web_ui_; |
68 }; | 72 }; |
69 | 73 |
70 } // namespace content | 74 } // namespace content |
71 | 75 |
72 #endif // CONTENT_PUBLIC_BROWSER_WEB_UI_MESSAGE_HANDLER_H_ | 76 #endif // CONTENT_PUBLIC_BROWSER_WEB_UI_MESSAGE_HANDLER_H_ |
73 | 77 |
OLD | NEW |