Index: ios/web_view/internal/cwv_web_view.mm |
diff --git a/ios/web_view/internal/cwv_web_view.mm b/ios/web_view/internal/cwv_web_view.mm |
index 08fb4d8dc30b2994005f51fbd5799b2b1efbc42c..a464f749856ea5d9ecd75921b8d63bdda3118d5e 100644 |
--- a/ios/web_view/internal/cwv_web_view.mm |
+++ b/ios/web_view/internal/cwv_web_view.mm |
@@ -10,6 +10,7 @@ |
#import "base/ios/weak_nsobject.h" |
#include "base/memory/ptr_util.h" |
#include "base/strings/sys_string_conversions.h" |
+#include "google_apis/google_api_keys.h" |
#import "ios/web/public/navigation_manager.h" |
#include "ios/web/public/referrer.h" |
#include "ios/web/public/reload_type.h" |
@@ -60,6 +61,21 @@ |
@synthesize estimatedProgress = _estimatedProgress; |
@synthesize UIDelegate = _UIDelegate; |
++ (void)setGoogleAPIKey:(NSString*)googleAPIKey |
+ clientID:(NSString*)clientID |
+ clientSecret:(NSString*)clientSecret { |
+ google_apis::SetAPIKey(base::SysNSStringToUTF8(googleAPIKey)); |
+ |
+ std::string client_id = base::SysNSStringToUTF8(clientID); |
Eugene But (OOO till 7-30)
2017/04/13 15:06:25
client_id Style is used for C++ code, Objective-C
jzw1
2017/04/14 02:10:32
Any suggestions for what I should call it since cl
Eugene But (OOO till 7-30)
2017/04/14 14:24:48
Maybe clientIDNSString? But clientIDString looks f
|
+ std::string client_secret = base::SysNSStringToUTF8(clientSecret); |
+ for (size_t i = 0; i < google_apis::CLIENT_NUM_ITEMS; ++i) { |
+ google_apis::OAuth2Client client = |
+ static_cast<google_apis::OAuth2Client>(i); |
+ google_apis::SetClientID(client_id, client); |
+ google_apis::SetClientSecret(client_secret, client); |
+ } |
Roger Tawa OOO till Jul 10th
2017/04/13 17:42:43
Does this need to loop? In what cases will the io
michaeldo
2017/04/13 19:28:09
I also think this loop is odd here. (If we do need
jzw1
2017/04/14 02:10:32
Currently there's a piece of translate code:
https
|
+} |
+ |
- (instancetype)initWithFrame:(CGRect)frame |
configuration:(CWVWebViewConfiguration*)configuration { |
self = [super initWithFrame:frame]; |