Index: third_party/grpc/examples/objective-c/auth_sample/Misc/AppDelegate.m |
diff --git a/third_party/WebKit/Source/web/WebElementCollection.cpp b/third_party/grpc/examples/objective-c/auth_sample/Misc/AppDelegate.m |
similarity index 59% |
copy from third_party/WebKit/Source/web/WebElementCollection.cpp |
copy to third_party/grpc/examples/objective-c/auth_sample/Misc/AppDelegate.m |
index 64b1b036187c88eb856ab842334138a83bd46be7..798d342938b7c8a503f864c9fb093d5eeb2ea6f3 100644 |
--- a/third_party/WebKit/Source/web/WebElementCollection.cpp |
+++ b/third_party/grpc/examples/objective-c/auth_sample/Misc/AppDelegate.m |
@@ -1,6 +1,7 @@ |
/* |
- * Copyright (C) 2009 Google Inc. All rights reserved. |
- * Copyright (C) 2014 Samsung Electronics. All rights reserved. |
+ * |
+ * Copyright 2015, Google Inc. |
+ * All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are |
@@ -27,55 +28,34 @@ |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
+ * |
*/ |
-#include "public/web/WebElementCollection.h" |
- |
-#include "core/dom/Element.h" |
-#include "core/html/HTMLCollection.h" |
-#include "public/web/WebElement.h" |
-#include "wtf/PassRefPtr.h" |
+#import "AppDelegate.h" |
-namespace blink { |
+#import <Google/SignIn.h> |
-void WebElementCollection::reset() |
-{ |
- m_private.reset(); |
-} |
- |
-void WebElementCollection::assign(const WebElementCollection& other) |
-{ |
- m_private = other.m_private; |
-} |
+@implementation AppDelegate |
-WebElementCollection::WebElementCollection(HTMLCollection*col) |
- : m_private(col) |
-{ |
-} |
- |
-WebElementCollection& WebElementCollection::operator=(HTMLCollection*col) |
-{ |
- m_private = col; |
- return *this; |
-} |
- |
-unsigned WebElementCollection::length() const |
-{ |
- return m_private->length(); |
-} |
+// As instructed in https://developers.google.com/identity/sign-in/ios/sign-in |
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { |
+ NSError* configureError; |
+ [GGLContext.sharedInstance configureWithError: &configureError]; |
+ NSAssert(!configureError, @"Error configuring Google services: %@", configureError); |
-WebElement WebElementCollection::nextItem() const |
-{ |
- Element* element = m_private->item(m_current); |
- if (element) |
- m_current++; |
- return WebElement(element); |
+ return YES; |
} |
-WebElement WebElementCollection::firstItem() const |
-{ |
- m_current = 0; |
- return nextItem(); |
+// As instructed in https://developers.google.com/identity/sign-in/ios/sign-in |
+- (BOOL)application:(UIApplication *)application |
+ openURL:(NSURL *)url |
+ sourceApplication:(NSString *)sourceApplication |
+ annotation:(id)annotation { |
+ // This will properly handle the URL that the application receives at the end of the |
+ // authentication process. |
+ return [GIDSignIn.sharedInstance handleURL:url |
+ sourceApplication:sourceApplication |
+ annotation:annotation]; |
} |
-} // namespace blink |
+@end |