OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/rlz/chrome_rlz_tracker_delegate.h" | 5 #include "chrome/browser/rlz/chrome_rlz_tracker_delegate.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "content/public/browser/notification_details.h" | 29 #include "content/public/browser/notification_details.h" |
30 #include "content/public/browser/notification_service.h" | 30 #include "content/public/browser/notification_service.h" |
31 #include "content/public/browser/notification_source.h" | 31 #include "content/public/browser/notification_source.h" |
32 #include "content/public/common/content_switches.h" | 32 #include "content/public/common/content_switches.h" |
33 #include "rlz/features/features.h" | 33 #include "rlz/features/features.h" |
34 | 34 |
35 #if defined(OS_WIN) | 35 #if defined(OS_WIN) |
36 #include "chrome/installer/util/google_update_settings.h" | 36 #include "chrome/installer/util/google_update_settings.h" |
37 #endif | 37 #endif |
38 | 38 |
39 ChromeRLZTrackerDelegate::ChromeRLZTrackerDelegate() { | 39 ChromeRLZTrackerDelegate::ChromeRLZTrackerDelegate() {} |
40 } | |
41 | 40 |
42 ChromeRLZTrackerDelegate::~ChromeRLZTrackerDelegate() { | 41 ChromeRLZTrackerDelegate::~ChromeRLZTrackerDelegate() {} |
43 } | |
44 | 42 |
45 // static | 43 // static |
46 void ChromeRLZTrackerDelegate::RegisterProfilePrefs( | 44 void ChromeRLZTrackerDelegate::RegisterProfilePrefs( |
47 user_prefs::PrefRegistrySyncable* registry) { | 45 user_prefs::PrefRegistrySyncable* registry) { |
48 #if BUILDFLAG(ENABLE_RLZ) | 46 #if BUILDFLAG(ENABLE_RLZ) |
49 registry->RegisterIntegerPref(prefs::kRlzPingDelaySeconds, 90); | 47 registry->RegisterIntegerPref(prefs::kRlzPingDelaySeconds, 90); |
50 #endif | 48 #endif |
51 } | 49 } |
52 | 50 |
53 // static | 51 // static |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 void ChromeRLZTrackerDelegate::Cleanup() { | 87 void ChromeRLZTrackerDelegate::Cleanup() { |
90 registrar_.RemoveAll(); | 88 registrar_.RemoveAll(); |
91 on_omnibox_search_callback_.Reset(); | 89 on_omnibox_search_callback_.Reset(); |
92 on_homepage_search_callback_.Reset(); | 90 on_homepage_search_callback_.Reset(); |
93 } | 91 } |
94 | 92 |
95 bool ChromeRLZTrackerDelegate::IsOnUIThread() { | 93 bool ChromeRLZTrackerDelegate::IsOnUIThread() { |
96 return content::BrowserThread::CurrentlyOn(content::BrowserThread::UI); | 94 return content::BrowserThread::CurrentlyOn(content::BrowserThread::UI); |
97 } | 95 } |
98 | 96 |
99 base::SequencedWorkerPool* ChromeRLZTrackerDelegate::GetBlockingPool() { | |
100 return content::BrowserThread::GetBlockingPool(); | |
101 } | |
102 | |
103 net::URLRequestContextGetter* ChromeRLZTrackerDelegate::GetRequestContext() { | 97 net::URLRequestContextGetter* ChromeRLZTrackerDelegate::GetRequestContext() { |
104 return g_browser_process->system_request_context(); | 98 return g_browser_process->system_request_context(); |
105 } | 99 } |
106 | 100 |
107 bool ChromeRLZTrackerDelegate::GetBrand(std::string* brand) { | 101 bool ChromeRLZTrackerDelegate::GetBrand(std::string* brand) { |
108 return google_brand::GetBrand(brand); | 102 return google_brand::GetBrand(brand); |
109 } | 103 } |
110 | 104 |
111 bool ChromeRLZTrackerDelegate::IsBrandOrganic(const std::string& brand) { | 105 bool ChromeRLZTrackerDelegate::IsBrandOrganic(const std::string& brand) { |
112 return brand.empty() || google_brand::IsOrganic(brand); | 106 return brand.empty() || google_brand::IsOrganic(brand); |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 // to remain as unaffected as possible by this change. This test is | 230 // to remain as unaffected as possible by this change. This test is |
237 // there to keep the old behavior. | 231 // there to keep the old behavior. |
238 if (!log->is_popup_open) | 232 if (!log->is_popup_open) |
239 return; | 233 return; |
240 | 234 |
241 omnibox_url_opened_subscription_.reset(); | 235 omnibox_url_opened_subscription_.reset(); |
242 base::Closure omnibox_callback; | 236 base::Closure omnibox_callback; |
243 swap(omnibox_callback, on_omnibox_search_callback_); | 237 swap(omnibox_callback, on_omnibox_search_callback_); |
244 omnibox_callback.Run(); | 238 omnibox_callback.Run(); |
245 } | 239 } |
OLD | NEW |