Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(696)

Side by Side Diff: ios/chrome/browser/ios_chrome_main_parts.mm

Issue 2317183002: Start the Physical Web scanner on Chrome start (Closed)
Patch Set: swap conditional Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "ios/chrome/browser/ios_chrome_main_parts.h" 5 #include "ios/chrome/browser/ios_chrome_main_parts.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/feature_list.h" 8 #include "base/feature_list.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 21 matching lines...) Expand all
32 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" 32 #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
33 #include "ios/chrome/browser/browser_state/chrome_browser_state_manager.h" 33 #include "ios/chrome/browser/browser_state/chrome_browser_state_manager.h"
34 #include "ios/chrome/browser/chrome_paths.h" 34 #include "ios/chrome/browser/chrome_paths.h"
35 #include "ios/chrome/browser/chrome_switches.h" 35 #include "ios/chrome/browser/chrome_switches.h"
36 #include "ios/chrome/browser/chrome_url_constants.h" 36 #include "ios/chrome/browser/chrome_url_constants.h"
37 #import "ios/chrome/browser/first_run/first_run.h" 37 #import "ios/chrome/browser/first_run/first_run.h"
38 #include "ios/chrome/browser/install_time_util.h" 38 #include "ios/chrome/browser/install_time_util.h"
39 #include "ios/chrome/browser/ios_chrome_field_trials.h" 39 #include "ios/chrome/browser/ios_chrome_field_trials.h"
40 #include "ios/chrome/browser/metrics/field_trial_synchronizer.h" 40 #include "ios/chrome/browser/metrics/field_trial_synchronizer.h"
41 #include "ios/chrome/browser/open_from_clipboard/create_clipboard_recent_content .h" 41 #include "ios/chrome/browser/open_from_clipboard/create_clipboard_recent_content .h"
42 #include "ios/chrome/browser/physical_web/start_physical_web_discovery.h"
42 #include "ios/chrome/browser/pref_names.h" 43 #include "ios/chrome/browser/pref_names.h"
43 #include "ios/chrome/browser/translate/translate_service_ios.h" 44 #include "ios/chrome/browser/translate/translate_service_ios.h"
44 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" 45 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h"
45 #include "ios/web/public/web_thread.h" 46 #include "ios/web/public/web_thread.h"
46 #include "net/base/network_change_notifier.h" 47 #include "net/base/network_change_notifier.h"
47 #include "net/http/http_network_layer.h" 48 #include "net/http/http_network_layer.h"
48 #include "net/http/http_stream_factory.h" 49 #include "net/http/http_stream_factory.h"
49 #include "net/url_request/url_request.h" 50 #include "net/url_request/url_request.h"
50 #include "ui/base/l10n/l10n_util_mac.h" 51 #include "ui/base/l10n/l10n_util_mac.h"
51 #include "ui/base/resource/resource_bundle.h" 52 #include "ui/base/resource/resource_bundle.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 variations::VariationsService* variations_service = 171 variations::VariationsService* variations_service =
171 application_context_->GetVariationsService(); 172 application_context_->GetVariationsService();
172 if (variations_service) { 173 if (variations_service) {
173 variations_service->set_policy_pref_service( 174 variations_service->set_policy_pref_service(
174 last_used_browser_state->GetPrefs()); 175 last_used_browser_state->GetPrefs());
175 variations_service->StartRepeatedVariationsSeedFetch(); 176 variations_service->StartRepeatedVariationsSeedFetch();
176 } 177 }
177 178
178 translate::TranslateDownloadManager::RequestLanguageList( 179 translate::TranslateDownloadManager::RequestLanguageList(
179 last_used_browser_state->GetPrefs()); 180 last_used_browser_state->GetPrefs());
181
182 StartPhysicalWebDiscovery(last_used_browser_state->GetPrefs());
180 } 183 }
181 184
182 void IOSChromeMainParts::PostMainMessageLoopRun() { 185 void IOSChromeMainParts::PostMainMessageLoopRun() {
183 TranslateServiceIOS::Shutdown(); 186 TranslateServiceIOS::Shutdown();
184 application_context_->StartTearDown(); 187 application_context_->StartTearDown();
185 } 188 }
186 189
187 void IOSChromeMainParts::PostDestroyThreads() { 190 void IOSChromeMainParts::PostDestroyThreads() {
188 application_context_->PostDestroyThreads(); 191 application_context_->PostDestroyThreads();
189 } 192 }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 259
257 void IOSChromeMainParts::StartMetricsRecording() { 260 void IOSChromeMainParts::StartMetricsRecording() {
258 bool wifiOnly = local_state_->GetBoolean(prefs::kMetricsReportingWifiOnly); 261 bool wifiOnly = local_state_->GetBoolean(prefs::kMetricsReportingWifiOnly);
259 bool isConnectionCellular = net::NetworkChangeNotifier::IsConnectionCellular( 262 bool isConnectionCellular = net::NetworkChangeNotifier::IsConnectionCellular(
260 net::NetworkChangeNotifier::GetConnectionType()); 263 net::NetworkChangeNotifier::GetConnectionType());
261 bool mayUpload = !wifiOnly || !isConnectionCellular; 264 bool mayUpload = !wifiOnly || !isConnectionCellular;
262 265
263 application_context_->GetMetricsServicesManager()->UpdateUploadPermissions( 266 application_context_->GetMetricsServicesManager()->UpdateUploadPermissions(
264 mayUpload); 267 mayUpload);
265 } 268 }
OLDNEW
« no previous file with comments | « ios/chrome/browser/BUILD.gn ('k') | ios/chrome/browser/physical_web/start_physical_web_discovery.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698