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 <set> | 7 #include <set> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 const gfx::Range range(caret_pos, caret_pos); | 422 const gfx::Range range(caret_pos, caret_pos); |
423 SetTextAndSelectedRange(text, range); | 423 SetTextAndSelectedRange(text, range); |
424 | 424 |
425 if (update_popup) | 425 if (update_popup) |
426 UpdatePopup(); | 426 UpdatePopup(); |
427 | 427 |
428 if (notify_text_changed) | 428 if (notify_text_changed) |
429 TextChanged(); | 429 TextChanged(); |
430 } | 430 } |
431 | 431 |
| 432 void OmniboxViewViews::SetCaretPos(size_t caret_pos) { |
| 433 SelectRange(gfx::Range(caret_pos, caret_pos)); |
| 434 } |
| 435 |
432 bool OmniboxViewViews::IsSelectAll() const { | 436 bool OmniboxViewViews::IsSelectAll() const { |
433 // TODO(oshima): IME support. | 437 // TODO(oshima): IME support. |
434 return text() == GetSelectedText(); | 438 return text() == GetSelectedText(); |
435 } | 439 } |
436 | 440 |
437 bool OmniboxViewViews::DeleteAtEndPressed() { | 441 bool OmniboxViewViews::DeleteAtEndPressed() { |
438 return delete_at_end_pressed_; | 442 return delete_at_end_pressed_; |
439 } | 443 } |
440 | 444 |
441 void OmniboxViewViews::UpdatePopup() { | 445 void OmniboxViewViews::UpdatePopup() { |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1067 paste_position + 1, IDS_PASTE_AND_GO, IDS_PASTE_AND_GO); | 1071 paste_position + 1, IDS_PASTE_AND_GO, IDS_PASTE_AND_GO); |
1068 | 1072 |
1069 menu_contents->AddSeparator(ui::NORMAL_SEPARATOR); | 1073 menu_contents->AddSeparator(ui::NORMAL_SEPARATOR); |
1070 | 1074 |
1071 // Minor note: We use IDC_ for command id here while the underlying textfield | 1075 // Minor note: We use IDC_ for command id here while the underlying textfield |
1072 // is using IDS_ for all its command ids. This is because views cannot depend | 1076 // is using IDS_ for all its command ids. This is because views cannot depend |
1073 // on IDC_ for now. | 1077 // on IDC_ for now. |
1074 menu_contents->AddItemWithStringId(IDC_EDIT_SEARCH_ENGINES, | 1078 menu_contents->AddItemWithStringId(IDC_EDIT_SEARCH_ENGINES, |
1075 IDS_EDIT_SEARCH_ENGINES); | 1079 IDS_EDIT_SEARCH_ENGINES); |
1076 } | 1080 } |
OLD | NEW |