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 <memory> | 7 #include <memory> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 UMA_HISTOGRAM_TIMES("Tab.NewTabOnload.Local", duration); | 116 UMA_HISTOGRAM_TIMES("Tab.NewTabOnload.Local", duration); |
117 } | 117 } |
118 core_tab_helper->set_new_tab_start_time(base::TimeTicks()); | 118 core_tab_helper->set_new_tab_start_time(base::TimeTicks()); |
119 } | 119 } |
120 | 120 |
121 // Returns true if the user wants to sync history. This function returning true | 121 // Returns true if the user wants to sync history. This function returning true |
122 // is not a guarantee that history is being synced, but it can be used to | 122 // is not a guarantee that history is being synced, but it can be used to |
123 // disable a feature that should not be shown to users who prefer not to sync | 123 // disable a feature that should not be shown to users who prefer not to sync |
124 // their history. | 124 // their history. |
125 bool IsHistorySyncEnabled(Profile* profile) { | 125 bool IsHistorySyncEnabled(Profile* profile) { |
126 ProfileSyncService* sync = | 126 browser_sync::ProfileSyncService* sync = |
127 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile); | 127 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile); |
128 return sync && | 128 return sync && |
129 sync->GetPreferredDataTypes().Has(syncer::HISTORY_DELETE_DIRECTIVES); | 129 sync->GetPreferredDataTypes().Has(syncer::HISTORY_DELETE_DIRECTIVES); |
130 } | 130 } |
131 | 131 |
132 } // namespace | 132 } // namespace |
133 | 133 |
134 SearchTabHelper::SearchTabHelper(content::WebContents* web_contents) | 134 SearchTabHelper::SearchTabHelper(content::WebContents* web_contents) |
135 : WebContentsObserver(web_contents), | 135 : WebContentsObserver(web_contents), |
136 is_search_enabled_(search::IsInstantExtendedAPIEnabled()), | 136 is_search_enabled_(search::IsInstantExtendedAPIEnabled()), |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 | 500 |
501 bool SearchTabHelper::IsInputInProgress() const { | 501 bool SearchTabHelper::IsInputInProgress() const { |
502 OmniboxView* omnibox = GetOmniboxView(); | 502 OmniboxView* omnibox = GetOmniboxView(); |
503 return !model_.mode().is_ntp() && omnibox && | 503 return !model_.mode().is_ntp() && omnibox && |
504 omnibox->model()->focus_state() == OMNIBOX_FOCUS_VISIBLE; | 504 omnibox->model()->focus_state() == OMNIBOX_FOCUS_VISIBLE; |
505 } | 505 } |
506 | 506 |
507 OmniboxView* SearchTabHelper::GetOmniboxView() const { | 507 OmniboxView* SearchTabHelper::GetOmniboxView() const { |
508 return delegate_ ? delegate_->GetOmniboxView() : NULL; | 508 return delegate_ ? delegate_->GetOmniboxView() : NULL; |
509 } | 509 } |
OLD | NEW |