| 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 "ios/chrome/browser/rlz/rlz_tracker_delegate_impl.h" | 5 #include "ios/chrome/browser/rlz/rlz_tracker_delegate_impl.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 "components/omnibox/browser/omnibox_event_global_tracker.h" | 9 #include "components/omnibox/browser/omnibox_event_global_tracker.h" |
| 10 #include "components/omnibox/browser/omnibox_log.h" | 10 #include "components/omnibox/browser/omnibox_log.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 } | 51 } |
| 52 | 52 |
| 53 void RLZTrackerDelegateImpl::Cleanup() { | 53 void RLZTrackerDelegateImpl::Cleanup() { |
| 54 on_omnibox_search_callback_.Reset(); | 54 on_omnibox_search_callback_.Reset(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 bool RLZTrackerDelegateImpl::IsOnUIThread() { | 57 bool RLZTrackerDelegateImpl::IsOnUIThread() { |
| 58 return web::WebThread::CurrentlyOn(web::WebThread::UI); | 58 return web::WebThread::CurrentlyOn(web::WebThread::UI); |
| 59 } | 59 } |
| 60 | 60 |
| 61 base::SequencedWorkerPool* RLZTrackerDelegateImpl::GetBlockingPool() { | |
| 62 return web::WebThread::GetBlockingPool(); | |
| 63 } | |
| 64 | |
| 65 net::URLRequestContextGetter* RLZTrackerDelegateImpl::GetRequestContext() { | 61 net::URLRequestContextGetter* RLZTrackerDelegateImpl::GetRequestContext() { |
| 66 return GetApplicationContext()->GetSystemURLRequestContext(); | 62 return GetApplicationContext()->GetSystemURLRequestContext(); |
| 67 } | 63 } |
| 68 | 64 |
| 69 bool RLZTrackerDelegateImpl::GetBrand(std::string* brand) { | 65 bool RLZTrackerDelegateImpl::GetBrand(std::string* brand) { |
| 70 return ios::google_brand::GetBrand(brand); | 66 return ios::google_brand::GetBrand(brand); |
| 71 } | 67 } |
| 72 | 68 |
| 73 bool RLZTrackerDelegateImpl::IsBrandOrganic(const std::string& brand) { | 69 bool RLZTrackerDelegateImpl::IsBrandOrganic(const std::string& brand) { |
| 74 return brand.empty() || ios::google_brand::IsOrganic(brand); | 70 return brand.empty() || ios::google_brand::IsOrganic(brand); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 return; | 121 return; |
| 126 | 122 |
| 127 on_omnibox_url_opened_subscription_.reset(); | 123 on_omnibox_url_opened_subscription_.reset(); |
| 128 | 124 |
| 129 using std::swap; | 125 using std::swap; |
| 130 base::Closure callback_to_run; | 126 base::Closure callback_to_run; |
| 131 swap(callback_to_run, on_omnibox_search_callback_); | 127 swap(callback_to_run, on_omnibox_search_callback_); |
| 132 if (!callback_to_run.is_null()) | 128 if (!callback_to_run.is_null()) |
| 133 callback_to_run.Run(); | 129 callback_to_run.Run(); |
| 134 } | 130 } |
| OLD | NEW |