| 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 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 void OmniboxViewViews::OnGestureEvent(ui::GestureEvent* event) { | 758 void OmniboxViewViews::OnGestureEvent(ui::GestureEvent* event) { |
| 759 if (!HasFocus() && event->type() == ui::ET_GESTURE_TAP_DOWN) { | 759 if (!HasFocus() && event->type() == ui::ET_GESTURE_TAP_DOWN) { |
| 760 select_all_on_gesture_tap_ = true; | 760 select_all_on_gesture_tap_ = true; |
| 761 | 761 |
| 762 // If we're trying to select all on tap, invalidate any saved selection lest | 762 // If we're trying to select all on tap, invalidate any saved selection lest |
| 763 // restoring it fights with the "select all" action. | 763 // restoring it fights with the "select all" action. |
| 764 saved_selection_for_focus_change_ = gfx::Range::InvalidRange(); | 764 saved_selection_for_focus_change_ = gfx::Range::InvalidRange(); |
| 765 } | 765 } |
| 766 | 766 |
| 767 if (select_all_on_gesture_tap_ && event->type() == ui::ET_GESTURE_TAP) | 767 if (select_all_on_gesture_tap_ && event->type() == ui::ET_GESTURE_TAP) |
| 768 SelectAll(false); | 768 SelectAll(true); |
| 769 | 769 |
| 770 if (event->type() == ui::ET_GESTURE_TAP || | 770 if (event->type() == ui::ET_GESTURE_TAP || |
| 771 event->type() == ui::ET_GESTURE_TAP_CANCEL || | 771 event->type() == ui::ET_GESTURE_TAP_CANCEL || |
| 772 event->type() == ui::ET_GESTURE_TWO_FINGER_TAP || | 772 event->type() == ui::ET_GESTURE_TWO_FINGER_TAP || |
| 773 event->type() == ui::ET_GESTURE_SCROLL_BEGIN || | 773 event->type() == ui::ET_GESTURE_SCROLL_BEGIN || |
| 774 event->type() == ui::ET_GESTURE_PINCH_BEGIN || | 774 event->type() == ui::ET_GESTURE_PINCH_BEGIN || |
| 775 event->type() == ui::ET_GESTURE_LONG_PRESS || | 775 event->type() == ui::ET_GESTURE_LONG_PRESS || |
| 776 event->type() == ui::ET_GESTURE_LONG_TAP) { | 776 event->type() == ui::ET_GESTURE_LONG_TAP) { |
| 777 select_all_on_gesture_tap_ = false; | 777 select_all_on_gesture_tap_ = false; |
| 778 } | 778 } |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1019 menu_contents->InsertItemWithStringIdAt( | 1019 menu_contents->InsertItemWithStringIdAt( |
| 1020 select_all_position + 1, IDS_SHOW_URL, IDS_SHOW_URL); | 1020 select_all_position + 1, IDS_SHOW_URL, IDS_SHOW_URL); |
| 1021 } | 1021 } |
| 1022 | 1022 |
| 1023 // Minor note: We use IDC_ for command id here while the underlying textfield | 1023 // Minor note: We use IDC_ for command id here while the underlying textfield |
| 1024 // is using IDS_ for all its command ids. This is because views cannot depend | 1024 // is using IDS_ for all its command ids. This is because views cannot depend |
| 1025 // on IDC_ for now. | 1025 // on IDC_ for now. |
| 1026 menu_contents->AddItemWithStringId(IDC_EDIT_SEARCH_ENGINES, | 1026 menu_contents->AddItemWithStringId(IDC_EDIT_SEARCH_ENGINES, |
| 1027 IDS_EDIT_SEARCH_ENGINES); | 1027 IDS_EDIT_SEARCH_ENGINES); |
| 1028 } | 1028 } |
| OLD | NEW |