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

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

Issue 12518027: Protocol / client plugin changes to support interactively asking for a PIN (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 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_pin_fetcher.cc
diff --git a/remoting/client/plugin/pepper_pin_fetcher.cc b/remoting/client/plugin/pepper_pin_fetcher.cc
new file mode 100644
index 0000000000000000000000000000000000000000..42d49db85aade4a202b9afa5cea2f7a62a7494dc
--- /dev/null
+++ b/remoting/client/plugin/pepper_pin_fetcher.cc
@@ -0,0 +1,34 @@
+// 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_pin_fetcher.h"
+
+#include "remoting/client/plugin/chromoting_instance.h"
+
+namespace remoting {
+
+PepperPinFetcher::PepperPinFetcher(base::WeakPtr<ChromotingInstance> parent)
+ : parent_(parent),
+ ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
+}
+
+PepperPinFetcher::~PepperPinFetcher() {
+}
+
+void PepperPinFetcher::FetchPin(
+ const PinFetchedCallback& pin_fetched_callback) {
+ if (parent_) {
+ pin_fetched_callback_ = pin_fetched_callback;
+ parent_->FetchPin(weak_factory_.GetWeakPtr());
+ }
+}
+
+void PepperPinFetcher::OnPinFetched(const std::string& pin) {
+ if (!pin_fetched_callback_.is_null()) {
+ pin_fetched_callback_.Run(pin);
+ pin_fetched_callback_.Reset();
+ }
+}
+
+} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698