Skip to content

Commit

Permalink
Revert index spotlight xcallbacks in Chrome
Browse files Browse the repository at this point in the history
The bug was fixed in iOS 11.
This reverts most part of
https://chromium-review.googlesource.com/c/chromium/src/+/608227

[email protected]

(cherry picked from commit fb15ca6)

Bug: 762869
Change-Id: I364b03deda2c8e56023bbd25a128d3bcb5ca7903
Reviewed-on: https://chromium-review.googlesource.com/655237
Reviewed-by: Justin Cohen <[email protected]>
Reviewed-by: Elodie Banel <[email protected]>
Commit-Queue: Olivier Robin <[email protected]>
Cr-Original-Commit-Position: refs/heads/master@{#500585}
Reviewed-on: https://chromium-review.googlesource.com/668537
Reviewed-by: Olivier Robin <[email protected]>
Cr-Commit-Position: refs/branch-heads/3202@{crosswalk-project#248}
Cr-Branched-From: fa6a5d8-refs/heads/master@{#499098}
  • Loading branch information
Olivier Robin committed Sep 15, 2017
1 parent a2a8b44 commit 65e8108
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
1 change: 0 additions & 1 deletion ios/chrome/app/spotlight/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ source_set("spotlight") {
"//ios/chrome/browser/suggestions",
"//ios/chrome/browser/sync",
"//ios/chrome/browser/ui/ntp:ntp_internal",
"//ios/chrome/common",
"//ios/chrome/common/app_group",
"//ios/public/provider/chrome/browser",
"//ios/public/provider/chrome/browser/spotlight",
Expand Down
17 changes: 1 addition & 16 deletions ios/chrome/app/spotlight/base_spotlight_manager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@
#import <MobileCoreServices/MobileCoreServices.h>

#include "base/mac/bind_objc_block.h"
#include "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/task/cancelable_task_tracker.h"
#include "components/favicon/core/fallback_url_util.h"
#include "components/favicon/core/large_icon_service.h"
#include "components/favicon_base/fallback_icon_style.h"
#include "components/favicon_base/favicon_types.h"
#include "ios/chrome/common/x_callback_url.h"
#include "ios/chrome/grit/ios_strings.h"
#include "ios/public/provider/chrome/browser/chrome_browser_provider.h"
#include "ios/public/provider/chrome/browser/spotlight/spotlight_provider.h"
Expand Down Expand Up @@ -150,20 +148,7 @@ - (NSArray*)spotlightItemsWithURL:(const GURL&)indexedURL
favicon:(UIImage*)favicon
defaultTitle:(NSString*)defaultTitle {
DCHECK(defaultTitle);

GURL urlToOpen = indexedURL;
NSString* scheme = base::mac::ObjCCast<NSString>([[NSBundle mainBundle]
objectForInfoDictionaryKey:@"KSChannelChromeScheme"]);

if (scheme) {
std::map<std::string, std::string> parameters;
parameters["url"] = urlToOpen.spec();
urlToOpen = CreateXCallbackURLWithParameters(
base::SysNSStringToUTF8(scheme), "open", GURL::EmptyGURL(),
GURL::EmptyGURL(), GURL::EmptyGURL(), parameters);
}

NSURL* nsURL = net::NSURLWithGURL(urlToOpen);
NSURL* nsURL = net::NSURLWithGURL(indexedURL);
std::string description = indexedURL.SchemeIsCryptographic()
? indexedURL.GetOrigin().spec()
: indexedURL.spec();
Expand Down

0 comments on commit 65e8108

Please sign in to comment.