| 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/views/url_picker.h" | 5 #include "chrome/browser/views/url_picker.h" |
| 6 | 6 |
| 7 #include "app/keyboard_codes.h" | |
| 8 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 9 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 10 #include "app/table_model.h" | 9 #include "app/table_model.h" |
| 10 #include "base/keyboard_codes.h" |
| 11 #include "base/stl_util-inl.h" | 11 #include "base/stl_util-inl.h" |
| 12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 14 #include "chrome/browser/net/url_fixer_upper.h" | 14 #include "chrome/browser/net/url_fixer_upper.h" |
| 15 #include "chrome/browser/possible_url_model.h" | 15 #include "chrome/browser/possible_url_model.h" |
| 16 #include "chrome/browser/prefs/pref_service.h" | 16 #include "chrome/browser/prefs/pref_service.h" |
| 17 #include "chrome/browser/profile.h" | 17 #include "chrome/browser/profile.h" |
| 18 #include "chrome/browser/tab_contents/tab_contents.h" | 18 #include "chrome/browser/tab_contents/tab_contents.h" |
| 19 #include "chrome/common/pref_names.h" | 19 #include "chrome/common/pref_names.h" |
| 20 #include "grit/app_resources.h" | 20 #include "grit/app_resources.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 description_label->font().DeriveFont(0, gfx::Font::BOLD)); | 106 description_label->font().DeriveFont(0, gfx::Font::BOLD)); |
| 107 layout->AddView(description_label); | 107 layout->AddView(description_label); |
| 108 | 108 |
| 109 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 109 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
| 110 | 110 |
| 111 layout->StartRow(1, single_column_view_set_id); | 111 layout->StartRow(1, single_column_view_set_id); |
| 112 layout->AddView(url_table_); | 112 layout->AddView(url_table_); |
| 113 | 113 |
| 114 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 114 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
| 115 | 115 |
| 116 AddAccelerator(views::Accelerator(app::VKEY_RETURN, false, false, false)); | 116 AddAccelerator(views::Accelerator(base::VKEY_RETURN, false, false, false)); |
| 117 } | 117 } |
| 118 | 118 |
| 119 UrlPicker::~UrlPicker() { | 119 UrlPicker::~UrlPicker() { |
| 120 url_table_->SetModel(NULL); | 120 url_table_->SetModel(NULL); |
| 121 } | 121 } |
| 122 | 122 |
| 123 void UrlPicker::Show(HWND parent) { | 123 void UrlPicker::Show(HWND parent) { |
| 124 DCHECK(!window()); | 124 DCHECK(!window()); |
| 125 views::Window::CreateChromeWindow(parent, gfx::Rect(), this)->Show(); | 125 views::Window::CreateChromeWindow(parent, gfx::Rect(), this)->Show(); |
| 126 url_field_->SelectAll(); | 126 url_field_->SelectAll(); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 PerformModelChange(); | 240 PerformModelChange(); |
| 241 if (window()) | 241 if (window()) |
| 242 window()->Close(); | 242 window()->Close(); |
| 243 } | 243 } |
| 244 } | 244 } |
| 245 | 245 |
| 246 GURL UrlPicker::GetInputURL() const { | 246 GURL UrlPicker::GetInputURL() const { |
| 247 return URLFixerUpper::FixupURL(UTF16ToUTF8(url_field_->text()), | 247 return URLFixerUpper::FixupURL(UTF16ToUTF8(url_field_->text()), |
| 248 std::string()); | 248 std::string()); |
| 249 } | 249 } |
| OLD | NEW |