| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/dom_ui/dom_ui.h" | 5 #include "chrome/browser/dom_ui/dom_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-inl.h" | 9 #include "base/stl_util-inl.h" |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 ThemeProvider* DOMUI::GetThemeProvider() const { | 80 ThemeProvider* DOMUI::GetThemeProvider() const { |
| 81 return tab_contents_->profile()->GetThemeProvider(); | 81 return tab_contents_->profile()->GetThemeProvider(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void DOMUI::RegisterMessageCallback(const std::string &message, | 84 void DOMUI::RegisterMessageCallback(const std::string &message, |
| 85 MessageCallback *callback) { | 85 MessageCallback *callback) { |
| 86 message_callbacks_.insert(std::make_pair(message, callback)); | 86 message_callbacks_.insert(std::make_pair(message, callback)); |
| 87 } | 87 } |
| 88 | 88 |
| 89 Profile* DOMUI::GetProfile() const { | 89 Profile* DOMUI::GetProfile() { |
| 90 return tab_contents()->profile(); | 90 return tab_contents()->profile(); |
| 91 } | 91 } |
| 92 | 92 |
| 93 // DOMUI, protected: ---------------------------------------------------------- | 93 // DOMUI, protected: ---------------------------------------------------------- |
| 94 | 94 |
| 95 void DOMUI::AddMessageHandler(DOMMessageHandler* handler) { | 95 void DOMUI::AddMessageHandler(DOMMessageHandler* handler) { |
| 96 handlers_.push_back(handler); | 96 handlers_.push_back(handler); |
| 97 } | 97 } |
| 98 | 98 |
| 99 // DOMUI, private: ------------------------------------------------------------ | 99 // DOMUI, private: ------------------------------------------------------------ |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 157 |
| 158 std::wstring DOMMessageHandler::ExtractStringValue(const Value* value) { | 158 std::wstring DOMMessageHandler::ExtractStringValue(const Value* value) { |
| 159 if (value && value->GetType() == Value::TYPE_LIST) { | 159 if (value && value->GetType() == Value::TYPE_LIST) { |
| 160 const ListValue* list_value = static_cast<const ListValue*>(value); | 160 const ListValue* list_value = static_cast<const ListValue*>(value); |
| 161 std::wstring wstring_value; | 161 std::wstring wstring_value; |
| 162 if (list_value->GetString(0, &wstring_value)) | 162 if (list_value->GetString(0, &wstring_value)) |
| 163 return wstring_value; | 163 return wstring_value; |
| 164 } | 164 } |
| 165 return std::wstring(); | 165 return std::wstring(); |
| 166 } | 166 } |
| OLD | NEW |