| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/search_engines/desktop_search_utils.h" | 5 #include "components/search_engines/desktop_search_utils.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| 11 #include "base/metrics/user_metrics.h" | 11 #include "base/metrics/user_metrics.h" |
| 12 #include "base/prefs/pref_service.h" | |
| 13 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
| 14 #include "components/pref_registry/pref_registry_syncable.h" | 13 #include "components/pref_registry/pref_registry_syncable.h" |
| 14 #include "components/prefs/pref_service.h" |
| 15 #include "components/search_engines/prepopulated_engines.h" | 15 #include "components/search_engines/prepopulated_engines.h" |
| 16 #include "components/search_engines/template_url_prepopulate_data.h" | 16 #include "components/search_engines/template_url_prepopulate_data.h" |
| 17 #include "components/search_engines/template_url_service.h" | 17 #include "components/search_engines/template_url_service.h" |
| 18 #include "components/search_engines/util.h" | 18 #include "components/search_engines/util.h" |
| 19 #include "net/base/url_util.h" | 19 #include "net/base/url_util.h" |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 // Values for the Search.DesktopSearch.URLAction histogram. | 23 // Values for the Search.DesktopSearch.URLAction histogram. |
| 24 enum DesktopSearchURLAction { | 24 enum DesktopSearchURLAction { |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 DESKTOP_SEARCH_URL_ACTION_NO_REDIRECTION_INVALID_SEARCH_ENGINE); | 129 DESKTOP_SEARCH_URL_ACTION_NO_REDIRECTION_INVALID_SEARCH_ENGINE); |
| 130 return false; | 130 return false; |
| 131 } | 131 } |
| 132 | 132 |
| 133 RecordDesktopSearchURLAction(DESKTOP_SEARCH_URL_ACTION_REDIRECTION); | 133 RecordDesktopSearchURLAction(DESKTOP_SEARCH_URL_ACTION_REDIRECTION); |
| 134 | 134 |
| 135 url->Swap(&search_url); | 135 url->Swap(&search_url); |
| 136 return !pref_service->GetBoolean( | 136 return !pref_service->GetBoolean( |
| 137 prefs::kDesktopSearchRedirectionInfobarShownPref); | 137 prefs::kDesktopSearchRedirectionInfobarShownPref); |
| 138 } | 138 } |
| OLD | NEW |