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

Unified Diff: remoting/client/plugin/pepper_token_fetcher.cc

Issue 12475020: Client plugin changes to support third party authentication. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Reviewer comments Created 7 years, 9 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
Index: remoting/client/plugin/pepper_token_fetcher.cc
diff --git a/remoting/client/plugin/pepper_token_fetcher.cc b/remoting/client/plugin/pepper_token_fetcher.cc
new file mode 100644
index 0000000000000000000000000000000000000000..1127230767bf15897217a670413621dbc5e0c5cd
--- /dev/null
+++ b/remoting/client/plugin/pepper_token_fetcher.cc
@@ -0,0 +1,40 @@
+// Copyright 2013 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.
+
+#include "remoting/client/plugin/pepper_token_fetcher.h"
+
+#include "remoting/client/plugin/chromoting_instance.h"
+
+namespace remoting {
+
+PepperTokenFetcher::PepperTokenFetcher(base::WeakPtr<ChromotingInstance> plugin,
+ const std::string& host_public_key)
+ : plugin_(plugin),
+ host_public_key_(host_public_key),
+ ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
+}
+
+PepperTokenFetcher::~PepperTokenFetcher() {
+}
+
+void PepperTokenFetcher::FetchThirdPartyToken(
+ const GURL& token_url,
+ const std::string& scope,
+ const TokenFetchedCallback& token_fetched_callback) {
+ if (plugin_) {
+ token_fetched_callback_ = token_fetched_callback;
+ plugin_->FetchThirdPartyToken(token_url, host_public_key_, scope,
+ weak_factory_.GetWeakPtr());
+ }
+}
+
+void PepperTokenFetcher::OnTokenFetched(
+ const std::string& token, const std::string& shared_secret) {
+ if (!token_fetched_callback_.is_null()) {
+ token_fetched_callback_.Run(token, shared_secret);
+ token_fetched_callback_.Reset();
+ }
+}
+
+} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698