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

Side by Side Diff: components/arc/power/arc_power_bridge.cc

Issue 1527183003: Change mojo enums to be scoped enums in the generated C++ bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-binding-equals
Patch Set: rebase Created 4 years, 11 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 | « components/arc/ime/arc_ime_ipc_host_impl.cc ('k') | components/arc/test/fake_app_instance.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/arc/power/arc_power_bridge.h" 5 #include "components/arc/power/arc_power_bridge.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 DisplayWakeLockType type) { 46 DisplayWakeLockType type) {
47 if (!chromeos::PowerPolicyController::IsInitialized()) { 47 if (!chromeos::PowerPolicyController::IsInitialized()) {
48 LOG(WARNING) << "PowerPolicyController is not available"; 48 LOG(WARNING) << "PowerPolicyController is not available";
49 return; 49 return;
50 } 50 }
51 chromeos::PowerPolicyController* controller = 51 chromeos::PowerPolicyController* controller =
52 chromeos::PowerPolicyController::Get(); 52 chromeos::PowerPolicyController::Get();
53 53
54 int wake_lock_id = -1; 54 int wake_lock_id = -1;
55 switch (type) { 55 switch (type) {
56 case DISPLAY_WAKE_LOCK_TYPE_BRIGHT: 56 case DisplayWakeLockType::BRIGHT:
57 wake_lock_id = controller->AddScreenWakeLock( 57 wake_lock_id = controller->AddScreenWakeLock(
58 chromeos::PowerPolicyController::REASON_OTHER, "ARC"); 58 chromeos::PowerPolicyController::REASON_OTHER, "ARC");
59 break; 59 break;
60 case DISPLAY_WAKE_LOCK_TYPE_DIM: 60 case DisplayWakeLockType::DIM:
61 wake_lock_id = controller->AddDimWakeLock( 61 wake_lock_id = controller->AddDimWakeLock(
62 chromeos::PowerPolicyController::REASON_OTHER, "ARC"); 62 chromeos::PowerPolicyController::REASON_OTHER, "ARC");
63 break; 63 break;
64 default: 64 default:
65 LOG(WARNING) << "Tried to take invalid wake lock type " 65 LOG(WARNING) << "Tried to take invalid wake lock type "
66 << static_cast<int>(type); 66 << static_cast<int>(type);
67 return; 67 return;
68 } 68 }
69 wake_locks_.insert(std::make_pair(type, wake_lock_id)); 69 wake_locks_.insert(std::make_pair(type, wake_lock_id));
70 } 70 }
(...skipping 28 matching lines...) Expand all
99 chromeos::PowerPolicyController* controller = 99 chromeos::PowerPolicyController* controller =
100 chromeos::PowerPolicyController::Get(); 100 chromeos::PowerPolicyController::Get();
101 101
102 for (const auto& it : wake_locks_) { 102 for (const auto& it : wake_locks_) {
103 controller->RemoveWakeLock(it.second); 103 controller->RemoveWakeLock(it.second);
104 } 104 }
105 wake_locks_.clear(); 105 wake_locks_.clear();
106 } 106 }
107 107
108 } // namespace arc 108 } // namespace arc
OLDNEW
« no previous file with comments | « components/arc/ime/arc_ime_ipc_host_impl.cc ('k') | components/arc/test/fake_app_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698