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

Unified Diff: chrome/browser/extensions/api/gcm/gcm_api.cc

Issue 179043005: [GCM] Remove the requirement for manifest key (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove cert Created 6 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 | « no previous file | chrome/browser/extensions/api/gcm/gcm_apitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/gcm/gcm_api.cc
diff --git a/chrome/browser/extensions/api/gcm/gcm_api.cc b/chrome/browser/extensions/api/gcm/gcm_api.cc
index ca57f8af9eff399d596e6390336646f32595c450..edefd56784696bdb186a1ff8c5938d97741fafd7 100644
--- a/chrome/browser/extensions/api/gcm/gcm_api.cc
+++ b/chrome/browser/extensions/api/gcm/gcm_api.cc
@@ -8,7 +8,6 @@
#include <map>
#include <vector>
-#include "base/sha1.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "chrome/browser/profiles/profile.h"
@@ -31,7 +30,6 @@ const char kGoogleRestrictedPrefix[] = "google";
const char kInvalidParameter[] =
"Function was called with invalid parameters.";
const char kNotSignedIn[] = "Profile was not signed in.";
-const char kCertificateMissing[] = "Manifest key was missing.";
const char kAsyncOperationPending[] =
"Asynchronous operation is pending.";
const char kNetworkError[] = "Network error occurred.";
@@ -39,11 +37,6 @@ const char kServerError[] = "Server error occurred.";
const char kTtlExceeded[] = "Time-to-live exceeded.";
const char kUnknownError[] = "Unknown error occurred.";
-std::string SHA1HashHexString(const std::string& str) {
- std::string hash = base::SHA1HashString(str);
- return base::HexEncode(hash.data(), hash.size());
-}
-
const char* GcmResultToError(gcm::GCMClient::Result result) {
switch (result) {
case gcm::GCMClient::SUCCESS:
@@ -52,8 +45,6 @@ const char* GcmResultToError(gcm::GCMClient::Result result) {
return kInvalidParameter;
case gcm::GCMClient::NOT_SIGNED_IN:
return kNotSignedIn;
- case gcm::GCMClient::CERTIFICATE_MISSING:
- return kCertificateMissing;
case gcm::GCMClient::ASYNC_OPERATION_PENDING:
return kAsyncOperationPending;
case gcm::GCMClient::NETWORK_ERROR:
@@ -121,16 +112,9 @@ bool GcmRegisterFunction::DoWork() {
api::gcm::Register::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
- if (GetExtension()->public_key().empty()) {
- CompleteFunctionWithResult(std::string(),
- gcm::GCMClient::CERTIFICATE_MISSING);
- return false;
- }
-
GCMProfileService()->Register(
GetExtension()->id(),
params->sender_ids,
- SHA1HashHexString(GetExtension()->public_key()),
base::Bind(&GcmRegisterFunction::CompleteFunctionWithResult, this));
return true;
« no previous file with comments | « no previous file | chrome/browser/extensions/api/gcm/gcm_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698