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