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

Side by Side Diff: google_apis/google_api_keys.h

Issue 2786033002: Expose way to set google api key through CWVWebView class method. (Closed)
Patch Set: fix dependency Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | google_apis/google_api_keys.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef GOOGLE_APIS_GOOGLE_API_KEYS_H_ 5 #ifndef GOOGLE_APIS_GOOGLE_API_KEYS_H_
6 #define GOOGLE_APIS_GOOGLE_API_KEYS_H_ 6 #define GOOGLE_APIS_GOOGLE_API_KEYS_H_
7 7
8 // If you add more includes to this file, you also need to add them to 8 // If you add more includes to this file, you also need to add them to
9 // google_api_keys_unittest.cc. 9 // google_api_keys_unittest.cc.
10 #include <string> 10 #include <string>
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // 66 //
67 // Note that the key should be escaped for the context you use it in, 67 // Note that the key should be escaped for the context you use it in,
68 // e.g. URL-escaped if you use it in a URL. 68 // e.g. URL-escaped if you use it in a URL.
69 std::string GetAPIKey(); 69 std::string GetAPIKey();
70 70
71 // Non-stable channels may have a different Google API key. 71 // Non-stable channels may have a different Google API key.
72 std::string GetNonStableAPIKey(); 72 std::string GetNonStableAPIKey();
73 73
74 std::string GetRemotingAPIKey(); 74 std::string GetRemotingAPIKey();
75 75
76 #if defined(OS_IOS)
77 // Sets the API key. This should be called as early as possible before this
78 // API key is even accessed.
79 void SetAPIKey(const std::string& api_key);
80 #endif
81
76 // Represents the different sets of client IDs and secrets in use. 82 // Represents the different sets of client IDs and secrets in use.
77 enum OAuth2Client { 83 enum OAuth2Client {
78 CLIENT_MAIN, // Several different features use this. 84 CLIENT_MAIN, // Several different features use this.
79 CLIENT_CLOUD_PRINT, 85 CLIENT_CLOUD_PRINT,
80 CLIENT_REMOTING, 86 CLIENT_REMOTING,
81 CLIENT_REMOTING_HOST, 87 CLIENT_REMOTING_HOST,
82 88
83 CLIENT_NUM_ITEMS // Must be last item. 89 CLIENT_NUM_ITEMS // Must be last item.
84 }; 90 };
85 91
86 // Retrieves the OAuth2 client ID for the specified client, or the 92 // Retrieves the OAuth2 client ID for the specified client, or the
87 // empty string if not set. 93 // empty string if not set.
88 // 94 //
89 // Note that the ID should be escaped for the context you use it in, 95 // Note that the ID should be escaped for the context you use it in,
90 // e.g. URL-escaped if you use it in a URL. 96 // e.g. URL-escaped if you use it in a URL.
91 std::string GetOAuth2ClientID(OAuth2Client client); 97 std::string GetOAuth2ClientID(OAuth2Client client);
92 98
93 // Retrieves the OAuth2 client secret for the specified client, or the 99 // Retrieves the OAuth2 client secret for the specified client, or the
94 // empty string if not set. 100 // empty string if not set.
95 // 101 //
96 // Note that the secret should be escaped for the context you use it 102 // Note that the secret should be escaped for the context you use it
97 // in, e.g. URL-escaped if you use it in a URL. 103 // in, e.g. URL-escaped if you use it in a URL.
98 std::string GetOAuth2ClientSecret(OAuth2Client client); 104 std::string GetOAuth2ClientSecret(OAuth2Client client);
99 105
106 #if defined(OS_IOS)
107 // Sets the client id for the specified client. Should be called as early as
108 // possible before these ids are accessed.
109 void SetOAuth2ClientID(OAuth2Client client, const std::string& client_id);
110
111 // Sets the client secret for the specified client. Should be called as early as
112 // possible before these secrets are accessed.
113 void SetOAuth2ClientSecret(OAuth2Client client,
114 const std::string& client_secret);
115 #endif
100 // Returns the auth token for the data reduction proxy. 116 // Returns the auth token for the data reduction proxy.
101 std::string GetSpdyProxyAuthValue(); 117 std::string GetSpdyProxyAuthValue();
102 118
103 // Returns if the API key using in the current build is the one for official 119 // Returns if the API key using in the current build is the one for official
104 // Google Chrome. 120 // Google Chrome.
105 bool IsGoogleChromeAPIKeyUsed(); 121 bool IsGoogleChromeAPIKeyUsed();
106 122
107 } // namespace google_apis 123 } // namespace google_apis
108 124
109 #endif // GOOGLE_APIS_GOOGLE_API_KEYS_H_ 125 #endif // GOOGLE_APIS_GOOGLE_API_KEYS_H_
OLDNEW
« no previous file with comments | « no previous file | google_apis/google_api_keys.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698