Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: chrome/browser/dom_ui/dom_ui.cc

Issue 28104: Enable history and downloads by default, port NewTabUI from DOMUIHost to DOMU... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/dom_ui/dom_ui.h ('k') | chrome/browser/dom_ui/dom_ui_contents.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/dom_ui.h ('k') | chrome/browser/dom_ui/dom_ui_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698