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

Side by Side Diff: remoting/client/plugin/chromoting_instance.cc

Issue 15685008: Show a 'remember me' checkbox in the web-app when connecting to a host that supports pairing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reviewer comments. Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « remoting/client/plugin/chromoting_instance.h ('k') | remoting/protocol/authenticator.h » ('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 #include "remoting/client/plugin/chromoting_instance.h" 5 #include "remoting/client/plugin/chromoting_instance.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 PostChromotingMessage("onConnectionReady", data.Pass()); 499 PostChromotingMessage("onConnectionReady", data.Pass());
500 } 500 }
501 501
502 void ChromotingInstance::SetCapabilities(const std::string& capabilities) { 502 void ChromotingInstance::SetCapabilities(const std::string& capabilities) {
503 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); 503 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue());
504 data->SetString("capabilities", capabilities); 504 data->SetString("capabilities", capabilities);
505 PostChromotingMessage("setCapabilities", data.Pass()); 505 PostChromotingMessage("setCapabilities", data.Pass());
506 } 506 }
507 507
508 void ChromotingInstance::FetchSecretFromDialog( 508 void ChromotingInstance::FetchSecretFromDialog(
509 bool pairing_supported,
509 const protocol::SecretFetchedCallback& secret_fetched_callback) { 510 const protocol::SecretFetchedCallback& secret_fetched_callback) {
510 // Once the Session object calls this function, it won't continue the 511 // Once the Session object calls this function, it won't continue the
511 // authentication until the callback is called (or connection is canceled). 512 // authentication until the callback is called (or connection is canceled).
512 // So, it's impossible to reach this with a callback already registered. 513 // So, it's impossible to reach this with a callback already registered.
513 DCHECK(secret_fetched_callback_.is_null()); 514 DCHECK(secret_fetched_callback_.is_null());
514 secret_fetched_callback_ = secret_fetched_callback; 515 secret_fetched_callback_ = secret_fetched_callback;
515 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); 516 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue());
517 data->SetBoolean("pairingSupported", pairing_supported);
516 PostChromotingMessage("fetchPin", data.Pass()); 518 PostChromotingMessage("fetchPin", data.Pass());
517 } 519 }
518 520
519 void ChromotingInstance::FetchSecretFromString( 521 void ChromotingInstance::FetchSecretFromString(
520 const std::string& shared_secret, 522 const std::string& shared_secret,
523 bool pairing_supported,
521 const protocol::SecretFetchedCallback& secret_fetched_callback) { 524 const protocol::SecretFetchedCallback& secret_fetched_callback) {
522 secret_fetched_callback.Run(shared_secret); 525 secret_fetched_callback.Run(shared_secret);
523 } 526 }
524 527
525 protocol::ClipboardStub* ChromotingInstance::GetClipboardStub() { 528 protocol::ClipboardStub* ChromotingInstance::GetClipboardStub() {
526 // TODO(sergeyu): Move clipboard handling to a separate class. 529 // TODO(sergeyu): Move clipboard handling to a separate class.
527 // crbug.com/138108 530 // crbug.com/138108
528 return this; 531 return this;
529 } 532 }
530 533
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 url_components.scheme.len); 948 url_components.scheme.len);
946 return url_scheme == kChromeExtensionUrlScheme; 949 return url_scheme == kChromeExtensionUrlScheme;
947 } 950 }
948 951
949 bool ChromotingInstance::IsConnected() { 952 bool ChromotingInstance::IsConnected() {
950 return host_connection_.get() && 953 return host_connection_.get() &&
951 (host_connection_->state() == protocol::ConnectionToHost::CONNECTED); 954 (host_connection_->state() == protocol::ConnectionToHost::CONNECTED);
952 } 955 }
953 956
954 } // namespace remoting 957 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/plugin/chromoting_instance.h ('k') | remoting/protocol/authenticator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698