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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 // we want them to be destroyed before destroying any other internal state. | 151 // we want them to be destroyed before destroying any other internal state. |
152 popup_view_.reset(); | 152 popup_view_.reset(); |
153 } | 153 } |
154 | 154 |
155 //////////////////////////////////////////////////////////////////////////////// | 155 //////////////////////////////////////////////////////////////////////////////// |
156 // OmniboxViewViews public: | 156 // OmniboxViewViews public: |
157 | 157 |
158 void OmniboxViewViews::Init() { | 158 void OmniboxViewViews::Init() { |
159 set_controller(this); | 159 set_controller(this); |
160 SetTextInputType(DetermineTextInputType()); | 160 SetTextInputType(DetermineTextInputType()); |
161 SetBackgroundColor(location_bar_view_->GetColor( | |
162 ToolbarModel::NONE, LocationBarView::BACKGROUND)); | |
163 | 161 |
164 if (popup_window_mode_) | 162 if (popup_window_mode_) |
165 SetReadOnly(true); | 163 SetReadOnly(true); |
166 | 164 |
167 // Initialize the popup view using the same font. | 165 // Initialize the popup view using the same font. |
168 popup_view_.reset(OmniboxPopupContentsView::Create( | 166 popup_view_.reset(OmniboxPopupContentsView::Create( |
169 GetFontList(), this, model(), location_bar_view_)); | 167 GetFontList(), this, model(), location_bar_view_)); |
170 | 168 |
171 #if defined(OS_CHROMEOS) | 169 #if defined(OS_CHROMEOS) |
172 chromeos::input_method::InputMethodManager::Get()-> | 170 chromeos::input_method::InputMethodManager::Get()-> |
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1043 menu_contents->InsertItemWithStringIdAt( | 1041 menu_contents->InsertItemWithStringIdAt( |
1044 select_all_position + 1, IDS_SHOW_URL, IDS_SHOW_URL); | 1042 select_all_position + 1, IDS_SHOW_URL, IDS_SHOW_URL); |
1045 } | 1043 } |
1046 | 1044 |
1047 // Minor note: We use IDC_ for command id here while the underlying textfield | 1045 // Minor note: We use IDC_ for command id here while the underlying textfield |
1048 // is using IDS_ for all its command ids. This is because views cannot depend | 1046 // is using IDS_ for all its command ids. This is because views cannot depend |
1049 // on IDC_ for now. | 1047 // on IDC_ for now. |
1050 menu_contents->AddItemWithStringId(IDC_EDIT_SEARCH_ENGINES, | 1048 menu_contents->AddItemWithStringId(IDC_EDIT_SEARCH_ENGINES, |
1051 IDS_EDIT_SEARCH_ENGINES); | 1049 IDS_EDIT_SEARCH_ENGINES); |
1052 } | 1050 } |
OLD | NEW |