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 |