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/location_bar/location_bar_view.h" | 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1229 #if defined(OS_WIN) | 1229 #if defined(OS_WIN) |
1230 if (views::FocusManager::IsTabTraversalKeyEvent(event)) { | 1230 if (views::FocusManager::IsTabTraversalKeyEvent(event)) { |
1231 if (location_entry_->model()->popup_model()->IsOpen()) { | 1231 if (location_entry_->model()->popup_model()->IsOpen()) { |
1232 // Return true so that the edit sees the tab and moves the selection. | 1232 // Return true so that the edit sees the tab and moves the selection. |
1233 return true; | 1233 return true; |
1234 } | 1234 } |
1235 if (keyword_hint_view_->visible() && !event.IsShiftDown()) { | 1235 if (keyword_hint_view_->visible() && !event.IsShiftDown()) { |
1236 // Return true so the edit gets the tab event and enters keyword mode. | 1236 // Return true so the edit gets the tab event and enters keyword mode. |
1237 return true; | 1237 return true; |
1238 } | 1238 } |
1239 | |
1240 // Tab while showing Instant commits instant immediately. | |
1241 // Return true so that focus traversal isn't attempted. The edit ends | |
1242 // up doing nothing in this case. | |
1243 if (location_entry_->model()->AcceptCurrentInstantPreview()) | |
1244 return true; | |
1245 } | 1239 } |
1246 | 1240 |
1247 #if defined(USE_AURA) | 1241 #if defined(USE_AURA) |
1248 NOTIMPLEMENTED(); | 1242 NOTIMPLEMENTED(); |
1249 return false; | 1243 return false; |
1250 #else | 1244 #else |
1251 OmniboxViewWin* omnibox_win = GetOmniboxViewWin(location_entry_.get()); | 1245 OmniboxViewWin* omnibox_win = GetOmniboxViewWin(location_entry_.get()); |
1252 if (omnibox_win) | 1246 if (omnibox_win) |
1253 return omnibox_win->SkipDefaultKeyEventProcessing(event); | 1247 return omnibox_win->SkipDefaultKeyEventProcessing(event); |
1254 #endif // USE_AURA | 1248 #endif // USE_AURA |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1473 int LocationBarView::GetInternalHeight(bool use_preferred_size) { | 1467 int LocationBarView::GetInternalHeight(bool use_preferred_size) { |
1474 int total_height = | 1468 int total_height = |
1475 use_preferred_size ? GetPreferredSize().height() : height(); | 1469 use_preferred_size ? GetPreferredSize().height() : height(); |
1476 return std::max(total_height - (kVerticalEdgeThickness * 2), 0); | 1470 return std::max(total_height - (kVerticalEdgeThickness * 2), 0); |
1477 } | 1471 } |
1478 | 1472 |
1479 bool LocationBarView::HasValidSuggestText() const { | 1473 bool LocationBarView::HasValidSuggestText() const { |
1480 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() && | 1474 return suggested_text_view_ && !suggested_text_view_->size().IsEmpty() && |
1481 !suggested_text_view_->text().empty(); | 1475 !suggested_text_view_->text().empty(); |
1482 } | 1476 } |
OLD | NEW |