| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 ThemeProvider* DOMUI::GetThemeProvider() const { | 103 ThemeProvider* DOMUI::GetThemeProvider() const { |
| 104 return tab_contents_->profile()->GetThemeProvider(); | 104 return tab_contents_->profile()->GetThemeProvider(); |
| 105 } | 105 } |
| 106 | 106 |
| 107 void DOMUI::RegisterMessageCallback(const std::string &message, | 107 void DOMUI::RegisterMessageCallback(const std::string &message, |
| 108 MessageCallback *callback) { | 108 MessageCallback *callback) { |
| 109 message_callbacks_.insert(std::make_pair(message, callback)); | 109 message_callbacks_.insert(std::make_pair(message, callback)); |
| 110 } | 110 } |
| 111 | 111 |
| 112 Profile* DOMUI::GetProfile() { | 112 Profile* DOMUI::GetProfile() const { |
| 113 return tab_contents()->profile(); | 113 return tab_contents()->profile(); |
| 114 } | 114 } |
| 115 | 115 |
| 116 // DOMUI, protected: ---------------------------------------------------------- | 116 // DOMUI, protected: ---------------------------------------------------------- |
| 117 | 117 |
| 118 void DOMUI::AddMessageHandler(DOMMessageHandler* handler) { | 118 void DOMUI::AddMessageHandler(DOMMessageHandler* handler) { |
| 119 handlers_.push_back(handler); | 119 handlers_.push_back(handler); |
| 120 } | 120 } |
| 121 | 121 |
| 122 // DOMUI, private: ------------------------------------------------------------ | 122 // DOMUI, private: ------------------------------------------------------------ |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 | 179 |
| 180 std::wstring DOMMessageHandler::ExtractStringValue(const Value* value) { | 180 std::wstring DOMMessageHandler::ExtractStringValue(const Value* value) { |
| 181 if (value && value->GetType() == Value::TYPE_LIST) { | 181 if (value && value->GetType() == Value::TYPE_LIST) { |
| 182 const ListValue* list_value = static_cast<const ListValue*>(value); | 182 const ListValue* list_value = static_cast<const ListValue*>(value); |
| 183 std::wstring wstring_value; | 183 std::wstring wstring_value; |
| 184 if (list_value->GetString(0, &wstring_value)) | 184 if (list_value->GetString(0, &wstring_value)) |
| 185 return wstring_value; | 185 return wstring_value; |
| 186 } | 186 } |
| 187 return std::wstring(); | 187 return std::wstring(); |
| 188 } | 188 } |
| OLD | NEW |