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

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

Issue 10801003: Propagate DPI information to web-app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reviewer comments. Created 8 years, 5 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
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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 345
346 // TODO(wez): When we have a good hook into Host dimensions changes, move 346 // TODO(wez): When we have a good hook into Host dimensions changes, move
347 // this there. 347 // this there.
348 // If |input_handler_| is valid, then |mouse_input_filter_| must also be 348 // If |input_handler_| is valid, then |mouse_input_filter_| must also be
349 // since they are constructed together as part of the input pipeline 349 // since they are constructed together as part of the input pipeline
350 mouse_input_filter_->set_output_size(view_->get_screen_size()); 350 mouse_input_filter_->set_output_size(view_->get_screen_size());
351 351
352 return input_handler_->HandleInputEvent(event); 352 return input_handler_->HandleInputEvent(event);
353 } 353 }
354 354
355 void ChromotingInstance::SetDesktopSize(int width, int height) { 355 void ChromotingInstance::SetDesktopSize(const SkISize& size,
356 const SkIPoint& dpi) {
356 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); 357 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue());
357 data->SetInteger("width", width); 358 data->SetInteger("width", size.width());
358 data->SetInteger("height", height); 359 data->SetInteger("height", size.height());
360 if (dpi.x()) {
Wez 2012/07/19 23:15:29 nit: In the host code you've used single-line if w
Jamie 2012/07/20 00:42:14 I only did that for consistency with the rest of t
361 data->SetInteger("x_dpi", dpi.x());
362 }
363 if (dpi.y()) {
364 data->SetInteger("y_dpi", dpi.y());
365 }
359 PostChromotingMessage("onDesktopSize", data.Pass()); 366 PostChromotingMessage("onDesktopSize", data.Pass());
360 } 367 }
361 368
362 void ChromotingInstance::SetConnectionState( 369 void ChromotingInstance::SetConnectionState(
363 ConnectionState state, 370 ConnectionState state,
364 ConnectionError error) { 371 ConnectionError error) {
365 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); 372 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue());
366 data->SetString("state", ConnectionStateToString(state)); 373 data->SetString("state", ConnectionStateToString(state));
367 data->SetString("error", ConnectionErrorToString(error)); 374 data->SetString("error", ConnectionErrorToString(error));
368 PostChromotingMessage("onConnectionStatus", data.Pass()); 375 PostChromotingMessage("onConnectionStatus", data.Pass());
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 PostChromotingMessage("logDebugMessage", data.Pass()); 717 PostChromotingMessage("logDebugMessage", data.Pass());
711 g_logging_to_plugin = false; 718 g_logging_to_plugin = false;
712 } 719 }
713 720
714 bool ChromotingInstance::IsConnected() { 721 bool ChromotingInstance::IsConnected() {
715 return host_connection_.get() && 722 return host_connection_.get() &&
716 (host_connection_->state() == protocol::ConnectionToHost::CONNECTED); 723 (host_connection_->state() == protocol::ConnectionToHost::CONNECTED);
717 } 724 }
718 725
719 } // namespace remoting 726 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698