| 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 #include "content/browser/webui/web_ui.h" | 5 #include "content/browser/webui/web_ui.h" |
| 6 | 6 |
| 7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 parameters += UTF8ToUTF16(json); | 35 parameters += UTF8ToUTF16(json); |
| 36 } | 36 } |
| 37 return ASCIIToUTF16(function_name) + | 37 return ASCIIToUTF16(function_name) + |
| 38 char16('(') + parameters + char16(')') + char16(';'); | 38 char16('(') + parameters + char16(')') + char16(';'); |
| 39 } | 39 } |
| 40 | 40 |
| 41 WebUI::WebUI(TabContents* contents) | 41 WebUI::WebUI(TabContents* contents) |
| 42 : hide_favicon_(false), | 42 : hide_favicon_(false), |
| 43 focus_location_bar_by_default_(false), | 43 focus_location_bar_by_default_(false), |
| 44 should_hide_url_(false), | 44 should_hide_url_(false), |
| 45 link_transition_type_(PageTransition::LINK), | 45 link_transition_type_(content::PAGE_TRANSITION_LINK), |
| 46 bindings_(content::BINDINGS_POLICY_WEB_UI), | 46 bindings_(content::BINDINGS_POLICY_WEB_UI), |
| 47 register_callback_overwrites_(false), | 47 register_callback_overwrites_(false), |
| 48 tab_contents_(contents) { | 48 tab_contents_(contents) { |
| 49 DCHECK(contents); | 49 DCHECK(contents); |
| 50 GenericHandler* handler = new GenericHandler(); | 50 GenericHandler* handler = new GenericHandler(); |
| 51 AddMessageHandler(handler->Attach(this)); | 51 AddMessageHandler(handler->Attach(this)); |
| 52 } | 52 } |
| 53 | 53 |
| 54 WebUI::~WebUI() { | 54 WebUI::~WebUI() { |
| 55 // TODO(csilv): Remove legacy callback support. | 55 // TODO(csilv): Remove legacy callback support. |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 return false; | 271 return false; |
| 272 } | 272 } |
| 273 | 273 |
| 274 string16 WebUIMessageHandler::ExtractStringValue(const ListValue* value) { | 274 string16 WebUIMessageHandler::ExtractStringValue(const ListValue* value) { |
| 275 string16 string16_value; | 275 string16 string16_value; |
| 276 if (value->GetString(0, &string16_value)) | 276 if (value->GetString(0, &string16_value)) |
| 277 return string16_value; | 277 return string16_value; |
| 278 NOTREACHED(); | 278 NOTREACHED(); |
| 279 return string16(); | 279 return string16(); |
| 280 } | 280 } |
| OLD | NEW |