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/stl_util.h" | 10 #include "base/stl_util.h" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
12 #include "chrome/app/chrome_command_ids.h" | 12 #include "chrome/app/chrome_command_ids.h" |
13 #include "chrome/browser/alternate_nav_url_fetcher.h" | 13 #include "chrome/browser/alternate_nav_url_fetcher.h" |
14 #include "chrome/browser/chrome_to_mobile_service.h" | 14 #include "chrome/browser/chrome_to_mobile_service.h" |
15 #include "chrome/browser/chrome_to_mobile_service_factory.h" | 15 #include "chrome/browser/chrome_to_mobile_service_factory.h" |
16 #include "chrome/browser/command_updater.h" | 16 #include "chrome/browser/command_updater.h" |
17 #include "chrome/browser/defaults.h" | 17 #include "chrome/browser/defaults.h" |
18 #include "chrome/browser/extensions/extension_service.h" | 18 #include "chrome/browser/extensions/extension_service.h" |
19 #include "chrome/browser/extensions/extension_system.h" | 19 #include "chrome/browser/extensions/extension_system.h" |
20 #include "chrome/browser/extensions/location_bar_controller.h" | 20 #include "chrome/browser/extensions/location_bar_controller.h" |
21 #include "chrome/browser/extensions/tab_helper.h" | 21 #include "chrome/browser/extensions/tab_helper.h" |
22 #include "chrome/browser/favicon/favicon_tab_helper.h" | 22 #include "chrome/browser/favicon/favicon_tab_helper.h" |
23 #include "chrome/browser/instant/instant_controller.h" | |
24 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
25 #include "chrome/browser/search_engines/template_url.h" | 24 #include "chrome/browser/search_engines/template_url.h" |
26 #include "chrome/browser/search_engines/template_url_service.h" | 25 #include "chrome/browser/search_engines/template_url_service.h" |
27 #include "chrome/browser/search_engines/template_url_service_factory.h" | 26 #include "chrome/browser/search_engines/template_url_service_factory.h" |
28 #include "chrome/browser/ui/browser.h" | 27 #include "chrome/browser/ui/browser.h" |
29 #include "chrome/browser/ui/browser_finder.h" | 28 #include "chrome/browser/ui/browser_finder.h" |
30 #include "chrome/browser/ui/browser_tabstrip.h" | 29 #include "chrome/browser/ui/browser_tabstrip.h" |
31 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h" | 30 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h" |
32 #include "chrome/browser/ui/search/search.h" | 31 #include "chrome/browser/ui/search/search.h" |
33 #include "chrome/browser/ui/search/search_model.h" | 32 #include "chrome/browser/ui/search/search_model.h" |
(...skipping 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1251 if (views::FocusManager::IsTabTraversalKeyEvent(event)) { | 1250 if (views::FocusManager::IsTabTraversalKeyEvent(event)) { |
1252 if (location_entry_->model()->popup_model()->IsOpen()) { | 1251 if (location_entry_->model()->popup_model()->IsOpen()) { |
1253 // Return true so that the edit sees the tab and moves the selection. | 1252 // Return true so that the edit sees the tab and moves the selection. |
1254 return true; | 1253 return true; |
1255 } | 1254 } |
1256 if (keyword_hint_view_->visible() && !event.IsShiftDown()) { | 1255 if (keyword_hint_view_->visible() && !event.IsShiftDown()) { |
1257 // Return true so the edit gets the tab event and enters keyword mode. | 1256 // Return true so the edit gets the tab event and enters keyword mode. |
1258 return true; | 1257 return true; |
1259 } | 1258 } |
1260 | 1259 |
1261 // Tab while showing instant commits instant immediately. | 1260 // Tab while showing Instant commits instant immediately. |
1262 // Return true so that focus traversal isn't attempted. The edit ends | 1261 // Return true so that focus traversal isn't attempted. The edit ends |
1263 // up doing nothing in this case. | 1262 // up doing nothing in this case. |
1264 if (location_entry_->model()->AcceptCurrentInstantPreview()) | 1263 if (location_entry_->model()->AcceptCurrentInstantPreview()) |
1265 return true; | 1264 return true; |
1266 } | 1265 } |
1267 | 1266 |
1268 #if defined(USE_AURA) | 1267 #if defined(USE_AURA) |
1269 NOTIMPLEMENTED(); | 1268 NOTIMPLEMENTED(); |
1270 return false; | 1269 return false; |
1271 #else | 1270 #else |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1525 } | 1524 } |
1526 | 1525 |
1527 void LocationBarView::CleanupFadeAnimation() { | 1526 void LocationBarView::CleanupFadeAnimation() { |
1528 // Since we're no longer animating we don't need our layer. | 1527 // Since we're no longer animating we don't need our layer. |
1529 SetPaintToLayer(false); | 1528 SetPaintToLayer(false); |
1530 // Bubble labels don't need a transparent background anymore. | 1529 // Bubble labels don't need a transparent background anymore. |
1531 ev_bubble_view_->SetLabelBackgroundColor(SK_ColorWHITE); | 1530 ev_bubble_view_->SetLabelBackgroundColor(SK_ColorWHITE); |
1532 selected_keyword_view_->SetLabelBackgroundColor(SK_ColorWHITE); | 1531 selected_keyword_view_->SetLabelBackgroundColor(SK_ColorWHITE); |
1533 } | 1532 } |
1534 #endif // USE_AURA | 1533 #endif // USE_AURA |
OLD | NEW |