| 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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 // Returns the width necessary to display the current text, including any | 309 // Returns the width necessary to display the current text, including any |
| 310 // necessary space for the cursor or border/margin. | 310 // necessary space for the cursor or border/margin. |
| 311 return GetRenderText()->GetContentWidth() + GetInsets().width(); | 311 return GetRenderText()->GetContentWidth() + GetInsets().width(); |
| 312 } | 312 } |
| 313 | 313 |
| 314 bool OmniboxViewViews::IsImeComposing() const { | 314 bool OmniboxViewViews::IsImeComposing() const { |
| 315 return IsIMEComposing(); | 315 return IsIMEComposing(); |
| 316 } | 316 } |
| 317 | 317 |
| 318 void OmniboxViewViews::ExecuteCommand(int command_id, int event_flags) { | 318 void OmniboxViewViews::ExecuteCommand(int command_id, int event_flags) { |
| 319 DestroyTouchSelection(); |
| 319 switch (command_id) { | 320 switch (command_id) { |
| 320 // These commands don't invoke the popup via OnBefore/AfterPossibleChange(). | 321 // These commands don't invoke the popup via OnBefore/AfterPossibleChange(). |
| 321 case IDS_PASTE_AND_GO: | 322 case IDS_PASTE_AND_GO: |
| 322 model()->PasteAndGo(GetClipboardText()); | 323 model()->PasteAndGo(GetClipboardText()); |
| 323 break; | 324 break; |
| 324 case IDS_SHOW_URL: | 325 case IDS_SHOW_URL: |
| 325 controller()->ShowURL(); | 326 controller()->ShowURL(); |
| 326 break; | 327 break; |
| 327 case IDC_EDIT_SEARCH_ENGINES: | 328 case IDC_EDIT_SEARCH_ENGINES: |
| 328 command_updater()->ExecuteCommand(command_id); | 329 command_updater()->ExecuteCommand(command_id); |
| (...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1045 menu_contents->InsertItemWithStringIdAt( | 1046 menu_contents->InsertItemWithStringIdAt( |
| 1046 select_all_position + 1, IDS_SHOW_URL, IDS_SHOW_URL); | 1047 select_all_position + 1, IDS_SHOW_URL, IDS_SHOW_URL); |
| 1047 } | 1048 } |
| 1048 | 1049 |
| 1049 // 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 |
| 1050 // 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 |
| 1051 // on IDC_ for now. | 1052 // on IDC_ for now. |
| 1052 menu_contents->AddItemWithStringId(IDC_EDIT_SEARCH_ENGINES, | 1053 menu_contents->AddItemWithStringId(IDC_EDIT_SEARCH_ENGINES, |
| 1053 IDS_EDIT_SEARCH_ENGINES); | 1054 IDS_EDIT_SEARCH_ENGINES); |
| 1054 } | 1055 } |
| OLD | NEW |