OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/views/omnibox/omnibox_view_views.h" | 5 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" |
6 | 6 |
7 #include "base/property_bag.h" | 7 #include "base/property_bag.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 // static | 176 // static |
177 const char OmniboxViewViews::kViewClassName[] = | 177 const char OmniboxViewViews::kViewClassName[] = |
178 "browser/ui/views/omnibox/OmniboxViewViews"; | 178 "browser/ui/views/omnibox/OmniboxViewViews"; |
179 | 179 |
180 OmniboxViewViews::OmniboxViewViews(AutocompleteEditController* controller, | 180 OmniboxViewViews::OmniboxViewViews(AutocompleteEditController* controller, |
181 ToolbarModel* toolbar_model, | 181 ToolbarModel* toolbar_model, |
182 Profile* profile, | 182 Profile* profile, |
183 CommandUpdater* command_updater, | 183 CommandUpdater* command_updater, |
184 bool popup_window_mode, | 184 bool popup_window_mode, |
185 LocationBarView* location_bar) | 185 LocationBarView* location_bar) |
186 : popup_window_mode_(popup_window_mode), | 186 : textfield_(NULL), |
| 187 popup_window_mode_(popup_window_mode), |
187 model_(new AutocompleteEditModel(this, controller, profile)), | 188 model_(new AutocompleteEditModel(this, controller, profile)), |
188 controller_(controller), | 189 controller_(controller), |
189 toolbar_model_(toolbar_model), | 190 toolbar_model_(toolbar_model), |
190 command_updater_(command_updater), | 191 command_updater_(command_updater), |
191 security_level_(ToolbarModel::NONE), | 192 security_level_(ToolbarModel::NONE), |
192 ime_composing_before_change_(false), | 193 ime_composing_before_change_(false), |
193 delete_at_end_pressed_(false), | 194 delete_at_end_pressed_(false), |
194 location_bar_view_(location_bar), | 195 location_bar_view_(location_bar), |
195 ime_candidate_window_open_(false), | 196 ime_candidate_window_open_(false), |
196 select_all_on_mouse_release_(false) { | 197 select_all_on_mouse_release_(false) { |
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 const ui::Range& range) { | 886 const ui::Range& range) { |
886 if (text != GetText()) | 887 if (text != GetText()) |
887 textfield_->SetText(text); | 888 textfield_->SetText(text); |
888 textfield_->SelectRange(range); | 889 textfield_->SelectRange(range); |
889 } | 890 } |
890 | 891 |
891 string16 OmniboxViewViews::GetSelectedText() const { | 892 string16 OmniboxViewViews::GetSelectedText() const { |
892 // TODO(oshima): Support instant, IME. | 893 // TODO(oshima): Support instant, IME. |
893 return textfield_->GetSelectedText(); | 894 return textfield_->GetSelectedText(); |
894 } | 895 } |
OLD | NEW |