OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/omnibox/omnibox_edit_model.h" | 5 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
12 #include "base/prefs/pref_service.h" | 12 #include "base/prefs/pref_service.h" |
13 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
15 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
17 #include "chrome/app/chrome_command_ids.h" | 17 #include "chrome/app/chrome_command_ids.h" |
18 #include "chrome/browser/autocomplete/autocomplete_classifier.h" | 18 #include "chrome/browser/autocomplete/autocomplete_classifier.h" |
19 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" | 19 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" |
20 #include "chrome/browser/autocomplete/autocomplete_provider.h" | 20 #include "chrome/browser/autocomplete/autocomplete_provider.h" |
21 #include "chrome/browser/autocomplete/extension_app_provider.h" | 21 #include "chrome/browser/autocomplete/extension_app_provider.h" |
22 #include "chrome/browser/autocomplete/history_url_provider.h" | 22 #include "chrome/browser/autocomplete/history_url_provider.h" |
23 #include "chrome/browser/autocomplete/keyword_provider.h" | 23 #include "chrome/browser/autocomplete/keyword_provider.h" |
24 #include "chrome/browser/autocomplete/search_provider.h" | 24 #include "chrome/browser/autocomplete/search_provider.h" |
25 #include "chrome/browser/bookmarks/bookmark_stats.h" | 25 #include "chrome/browser/bookmarks/bookmark_stats.h" |
26 #include "chrome/browser/chrome_notification_types.h" | 26 #include "chrome/browser/chrome_notification_types.h" |
27 #include "chrome/browser/command_updater.h" | 27 #include "chrome/browser/command_updater.h" |
28 #include "chrome/browser/extensions/api/omnibox/omnibox_api.h" | 28 #include "chrome/browser/extensions/api/omnibox/omnibox_api.h" |
29 #include "chrome/browser/favicon/favicon_tab_helper.h" | 29 #include "chrome/browser/favicon/favicon_tab_helper.h" |
30 #include "chrome/browser/google/google_url_tracker.h" | |
31 #include "chrome/browser/google/google_url_tracker_factory.h" | 30 #include "chrome/browser/google/google_url_tracker_factory.h" |
32 #include "chrome/browser/net/predictor.h" | 31 #include "chrome/browser/net/predictor.h" |
33 #include "chrome/browser/omnibox/omnibox_log.h" | 32 #include "chrome/browser/omnibox/omnibox_log.h" |
34 #include "chrome/browser/predictors/autocomplete_action_predictor.h" | 33 #include "chrome/browser/predictors/autocomplete_action_predictor.h" |
35 #include "chrome/browser/predictors/autocomplete_action_predictor_factory.h" | 34 #include "chrome/browser/predictors/autocomplete_action_predictor_factory.h" |
36 #include "chrome/browser/prerender/prerender_field_trial.h" | 35 #include "chrome/browser/prerender/prerender_field_trial.h" |
37 #include "chrome/browser/prerender/prerender_manager.h" | 36 #include "chrome/browser/prerender/prerender_manager.h" |
38 #include "chrome/browser/prerender/prerender_manager_factory.h" | 37 #include "chrome/browser/prerender/prerender_manager_factory.h" |
39 #include "chrome/browser/profiles/profile.h" | 38 #include "chrome/browser/profiles/profile.h" |
40 #include "chrome/browser/search/search.h" | 39 #include "chrome/browser/search/search.h" |
41 #include "chrome/browser/search_engines/template_url.h" | 40 #include "chrome/browser/search_engines/template_url.h" |
42 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" | 41 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" |
43 #include "chrome/browser/search_engines/template_url_service.h" | 42 #include "chrome/browser/search_engines/template_url_service.h" |
44 #include "chrome/browser/search_engines/template_url_service_factory.h" | 43 #include "chrome/browser/search_engines/template_url_service_factory.h" |
45 #include "chrome/browser/sessions/session_tab_helper.h" | 44 #include "chrome/browser/sessions/session_tab_helper.h" |
46 #include "chrome/browser/ui/browser_list.h" | 45 #include "chrome/browser/ui/browser_list.h" |
47 #include "chrome/browser/ui/omnibox/omnibox_current_page_delegate_impl.h" | 46 #include "chrome/browser/ui/omnibox/omnibox_current_page_delegate_impl.h" |
48 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" | 47 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" |
49 #include "chrome/browser/ui/omnibox/omnibox_navigation_observer.h" | 48 #include "chrome/browser/ui/omnibox/omnibox_navigation_observer.h" |
50 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h" | 49 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h" |
51 #include "chrome/browser/ui/omnibox/omnibox_popup_view.h" | 50 #include "chrome/browser/ui/omnibox/omnibox_popup_view.h" |
52 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 51 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
53 #include "chrome/browser/ui/search/instant_search_prerenderer.h" | 52 #include "chrome/browser/ui/search/instant_search_prerenderer.h" |
54 #include "chrome/browser/ui/search/search_tab_helper.h" | 53 #include "chrome/browser/ui/search/search_tab_helper.h" |
55 #include "chrome/browser/ui/toolbar/toolbar_model.h" | 54 #include "chrome/browser/ui/toolbar/toolbar_model.h" |
56 #include "chrome/common/chrome_switches.h" | 55 #include "chrome/common/chrome_switches.h" |
57 #include "chrome/common/net/url_fixer_upper.h" | 56 #include "chrome/common/net/url_fixer_upper.h" |
58 #include "chrome/common/pref_names.h" | 57 #include "chrome/common/pref_names.h" |
59 #include "chrome/common/url_constants.h" | 58 #include "chrome/common/url_constants.h" |
| 59 #include "components/google/core/browser/google_url_tracker.h" |
60 #include "content/public/browser/navigation_controller.h" | 60 #include "content/public/browser/navigation_controller.h" |
61 #include "content/public/browser/navigation_entry.h" | 61 #include "content/public/browser/navigation_entry.h" |
62 #include "content/public/browser/notification_service.h" | 62 #include "content/public/browser/notification_service.h" |
63 #include "content/public/browser/render_view_host.h" | 63 #include "content/public/browser/render_view_host.h" |
64 #include "content/public/browser/user_metrics.h" | 64 #include "content/public/browser/user_metrics.h" |
65 #include "extensions/common/constants.h" | 65 #include "extensions/common/constants.h" |
66 #include "ui/gfx/image/image.h" | 66 #include "ui/gfx/image/image.h" |
67 #include "url/url_util.h" | 67 #include "url/url_util.h" |
68 | 68 |
69 using predictors::AutocompleteActionPredictor; | 69 using predictors::AutocompleteActionPredictor; |
(...skipping 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1466 // Update state and notify view if the omnibox has focus and the caret | 1466 // Update state and notify view if the omnibox has focus and the caret |
1467 // visibility changed. | 1467 // visibility changed. |
1468 const bool was_caret_visible = is_caret_visible(); | 1468 const bool was_caret_visible = is_caret_visible(); |
1469 focus_state_ = state; | 1469 focus_state_ = state; |
1470 if (focus_state_ != OMNIBOX_FOCUS_NONE && | 1470 if (focus_state_ != OMNIBOX_FOCUS_NONE && |
1471 is_caret_visible() != was_caret_visible) | 1471 is_caret_visible() != was_caret_visible) |
1472 view_->ApplyCaretVisibility(); | 1472 view_->ApplyCaretVisibility(); |
1473 | 1473 |
1474 delegate_->OnFocusChanged(focus_state_, reason); | 1474 delegate_->OnFocusChanged(focus_state_, reason); |
1475 } | 1475 } |
OLD | NEW |