| 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 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 } | 698 } |
| 699 if (event.key_code() == ui::VKEY_ESCAPE) | 699 if (event.key_code() == ui::VKEY_ESCAPE) |
| 700 return model()->WillHandleEscapeKey(); | 700 return model()->WillHandleEscapeKey(); |
| 701 return Textfield::SkipDefaultKeyEventProcessing(event); | 701 return Textfield::SkipDefaultKeyEventProcessing(event); |
| 702 } | 702 } |
| 703 | 703 |
| 704 void OmniboxViewViews::GetAccessibleNodeData(ui::AXNodeData* node_data) { | 704 void OmniboxViewViews::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 705 node_data->role = ui::AX_ROLE_TEXT_FIELD; | 705 node_data->role = ui::AX_ROLE_TEXT_FIELD; |
| 706 node_data->SetName(l10n_util::GetStringUTF8(IDS_ACCNAME_LOCATION)); | 706 node_data->SetName(l10n_util::GetStringUTF8(IDS_ACCNAME_LOCATION)); |
| 707 node_data->SetValue(GetText()); | 707 node_data->SetValue(GetText()); |
| 708 node_data->html_attributes.push_back(std::make_pair("type", "url")); |
| 708 | 709 |
| 709 base::string16::size_type entry_start; | 710 base::string16::size_type entry_start; |
| 710 base::string16::size_type entry_end; | 711 base::string16::size_type entry_end; |
| 711 // Selection information is saved separately when focus is moved off the | 712 // Selection information is saved separately when focus is moved off the |
| 712 // current window - use that when there is no focus and it's valid. | 713 // current window - use that when there is no focus and it's valid. |
| 713 if (saved_selection_for_focus_change_.IsValid()) { | 714 if (saved_selection_for_focus_change_.IsValid()) { |
| 714 entry_start = saved_selection_for_focus_change_.start(); | 715 entry_start = saved_selection_for_focus_change_.start(); |
| 715 entry_end = saved_selection_for_focus_change_.end(); | 716 entry_end = saved_selection_for_focus_change_.end(); |
| 716 } else { | 717 } else { |
| 717 GetSelectionBounds(&entry_start, &entry_end); | 718 GetSelectionBounds(&entry_start, &entry_end); |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1058 paste_position + 1, IDS_PASTE_AND_GO, IDS_PASTE_AND_GO); | 1059 paste_position + 1, IDS_PASTE_AND_GO, IDS_PASTE_AND_GO); |
| 1059 | 1060 |
| 1060 menu_contents->AddSeparator(ui::NORMAL_SEPARATOR); | 1061 menu_contents->AddSeparator(ui::NORMAL_SEPARATOR); |
| 1061 | 1062 |
| 1062 // Minor note: We use IDC_ for command id here while the underlying textfield | 1063 // Minor note: We use IDC_ for command id here while the underlying textfield |
| 1063 // is using IDS_ for all its command ids. This is because views cannot depend | 1064 // is using IDS_ for all its command ids. This is because views cannot depend |
| 1064 // on IDC_ for now. | 1065 // on IDC_ for now. |
| 1065 menu_contents->AddItemWithStringId(IDC_EDIT_SEARCH_ENGINES, | 1066 menu_contents->AddItemWithStringId(IDC_EDIT_SEARCH_ENGINES, |
| 1066 IDS_EDIT_SEARCH_ENGINES); | 1067 IDS_EDIT_SEARCH_ENGINES); |
| 1067 } | 1068 } |
| OLD | NEW |