| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/json_reader.h" | 7 #include "base/json_reader.h" |
| 8 #include "base/json_writer.h" | 8 #include "base/json_writer.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 javascript += L"," + UTF8ToWide(json) + L");"; | 72 javascript += L"," + UTF8ToWide(json) + L");"; |
| 73 | 73 |
| 74 ExecuteJavascript(javascript); | 74 ExecuteJavascript(javascript); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void DOMUI::RegisterMessageCallback(const std::string &message, | 77 void DOMUI::RegisterMessageCallback(const std::string &message, |
| 78 MessageCallback *callback) { | 78 MessageCallback *callback) { |
| 79 message_callbacks_.insert(std::make_pair(message, callback)); | 79 message_callbacks_.insert(std::make_pair(message, callback)); |
| 80 } | 80 } |
| 81 | 81 |
| 82 void DOMUI::RequestOpenURL(const GURL& url, |
| 83 const GURL& /* referer */, |
| 84 WindowOpenDisposition disposition) { |
| 85 get_contents()->OpenURL(url, GURL(), disposition, PageTransition::LINK); |
| 86 } |
| 87 |
| 82 // DOMUI, protected: ---------------------------------------------------------- | 88 // DOMUI, protected: ---------------------------------------------------------- |
| 83 | 89 |
| 84 void DOMUI::AddMessageHandler(DOMMessageHandler* handler) { | 90 void DOMUI::AddMessageHandler(DOMMessageHandler* handler) { |
| 85 handlers_.push_back(handler); | 91 handlers_.push_back(handler); |
| 86 } | 92 } |
| 87 | 93 |
| 88 // DOMUI, private: ------------------------------------------------------------ | 94 // DOMUI, private: ------------------------------------------------------------ |
| 89 | 95 |
| 90 void DOMUI::ExecuteJavascript(const std::wstring& javascript) { | 96 void DOMUI::ExecuteJavascript(const std::wstring& javascript) { |
| 91 DCHECK(contents_); | 97 DCHECK(contents_); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 const StringValue* string_value = | 167 const StringValue* string_value = |
| 162 static_cast<const StringValue*>(list_member); | 168 static_cast<const StringValue*>(list_member); |
| 163 std::wstring wstring_value; | 169 std::wstring wstring_value; |
| 164 string_value->GetAsString(&wstring_value); | 170 string_value->GetAsString(&wstring_value); |
| 165 return wstring_value; | 171 return wstring_value; |
| 166 } | 172 } |
| 167 } | 173 } |
| 168 return std::wstring(); | 174 return std::wstring(); |
| 169 } | 175 } |
| 170 | 176 |
| OLD | NEW |