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

Side by Side Diff: ios/chrome/browser/physical_web/start_physical_web_discovery.mm

Issue 2566753002: Modify StartPhysicalWebDiscovery to take an ios::ChromeBrowserState param (Closed)
Patch Set: fix deps Created 4 years 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
« no previous file with comments | « ios/chrome/browser/physical_web/start_physical_web_discovery.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/physical_web/start_physical_web_discovery.h" 5 #include "ios/chrome/browser/physical_web/start_physical_web_discovery.h"
6 6
7 #import <CoreLocation/CoreLocation.h> 7 #import <CoreLocation/CoreLocation.h>
8 8
9 #include "components/physical_web/data_source/physical_web_data_source.h" 9 #include "components/physical_web/data_source/physical_web_data_source.h"
10 #include "ios/chrome/browser/application_context.h" 10 #include "ios/chrome/browser/application_context.h"
11 #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
11 #import "ios/chrome/browser/experimental_flags.h" 12 #import "ios/chrome/browser/experimental_flags.h"
12 #import "ios/chrome/browser/geolocation/omnibox_geolocation_config.h" 13 #import "ios/chrome/browser/geolocation/omnibox_geolocation_config.h"
13 #include "ios/chrome/browser/physical_web/physical_web_constants.h" 14 #include "ios/chrome/browser/physical_web/physical_web_constants.h"
14 #include "ios/chrome/browser/pref_names.h" 15 #include "ios/chrome/browser/pref_names.h"
15 #include "url/gurl.h" 16 #include "url/gurl.h"
16 17
17 void StartPhysicalWebDiscovery(PrefService* pref_service, bool is_incognito) { 18 void StartPhysicalWebDiscovery(PrefService* pref_service, bool is_incognito) {
18 // Do not scan if the Physical Web feature is disabled by a command line flag 19 // Do not scan if the Physical Web feature is disabled by a command line flag
19 // or Chrome Variations experiment. 20 // or Chrome Variations experiment.
20 if (!experimental_flags::IsPhysicalWebEnabled()) { 21 if (!experimental_flags::IsPhysicalWebEnabled()) {
(...skipping 30 matching lines...) Expand all
51 } 52 }
52 } 53 }
53 54
54 // Scan only if the feature is enabled. 55 // Scan only if the feature is enabled.
55 if (preference_state == physical_web::kPhysicalWebOn) { 56 if (preference_state == physical_web::kPhysicalWebOn) {
56 GetApplicationContext()->GetPhysicalWebDataSource()->StartDiscovery(true); 57 GetApplicationContext()->GetPhysicalWebDataSource()->StartDiscovery(true);
57 } else { 58 } else {
58 GetApplicationContext()->GetPhysicalWebDataSource()->StopDiscovery(); 59 GetApplicationContext()->GetPhysicalWebDataSource()->StopDiscovery();
59 } 60 }
60 } 61 }
62
63 void StartPhysicalWebDiscovery(PrefService* pref_service,
64 ios::ChromeBrowserState* browser_state) {
65 StartPhysicalWebDiscovery(pref_service, browser_state->IsOffTheRecord());
66 }
OLDNEW
« no previous file with comments | « ios/chrome/browser/physical_web/start_physical_web_discovery.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698