Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/extensions/api/system_info_display/display_info_provide r.h" | 5 #include "chrome/browser/extensions/api/system_info_display/display_info_provide r.h" |
| 6 | 6 |
| 7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
| 8 #include "ash/display/display_manager.h" | 8 #include "ash/display/display_manager.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 404 UpdateDisplayLayout(primary.bounds(), primary.id(), | 404 UpdateDisplayLayout(primary.bounds(), primary.id(), |
| 405 target_bounds, target.id()); | 405 target_bounds, target.id()); |
| 406 } | 406 } |
| 407 | 407 |
| 408 return true; | 408 return true; |
| 409 } | 409 } |
| 410 | 410 |
| 411 } // namespace | 411 } // namespace |
| 412 | 412 |
| 413 void DisplayInfoProvider::RequestInfo(const RequestInfoCallback& callback) { | 413 void DisplayInfoProvider::RequestInfo(const RequestInfoCallback& callback) { |
| 414 DisplayInfo requested_info; | 414 QueryInfo(); |
| 415 bool success = QueryInfo(&requested_info); | |
| 416 | 415 |
| 417 base::MessageLoopProxy::current()->PostTask( | 416 base::MessageLoopProxy::current()->PostTask( |
| 418 FROM_HERE, | 417 FROM_HERE, |
| 419 base::Bind(callback, requested_info, success)); | 418 base::Bind(callback, info_, success_)); |
|
Hongbo Min
2013/07/05 05:01:34
nits: sucess_ should be already removed, use the r
Haojian Wu
2013/07/06 05:31:37
Done.
| |
| 420 } | 419 } |
| 421 | 420 |
| 422 void DisplayInfoProvider::SetInfo(const std::string& display_id, | 421 void DisplayInfoProvider::SetInfo(const std::string& display_id, |
| 423 const DisplayProperties& info, | 422 const DisplayProperties& info, |
| 424 const SetInfoCallback& callback) { | 423 const SetInfoCallback& callback) { |
| 425 std::string error; | 424 std::string error; |
| 426 bool success = SetInfoImpl(display_id, info, &error); | 425 bool success = SetInfoImpl(display_id, info, &error); |
| 427 base::MessageLoopProxy::current()->PostTask( | 426 base::MessageLoopProxy::current()->PostTask( |
| 428 FROM_HERE, | 427 FROM_HERE, |
| 429 base::Bind(callback, success, error)); | 428 base::Bind(callback, success, error)); |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 440 int64 primary_id = ash::Shell::GetScreen()->GetPrimaryDisplay().id(); | 439 int64 primary_id = ash::Shell::GetScreen()->GetPrimaryDisplay().id(); |
| 441 for (size_t i = 0; i < display_manager->GetNumDisplays(); ++i) { | 440 for (size_t i = 0; i < display_manager->GetNumDisplays(); ++i) { |
| 442 AddInfoForDisplay(*display_manager->GetDisplayAt(i), display_manager, | 441 AddInfoForDisplay(*display_manager->GetDisplayAt(i), display_manager, |
| 443 primary_id, info); | 442 primary_id, info); |
| 444 } | 443 } |
| 445 | 444 |
| 446 return true; | 445 return true; |
| 447 } | 446 } |
| 448 | 447 |
| 449 } // namespace extensions | 448 } // namespace extensions |
| OLD | NEW |