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

Side by Side Diff: ios/chrome/browser/ui/settings/settings_utils.mm

Issue 2587023002: Upstream Chrome on iOS source code [8/11]. (Closed)
Patch Set: 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
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import "ios/chrome/browser/ui/settings/settings_utils.h"
6
7 #include "base/ios/weak_nsobject.h"
8 #include "base/mac/scoped_nsobject.h"
9 #import "ios/chrome/browser/ui/commands/UIKit+ChromeExecuteCommand.h"
10 #import "ios/chrome/browser/ui/commands/generic_chrome_command.h"
11 #include "ios/chrome/browser/ui/commands/ios_command_ids.h"
12 #import "ios/chrome/browser/ui/commands/open_url_command.h"
13
14 namespace ios_internal_settings {
15
16 ProceduralBlockWithURL BlockToOpenURL(UIResponder* responder) {
17 base::WeakNSObject<UIResponder> weakResponder(responder);
18 ProceduralBlockWithURL blockToOpenURL = ^(const GURL& url) {
19 base::scoped_nsobject<UIResponder> strongResponder([weakResponder retain]);
20 if (!strongResponder)
21 return;
22 base::scoped_nsobject<OpenUrlCommand> command(
23 [[OpenUrlCommand alloc] initWithURLFromChrome:url]);
24 [command setTag:IDC_CLOSE_SETTINGS_AND_OPEN_URL];
25 [strongResponder chromeExecuteCommand:command];
26 };
27 return [[blockToOpenURL copy] autorelease];
28 }
29
30 } // namespace ios_internal_settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698