| 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 173 |
| 174 fade_in_animation_.reset(new gfx::SlideAnimation(this)); | 174 fade_in_animation_.reset(new gfx::SlideAnimation(this)); |
| 175 fade_in_animation_->SetTweenType(gfx::Tween::LINEAR); | 175 fade_in_animation_->SetTweenType(gfx::Tween::LINEAR); |
| 176 fade_in_animation_->SetSlideDuration(300); | 176 fade_in_animation_->SetSlideDuration(300); |
| 177 } | 177 } |
| 178 | 178 |
| 179 void OmniboxViewViews::FadeIn() { | 179 void OmniboxViewViews::FadeIn() { |
| 180 fade_in_animation_->Show(); | 180 fade_in_animation_->Show(); |
| 181 } | 181 } |
| 182 | 182 |
| 183 gfx::RenderText* OmniboxViewViews::GetRenderTextForTesting() { |
| 184 return GetRenderText(); |
| 185 } |
| 186 |
| 183 //////////////////////////////////////////////////////////////////////////////// | 187 //////////////////////////////////////////////////////////////////////////////// |
| 184 // OmniboxViewViews, public OmniboxView implementation: | 188 // OmniboxViewViews, public OmniboxView implementation: |
| 185 | 189 |
| 186 void OmniboxViewViews::SaveStateToTab(content::WebContents* tab) { | 190 void OmniboxViewViews::SaveStateToTab(content::WebContents* tab) { |
| 187 DCHECK(tab); | 191 DCHECK(tab); |
| 188 | 192 |
| 189 // We don't want to keep the IME status, so force quit the current | 193 // We don't want to keep the IME status, so force quit the current |
| 190 // session here. It may affect the selection status, so order is | 194 // session here. It may affect the selection status, so order is |
| 191 // also important. | 195 // also important. |
| 192 if (IsIMEComposing()) { | 196 if (IsIMEComposing()) { |
| (...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1041 menu_contents->InsertItemWithStringIdAt( | 1045 menu_contents->InsertItemWithStringIdAt( |
| 1042 select_all_position + 1, IDS_SHOW_URL, IDS_SHOW_URL); | 1046 select_all_position + 1, IDS_SHOW_URL, IDS_SHOW_URL); |
| 1043 } | 1047 } |
| 1044 | 1048 |
| 1045 // Minor note: We use IDC_ for command id here while the underlying textfield | 1049 // 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 | 1050 // is using IDS_ for all its command ids. This is because views cannot depend |
| 1047 // on IDC_ for now. | 1051 // on IDC_ for now. |
| 1048 menu_contents->AddItemWithStringId(IDC_EDIT_SEARCH_ENGINES, | 1052 menu_contents->AddItemWithStringId(IDC_EDIT_SEARCH_ENGINES, |
| 1049 IDS_EDIT_SEARCH_ENGINES); | 1053 IDS_EDIT_SEARCH_ENGINES); |
| 1050 } | 1054 } |
| OLD | NEW |