| 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)); |
| 161 | 163 |
| 162 if (popup_window_mode_) | 164 if (popup_window_mode_) |
| 163 SetReadOnly(true); | 165 SetReadOnly(true); |
| 164 | 166 |
| 165 // Initialize the popup view using the same font. | 167 // Initialize the popup view using the same font. |
| 166 popup_view_.reset(OmniboxPopupContentsView::Create( | 168 popup_view_.reset(OmniboxPopupContentsView::Create( |
| 167 GetFontList(), this, model(), location_bar_view_)); | 169 GetFontList(), this, model(), location_bar_view_)); |
| 168 | 170 |
| 169 #if defined(OS_CHROMEOS) | 171 #if defined(OS_CHROMEOS) |
| 170 chromeos::input_method::InputMethodManager::Get()-> | 172 chromeos::input_method::InputMethodManager::Get()-> |
| (...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1041 menu_contents->InsertItemWithStringIdAt( | 1043 menu_contents->InsertItemWithStringIdAt( |
| 1042 select_all_position + 1, IDS_SHOW_URL, IDS_SHOW_URL); | 1044 select_all_position + 1, IDS_SHOW_URL, IDS_SHOW_URL); |
| 1043 } | 1045 } |
| 1044 | 1046 |
| 1045 // Minor note: We use IDC_ for command id here while the underlying textfield | 1047 // Minor note: We use IDC_ for command id here while the underlying textfield |
| 1046 // is using IDS_ for all its command ids. This is because views cannot depend | 1048 // is using IDS_ for all its command ids. This is because views cannot depend |
| 1047 // on IDC_ for now. | 1049 // on IDC_ for now. |
| 1048 menu_contents->AddItemWithStringId(IDC_EDIT_SEARCH_ENGINES, | 1050 menu_contents->AddItemWithStringId(IDC_EDIT_SEARCH_ENGINES, |
| 1049 IDS_EDIT_SEARCH_ENGINES); | 1051 IDS_EDIT_SEARCH_ENGINES); |
| 1050 } | 1052 } |
| OLD | NEW |