OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/shell/browser/shell.h" | 5 #include "content/shell/browser/shell.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
10 #include "content/public/browser/web_contents_view.h" | 10 #include "content/public/browser/web_contents_view.h" |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 211 |
212 layout->AddPaddingRow(0, 5); | 212 layout->AddPaddingRow(0, 5); |
213 } | 213 } |
214 // Overridden from TextfieldController | 214 // Overridden from TextfieldController |
215 virtual void ContentsChanged(views::Textfield* sender, | 215 virtual void ContentsChanged(views::Textfield* sender, |
216 const base::string16& new_contents) OVERRIDE { | 216 const base::string16& new_contents) OVERRIDE { |
217 } | 217 } |
218 virtual bool HandleKeyEvent(views::Textfield* sender, | 218 virtual bool HandleKeyEvent(views::Textfield* sender, |
219 const ui::KeyEvent& key_event) OVERRIDE { | 219 const ui::KeyEvent& key_event) OVERRIDE { |
220 if (sender == url_entry_ && key_event.key_code() == ui::VKEY_RETURN) { | 220 if (sender == url_entry_ && key_event.key_code() == ui::VKEY_RETURN) { |
221 std::string text = base::UTF16ToUTF8(url_entry_->text()); | 221 std::string text = base::UTF16ToUTF8(url_entry_->GetText()); |
222 GURL url(text); | 222 GURL url(text); |
223 if (!url.has_scheme()) { | 223 if (!url.has_scheme()) { |
224 url = GURL(std::string("http://") + std::string(text)); | 224 url = GURL(std::string("http://") + std::string(text)); |
225 url_entry_->SetText(base::ASCIIToUTF16(url.spec())); | 225 url_entry_->SetText(base::ASCIIToUTF16(url.spec())); |
226 } | 226 } |
227 shell_->LoadURL(url); | 227 shell_->LoadURL(url); |
228 return true; | 228 return true; |
229 } | 229 } |
230 return false; | 230 return false; |
231 } | 231 } |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 } | 386 } |
387 | 387 |
388 void Shell::PlatformSetTitle(const base::string16& title) { | 388 void Shell::PlatformSetTitle(const base::string16& title) { |
389 ShellWindowDelegateView* delegate_view = | 389 ShellWindowDelegateView* delegate_view = |
390 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); | 390 static_cast<ShellWindowDelegateView*>(window_widget_->widget_delegate()); |
391 delegate_view->SetWindowTitle(title); | 391 delegate_view->SetWindowTitle(title); |
392 window_widget_->UpdateWindowTitle(); | 392 window_widget_->UpdateWindowTitle(); |
393 } | 393 } |
394 | 394 |
395 } // namespace content | 395 } // namespace content |
OLD | NEW |