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/search/search_tab_helper.h" | 5 #include "chrome/browser/ui/search/search_tab_helper.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "chrome/browser/ui/location_bar/location_bar.h" | 24 #include "chrome/browser/ui/location_bar/location_bar.h" |
25 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" | 25 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" |
26 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h" | 26 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h" |
27 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 27 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
28 #include "chrome/browser/ui/search/instant_search_prerenderer.h" | 28 #include "chrome/browser/ui/search/instant_search_prerenderer.h" |
29 #include "chrome/browser/ui/search/search_ipc_router_policy_impl.h" | 29 #include "chrome/browser/ui/search/search_ipc_router_policy_impl.h" |
30 #include "chrome/browser/ui/search/search_tab_helper_delegate.h" | 30 #include "chrome/browser/ui/search/search_tab_helper_delegate.h" |
31 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" | 31 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
32 #include "chrome/browser/ui/webui/ntp/ntp_user_data_logger.h" | 32 #include "chrome/browser/ui/webui/ntp/ntp_user_data_logger.h" |
33 #include "chrome/common/url_constants.h" | 33 #include "chrome/common/url_constants.h" |
| 34 #include "chrome/grit/generated_resources.h" |
34 #include "components/google/core/browser/google_util.h" | 35 #include "components/google/core/browser/google_util.h" |
35 #include "components/search/search.h" | 36 #include "components/search/search.h" |
36 #include "components/signin/core/browser/signin_manager.h" | 37 #include "components/signin/core/browser/signin_manager.h" |
37 #include "content/public/browser/navigation_controller.h" | 38 #include "content/public/browser/navigation_controller.h" |
38 #include "content/public/browser/navigation_details.h" | 39 #include "content/public/browser/navigation_details.h" |
39 #include "content/public/browser/navigation_entry.h" | 40 #include "content/public/browser/navigation_entry.h" |
40 #include "content/public/browser/navigation_type.h" | 41 #include "content/public/browser/navigation_type.h" |
41 #include "content/public/browser/notification_service.h" | 42 #include "content/public/browser/notification_service.h" |
42 #include "content/public/browser/notification_source.h" | 43 #include "content/public/browser/notification_source.h" |
43 #include "content/public/browser/render_frame_host.h" | 44 #include "content/public/browser/render_frame_host.h" |
44 #include "content/public/browser/render_process_host.h" | 45 #include "content/public/browser/render_process_host.h" |
45 #include "content/public/browser/user_metrics.h" | 46 #include "content/public/browser/user_metrics.h" |
46 #include "content/public/browser/web_contents.h" | 47 #include "content/public/browser/web_contents.h" |
47 #include "content/public/common/page_transition_types.h" | 48 #include "content/public/common/page_transition_types.h" |
48 #include "content/public/common/referrer.h" | 49 #include "content/public/common/referrer.h" |
49 #include "grit/generated_resources.h" | |
50 #include "net/base/net_errors.h" | 50 #include "net/base/net_errors.h" |
51 #include "ui/base/l10n/l10n_util.h" | 51 #include "ui/base/l10n/l10n_util.h" |
52 #include "url/gurl.h" | 52 #include "url/gurl.h" |
53 | 53 |
54 DEFINE_WEB_CONTENTS_USER_DATA_KEY(SearchTabHelper); | 54 DEFINE_WEB_CONTENTS_USER_DATA_KEY(SearchTabHelper); |
55 | 55 |
56 namespace { | 56 namespace { |
57 | 57 |
58 // For reporting Cacheable NTP navigations. | 58 // For reporting Cacheable NTP navigations. |
59 enum CacheableNTPLoad { | 59 enum CacheableNTPLoad { |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 | 628 |
629 bool SearchTabHelper::IsInputInProgress() const { | 629 bool SearchTabHelper::IsInputInProgress() const { |
630 OmniboxView* omnibox = GetOmniboxView(); | 630 OmniboxView* omnibox = GetOmniboxView(); |
631 return !model_.mode().is_ntp() && omnibox && | 631 return !model_.mode().is_ntp() && omnibox && |
632 omnibox->model()->focus_state() == OMNIBOX_FOCUS_VISIBLE; | 632 omnibox->model()->focus_state() == OMNIBOX_FOCUS_VISIBLE; |
633 } | 633 } |
634 | 634 |
635 OmniboxView* SearchTabHelper::GetOmniboxView() const { | 635 OmniboxView* SearchTabHelper::GetOmniboxView() const { |
636 return delegate_ ? delegate_->GetOmniboxView() : NULL; | 636 return delegate_ ? delegate_->GetOmniboxView() : NULL; |
637 } | 637 } |
OLD | NEW |