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

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

Issue 39173: Location bar should have focus when whosing NTP (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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::SetInitialFocus(bool reverse) {
83 get_contents()->render_view_host()->SetInitialFocus(reverse);
84 }
85
86 void DOMUI::RequestOpenURL(const GURL& url, 82 void DOMUI::RequestOpenURL(const GURL& url,
87 const GURL& /* referer */, 83 const GURL& /* referer */,
88 WindowOpenDisposition disposition) { 84 WindowOpenDisposition disposition) {
89 get_contents()->OpenURL(url, GURL(), disposition, PageTransition::LINK); 85 get_contents()->OpenURL(url, GURL(), disposition, PageTransition::LINK);
90 } 86 }
91 87
92 // DOMUI, protected: ---------------------------------------------------------- 88 // DOMUI, protected: ----------------------------------------------------------
93 89
94 void DOMUI::AddMessageHandler(DOMMessageHandler* handler) { 90 void DOMUI::AddMessageHandler(DOMMessageHandler* handler) {
95 handlers_.push_back(handler); 91 handlers_.push_back(handler);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 list_member->GetType() == Value::TYPE_STRING) { 166 list_member->GetType() == Value::TYPE_STRING) {
171 const StringValue* string_value = 167 const StringValue* string_value =
172 static_cast<const StringValue*>(list_member); 168 static_cast<const StringValue*>(list_member);
173 std::wstring wstring_value; 169 std::wstring wstring_value;
174 string_value->GetAsString(&wstring_value); 170 string_value->GetAsString(&wstring_value);
175 return wstring_value; 171 return wstring_value;
176 } 172 }
177 } 173 }
178 return std::wstring(); 174 return std::wstring();
179 } 175 }
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