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

Unified Diff: ios/chrome/browser/ui/commands/open_url_command.mm

Issue 942793002: [iOS] Upstream chrome commands (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/chrome/browser/ui/commands/open_url_command.h ('k') | ios/chrome/browser/ui/url_loader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/commands/open_url_command.mm
diff --git a/ios/chrome/browser/ui/commands/open_url_command.mm b/ios/chrome/browser/ui/commands/open_url_command.mm
new file mode 100644
index 0000000000000000000000000000000000000000..a52a40484d6bb171a2c408e455b3b93d41fadc65
--- /dev/null
+++ b/ios/chrome/browser/ui/commands/open_url_command.mm
@@ -0,0 +1,76 @@
+// Copyright 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "ios/chrome/browser/ui/commands/open_url_command.h"
+
+#include "base/mac/scoped_nsobject.h"
+#include "ios/web/public/referrer.h"
+#include "url/gurl.h"
+
+@implementation OpenUrlCommand {
+ GURL _url;
+ web::Referrer _referrer;
+ base::scoped_nsobject<NSString> _windowName;
+ BOOL _inIncognito;
+ BOOL _inBackground;
+ BOOL _fromChrome;
+ OpenPosition _appendTo;
+}
+
+@synthesize fromChrome = _fromChrome;
+
+- (id)initWithURL:(const GURL&)url
+ referrer:(const web::Referrer&)referrer
+ windowName:(NSString*)windowName
+ inIncognito:(BOOL)inIncognito
+ inBackground:(BOOL)inBackground
+ appendTo:(OpenPosition)appendTo {
+ if ((self = [super init])) {
+ _url = url;
+ _referrer = referrer;
+ _windowName.reset([windowName retain]);
+ _inIncognito = inIncognito;
+ _inBackground = inBackground;
+ _appendTo = appendTo;
+ }
+ return self;
+}
+
+- (id)initWithURLFromChrome:(const GURL&)url {
+ if ((self = [self initWithURL:url
+ referrer:web::Referrer()
+ windowName:nil
+ inIncognito:NO
+ inBackground:NO
+ appendTo:kLastTab])) {
+ _fromChrome = YES;
+ }
+ return self;
+}
+
+- (const GURL&)url {
+ return _url;
+}
+
+- (const web::Referrer&)referrer {
+ return _referrer;
+}
+
+- (NSString*)windowName {
+ return _windowName.get();
+}
+
+- (BOOL)inIncognito {
+ return _inIncognito;
+}
+
+- (BOOL)inBackground {
+ return _inBackground;
+}
+
+- (OpenPosition)appendTo {
+ return _appendTo;
+}
+
+@end
« no previous file with comments | « ios/chrome/browser/ui/commands/open_url_command.h ('k') | ios/chrome/browser/ui/url_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698