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_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 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 protected: | 35 protected: |
36 FRIEND_TEST_ALL_PREFIXES(WebUIMessageHandlerTest, ExtractIntegerValue); | 36 FRIEND_TEST_ALL_PREFIXES(WebUIMessageHandlerTest, ExtractIntegerValue); |
37 FRIEND_TEST_ALL_PREFIXES(WebUIMessageHandlerTest, ExtractDoubleValue); | 37 FRIEND_TEST_ALL_PREFIXES(WebUIMessageHandlerTest, ExtractDoubleValue); |
38 FRIEND_TEST_ALL_PREFIXES(WebUIMessageHandlerTest, ExtractStringValue); | 38 FRIEND_TEST_ALL_PREFIXES(WebUIMessageHandlerTest, ExtractStringValue); |
39 | 39 |
40 // Helper methods: | 40 // Helper methods: |
41 | 41 |
42 // Adds "url" and "title" keys on incoming dictionary, setting title | 42 // Adds "url" and "title" keys on incoming dictionary, setting title |
43 // as the url as a fallback on empty title. | 43 // as the url as a fallback on empty title. |
44 static void SetURLAndTitle(base::DictionaryValue* dictionary, | 44 static void SetURLAndTitle(base::DictionaryValue* dictionary, |
45 string16 title, | 45 const string16& title, |
46 const GURL& gurl); | 46 const GURL& gurl); |
47 | 47 |
48 // Extract an integer value from a list Value. | 48 // Extract an integer value from a list Value. |
49 static bool ExtractIntegerValue(const base::ListValue* value, int* out_int); | 49 static bool ExtractIntegerValue(const base::ListValue* value, int* out_int); |
50 | 50 |
51 // Extract a floating point (double) value from a list Value. | 51 // Extract a floating point (double) value from a list Value. |
52 static bool ExtractDoubleValue(const base::ListValue* value, | 52 static bool ExtractDoubleValue(const base::ListValue* value, |
53 double* out_value); | 53 double* out_value); |
54 | 54 |
55 // Extract a string value from a list Value. | 55 // Extract a string value from a list Value. |
(...skipping 15 matching lines...) Expand all Loading... |
71 friend class ::WebUIImpl; | 71 friend class ::WebUIImpl; |
72 friend class ::WebUIBrowserTest; | 72 friend class ::WebUIBrowserTest; |
73 | 73 |
74 WebUI* web_ui_; | 74 WebUI* web_ui_; |
75 }; | 75 }; |
76 | 76 |
77 } // namespace content | 77 } // namespace content |
78 | 78 |
79 #endif // CONTENT_PUBLIC_BROWSER_WEB_UI_MESSAGE_HANDLER_H_ | 79 #endif // CONTENT_PUBLIC_BROWSER_WEB_UI_MESSAGE_HANDLER_H_ |
80 | 80 |
OLD | NEW |