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