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

Side by Side Diff: chromeos/dbus/update_engine_client.cc

Issue 2933923002: Remove update icon after user confirms download (Closed)
Patch Set: Apply fix to patch set 2 Created 3 years, 6 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
« no previous file with comments | « chromeos/dbus/update_engine_client.h ('k') | no next file » | 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 "chromeos/dbus/update_engine_client.h" 5 #include "chromeos/dbus/update_engine_client.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 461
462 // Callback should run anyway, regardless of whether DBus call to enable 462 // Callback should run anyway, regardless of whether DBus call to enable
463 // update over cellular succeeded or failed. 463 // update over cellular succeeded or failed.
464 callback.Run(); 464 callback.Run();
465 } 465 }
466 466
467 // Called when a response for SetUpdateOverCellularPermission() is received. 467 // Called when a response for SetUpdateOverCellularPermission() is received.
468 void OnSetUpdateOverCellularTarget( 468 void OnSetUpdateOverCellularTarget(
469 const SetUpdateOverCellularTargetCallback& callback, 469 const SetUpdateOverCellularTargetCallback& callback,
470 dbus::Response* response) { 470 dbus::Response* response) {
471 bool success = true;
471 if (!response) { 472 if (!response) {
473 success = false;
472 LOG(ERROR) << update_engine::kSetUpdateOverCellularTarget 474 LOG(ERROR) << update_engine::kSetUpdateOverCellularTarget
473 << " call failed"; 475 << " call failed";
474 callback.Run(false);
475 return;
476 } 476 }
477 callback.Run(true); 477
478 for (auto& observer : observers_) {
479 observer.OnUpdateOverCellularTargetSet(success);
480 }
481
482 callback.Run(success);
478 } 483 }
479 484
480 // Called when a status update signal is received. 485 // Called when a status update signal is received.
481 void StatusUpdateReceived(dbus::Signal* signal) { 486 void StatusUpdateReceived(dbus::Signal* signal) {
482 VLOG(1) << "Status update signal received: " << signal->ToString(); 487 VLOG(1) << "Status update signal received: " << signal->ToString();
483 dbus::MessageReader reader(signal); 488 dbus::MessageReader reader(signal);
484 int64_t last_checked_time = 0; 489 int64_t last_checked_time = 0;
485 double progress = 0.0; 490 double progress = 0.0;
486 std::string current_operation; 491 std::string current_operation;
487 std::string new_version; 492 std::string new_version;
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 const char** cix = std::find( 724 const char** cix = std::find(
720 kReleaseChannelsList, 725 kReleaseChannelsList,
721 kReleaseChannelsList + arraysize(kReleaseChannelsList), current_channel); 726 kReleaseChannelsList + arraysize(kReleaseChannelsList), current_channel);
722 const char** tix = std::find( 727 const char** tix = std::find(
723 kReleaseChannelsList, 728 kReleaseChannelsList,
724 kReleaseChannelsList + arraysize(kReleaseChannelsList), target_channel); 729 kReleaseChannelsList + arraysize(kReleaseChannelsList), target_channel);
725 return tix > cix; 730 return tix > cix;
726 } 731 }
727 732
728 } // namespace chromeos 733 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/update_engine_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698