| 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 #import "ios/chrome/common/physical_web/physical_web_scanner.h" | 5 #import "ios/chrome/common/physical_web/physical_web_scanner.h" |
| 6 | 6 |
| 7 #import <CoreBluetooth/CoreBluetooth.h> | 7 #import <CoreBluetooth/CoreBluetooth.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 for (PhysicalWebDevice* device in [self devices]) { | 184 for (PhysicalWebDevice* device in [self devices]) { |
| 185 std::string scannedUrl = | 185 std::string scannedUrl = |
| 186 base::SysNSStringToUTF8([[device requestURL] absoluteString]); | 186 base::SysNSStringToUTF8([[device requestURL] absoluteString]); |
| 187 std::string resolvedUrl = | 187 std::string resolvedUrl = |
| 188 base::SysNSStringToUTF8([[device url] absoluteString]); | 188 base::SysNSStringToUTF8([[device url] absoluteString]); |
| 189 std::string icon = base::SysNSStringToUTF8([[device icon] absoluteString]); | 189 std::string icon = base::SysNSStringToUTF8([[device icon] absoluteString]); |
| 190 std::string title = base::SysNSStringToUTF8([device title]); | 190 std::string title = base::SysNSStringToUTF8([device title]); |
| 191 std::string description = base::SysNSStringToUTF8([device description]); | 191 std::string description = base::SysNSStringToUTF8([device description]); |
| 192 | 192 |
| 193 auto metadataItem = base::MakeUnique<base::DictionaryValue>(); | 193 auto metadataItem = base::MakeUnique<base::DictionaryValue>(); |
| 194 metadataItem->SetString(kPhysicalWebScannedUrlKey, scannedUrl); | 194 metadataItem->SetString(physical_web::kScannedUrlKey, scannedUrl); |
| 195 metadataItem->SetString(kPhysicalWebResolvedUrlKey, resolvedUrl); | 195 metadataItem->SetString(physical_web::kResolvedUrlKey, resolvedUrl); |
| 196 metadataItem->SetString(kPhysicalWebIconUrlKey, icon); | 196 metadataItem->SetString(physical_web::kIconUrlKey, icon); |
| 197 metadataItem->SetString(kPhysicalWebTitleKey, title); | 197 metadataItem->SetString(physical_web::kTitleKey, title); |
| 198 metadataItem->SetString(kPhysicalWebDescriptionKey, description); | 198 metadataItem->SetString(physical_web::kDescriptionKey, description); |
| 199 metadataList->Append(std::move(metadataItem)); | 199 metadataList->Append(std::move(metadataItem)); |
| 200 } | 200 } |
| 201 | 201 |
| 202 return metadataList; | 202 return metadataList; |
| 203 } | 203 } |
| 204 | 204 |
| 205 - (void)setNetworkRequestEnabled:(BOOL)enabled { | 205 - (void)setNetworkRequestEnabled:(BOOL)enabled { |
| 206 if (networkRequestEnabled_ == enabled) { | 206 if (networkRequestEnabled_ == enabled) { |
| 207 return; | 207 return; |
| 208 } | 208 } |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 [strongSelf.get()->devices_ addObject:device]; | 485 [strongSelf.get()->devices_ addObject:device]; |
| 486 [strongSelf.get()->delegate_ scannerUpdatedDevices:weakSelf]; | 486 [strongSelf.get()->delegate_ scannerUpdatedDevices:weakSelf]; |
| 487 [strongSelf.get()->finalUrls_ addObject:[device url]]; | 487 [strongSelf.get()->finalUrls_ addObject:[device url]]; |
| 488 } | 488 } |
| 489 } | 489 } |
| 490 [strongSelf.get()->pendingRequests_ removeObject:strongRequest]; | 490 [strongSelf.get()->pendingRequests_ removeObject:strongRequest]; |
| 491 }]; | 491 }]; |
| 492 } | 492 } |
| 493 | 493 |
| 494 @end | 494 @end |
| OLD | NEW |