Merge lp:~justinmcp/oxide/1328494 into lp:~oxide-developers/oxide/oxide.trunk
- 1328494
- Merge into oxide.trunk
Proposed by
Justin McPherson
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 1166 | ||||
Proposed branch: | lp:~justinmcp/oxide/1328494 | ||||
Merge into: | lp:~oxide-developers/oxide/oxide.trunk | ||||
Diff against target: |
340 lines (+159/-55) 5 files modified
qt/core/browser/oxide_qt_browser_platform_integration.cc (+4/-0) qt/core/browser/oxide_qt_browser_platform_integration.h (+1/-0) shared/browser/oxide_browser_platform_integration.cc (+6/-0) shared/browser/oxide_browser_platform_integration.h (+5/-0) shared/browser/oxide_power_save_blocker.cc (+143/-55) |
||||
To merge this branch: | bzr merge lp:~justinmcp/oxide/1328494 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Chris Coulson | Approve | ||
Review via email: mp+263998@code.launchpad.net |
Commit message
Request that the screensaver be inhibited (desktop)
This adds to the already existing code to do this by activating the desktop path.
Description of the change
To post a comment you must log in.
lp:~justinmcp/oxide/1328494
updated
- 1162. By Justin McPherson
-
Be more specific about type
lp:~justinmcp/oxide/1328494
updated
- 1163. By Justin McPherson
-
Merge from trunk.
- 1164. By Justin McPherson
-
Results of review.
- 1165. By Justin McPherson
-
Remove unnecessary header include.
Revision history for this message
Chris Coulson (chrisccoulson) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'qt/core/browser/oxide_qt_browser_platform_integration.cc' | |||
2 | --- qt/core/browser/oxide_qt_browser_platform_integration.cc 2015-06-22 23:56:59 +0000 | |||
3 | +++ qt/core/browser/oxide_qt_browser_platform_integration.cc 2015-07-22 04:34:45 +0000 | |||
4 | @@ -162,6 +162,10 @@ | |||
5 | 162 | return state_; | 162 | return state_; |
6 | 163 | } | 163 | } |
7 | 164 | 164 | ||
8 | 165 | std::string BrowserPlatformIntegration::GetApplicationName() { | ||
9 | 166 | return qApp->applicationName().toStdString(); | ||
10 | 167 | } | ||
11 | 168 | |||
12 | 165 | bool BrowserPlatformIntegration::eventFilter(QObject* watched, QEvent* event) { | 169 | bool BrowserPlatformIntegration::eventFilter(QObject* watched, QEvent* event) { |
13 | 166 | if (event->type() == QEvent::ApplicationActivate || | 170 | if (event->type() == QEvent::ApplicationActivate || |
14 | 167 | event->type() == QEvent::ApplicationDeactivate) { | 171 | event->type() == QEvent::ApplicationDeactivate) { |
15 | 168 | 172 | ||
16 | === modified file 'qt/core/browser/oxide_qt_browser_platform_integration.h' | |||
17 | --- qt/core/browser/oxide_qt_browser_platform_integration.h 2015-06-12 07:39:38 +0000 | |||
18 | +++ qt/core/browser/oxide_qt_browser_platform_integration.h 2015-07-22 04:34:45 +0000 | |||
19 | @@ -57,6 +57,7 @@ | |||
20 | 57 | void BrowserThreadInit(content::BrowserThread::ID id) override; | 57 | void BrowserThreadInit(content::BrowserThread::ID id) override; |
21 | 58 | content::LocationProvider* CreateLocationProvider() override; | 58 | content::LocationProvider* CreateLocationProvider() override; |
22 | 59 | ApplicationState GetApplicationState() override; | 59 | ApplicationState GetApplicationState() override; |
23 | 60 | std::string GetApplicationName() override; | ||
24 | 60 | ui::ClipboardOxideFactory GetClipboardOxideFactory() override; | 61 | ui::ClipboardOxideFactory GetClipboardOxideFactory() override; |
25 | 61 | 62 | ||
26 | 62 | // QObject implementation | 63 | // QObject implementation |
27 | 63 | 64 | ||
28 | === modified file 'shared/browser/oxide_browser_platform_integration.cc' | |||
29 | --- shared/browser/oxide_browser_platform_integration.cc 2015-05-27 20:56:59 +0000 | |||
30 | +++ shared/browser/oxide_browser_platform_integration.cc 2015-07-22 04:34:45 +0000 | |||
31 | @@ -25,6 +25,8 @@ | |||
32 | 25 | 25 | ||
33 | 26 | namespace { | 26 | namespace { |
34 | 27 | 27 | ||
35 | 28 | const char kDefaultApplicationName[] = "Oxide"; | ||
36 | 29 | |||
37 | 28 | BrowserPlatformIntegration* g_instance; | 30 | BrowserPlatformIntegration* g_instance; |
38 | 29 | 31 | ||
39 | 30 | } | 32 | } |
40 | @@ -74,6 +76,10 @@ | |||
41 | 74 | return APPLICATION_STATE_ACTIVE; | 76 | return APPLICATION_STATE_ACTIVE; |
42 | 75 | } | 77 | } |
43 | 76 | 78 | ||
44 | 79 | std::string BrowserPlatformIntegration::GetApplicationName() { | ||
45 | 80 | return kDefaultApplicationName; | ||
46 | 81 | } | ||
47 | 82 | |||
48 | 77 | void BrowserPlatformIntegration::AddObserver( | 83 | void BrowserPlatformIntegration::AddObserver( |
49 | 78 | BrowserPlatformIntegrationObserver* observer) { | 84 | BrowserPlatformIntegrationObserver* observer) { |
50 | 79 | observers_.AddObserver(observer); | 85 | observers_.AddObserver(observer); |
51 | 80 | 86 | ||
52 | === modified file 'shared/browser/oxide_browser_platform_integration.h' | |||
53 | --- shared/browser/oxide_browser_platform_integration.h 2015-06-12 07:39:38 +0000 | |||
54 | +++ shared/browser/oxide_browser_platform_integration.h 2015-07-22 04:34:45 +0000 | |||
55 | @@ -18,6 +18,8 @@ | |||
56 | 18 | #ifndef _OXIDE_SHARED_BROWSER_PLATFORM_INTEGRATION_H_ | 18 | #ifndef _OXIDE_SHARED_BROWSER_PLATFORM_INTEGRATION_H_ |
57 | 19 | #define _OXIDE_SHARED_BROWSER_PLATFORM_INTEGRATION_H_ | 19 | #define _OXIDE_SHARED_BROWSER_PLATFORM_INTEGRATION_H_ |
58 | 20 | 20 | ||
59 | 21 | #include <string> | ||
60 | 22 | |||
61 | 21 | #include "base/macros.h" | 23 | #include "base/macros.h" |
62 | 22 | #include "base/memory/scoped_ptr.h" | 24 | #include "base/memory/scoped_ptr.h" |
63 | 23 | #include "base/observer_list.h" | 25 | #include "base/observer_list.h" |
64 | @@ -96,6 +98,9 @@ | |||
65 | 96 | // Get the current application state | 98 | // Get the current application state |
66 | 97 | virtual ApplicationState GetApplicationState(); | 99 | virtual ApplicationState GetApplicationState(); |
67 | 98 | 100 | ||
68 | 101 | // Get the application name | ||
69 | 102 | virtual std::string GetApplicationName(); | ||
70 | 103 | |||
71 | 99 | protected: | 104 | protected: |
72 | 100 | BrowserPlatformIntegration(); | 105 | BrowserPlatformIntegration(); |
73 | 101 | 106 | ||
74 | 102 | 107 | ||
75 | === modified file 'shared/browser/oxide_power_save_blocker.cc' | |||
76 | --- shared/browser/oxide_power_save_blocker.cc 2015-05-27 20:56:59 +0000 | |||
77 | +++ shared/browser/oxide_power_save_blocker.cc 2015-07-22 04:34:45 +0000 | |||
78 | @@ -31,6 +31,7 @@ | |||
79 | 31 | 31 | ||
80 | 32 | #include "shared/port/content/browser/power_save_blocker_oxide.h" | 32 | #include "shared/port/content/browser/power_save_blocker_oxide.h" |
81 | 33 | 33 | ||
82 | 34 | #include "oxide_browser_platform_integration.h" | ||
83 | 34 | #include "oxide_browser_platform_integration_observer.h" | 35 | #include "oxide_browser_platform_integration_observer.h" |
84 | 35 | #include "oxide_form_factor.h" | 36 | #include "oxide_form_factor.h" |
85 | 36 | 37 | ||
86 | @@ -43,12 +44,18 @@ | |||
87 | 43 | const char kUnityScreenInterface[] = "com.canonical.Unity.Screen"; | 44 | const char kUnityScreenInterface[] = "com.canonical.Unity.Screen"; |
88 | 44 | const int kInvalidCookie = -1; | 45 | const int kInvalidCookie = -1; |
89 | 45 | 46 | ||
90 | 47 | const char kFreeDesktopScreenSaverName[] = "org.freedesktop.ScreenSaver"; | ||
91 | 48 | const char kFreeDesktopScreenSaverPath[] = "/org/freedesktop/ScreenSaver"; | ||
92 | 49 | const char kFreeDestopScreenSaverInterface[] = "org.freedesktop.ScreenSaver"; | ||
93 | 50 | |||
94 | 51 | const char kDefaultInhibitReason[] = "Active Application"; | ||
95 | 52 | |||
96 | 46 | } | 53 | } |
97 | 47 | 54 | ||
98 | 48 | class PowerSaveBlocker : public content::PowerSaveBlockerOxideDelegate, | 55 | class PowerSaveBlocker : public content::PowerSaveBlockerOxideDelegate, |
99 | 49 | public BrowserPlatformIntegrationObserver { | 56 | public BrowserPlatformIntegrationObserver { |
100 | 50 | public: | 57 | public: |
102 | 51 | PowerSaveBlocker(); | 58 | PowerSaveBlocker(const std::string& description); |
103 | 52 | 59 | ||
104 | 53 | private: | 60 | private: |
105 | 54 | virtual ~PowerSaveBlocker() {} | 61 | virtual ~PowerSaveBlocker() {} |
106 | @@ -59,12 +66,22 @@ | |||
107 | 59 | void ApplyBlock(); | 66 | void ApplyBlock(); |
108 | 60 | void RemoveBlock(); | 67 | void RemoveBlock(); |
109 | 61 | 68 | ||
110 | 69 | void ApplyBlockUnityScreenService(); | ||
111 | 70 | void RemoveBlockUnityScreenService(); | ||
112 | 71 | |||
113 | 72 | void ApplyBlockFreedesktop(); | ||
114 | 73 | void RemoveBlockFreedesktop(); | ||
115 | 74 | |||
116 | 62 | // BrowserPlatformIntegrationObserver implementation | 75 | // BrowserPlatformIntegrationObserver implementation |
117 | 63 | void ApplicationStateChanged() final; | 76 | void ApplicationStateChanged() final; |
118 | 64 | 77 | ||
119 | 65 | oxide::FormFactor form_factor_; | 78 | oxide::FormFactor form_factor_; |
120 | 66 | scoped_refptr<dbus::Bus> bus_; | 79 | scoped_refptr<dbus::Bus> bus_; |
122 | 67 | int cookie_; | 80 | union { |
123 | 81 | int32_t unity_cookie_; | ||
124 | 82 | uint32_t freedesktop_cookie_; | ||
125 | 83 | }; | ||
126 | 84 | std::string description_; | ||
127 | 68 | }; | 85 | }; |
128 | 69 | 86 | ||
129 | 70 | void PowerSaveBlocker::Init() { | 87 | void PowerSaveBlocker::Init() { |
130 | @@ -89,34 +106,9 @@ | |||
131 | 89 | 106 | ||
132 | 90 | if (form_factor_ == oxide::FORM_FACTOR_PHONE || | 107 | if (form_factor_ == oxide::FORM_FACTOR_PHONE || |
133 | 91 | form_factor_ == oxide::FORM_FACTOR_TABLET) { | 108 | form_factor_ == oxide::FORM_FACTOR_TABLET) { |
160 | 92 | DCHECK(!bus_.get()); | 109 | ApplyBlockUnityScreenService(); |
135 | 93 | dbus::Bus::Options options; | ||
136 | 94 | options.bus_type = dbus::Bus::SYSTEM; | ||
137 | 95 | options.connection_type = dbus::Bus::PRIVATE; | ||
138 | 96 | bus_ = new dbus::Bus(options); | ||
139 | 97 | |||
140 | 98 | scoped_refptr<dbus::ObjectProxy> object_proxy = bus_->GetObjectProxy( | ||
141 | 99 | kUnityScreenServiceName, | ||
142 | 100 | dbus::ObjectPath(kUnityScreenPath)); | ||
143 | 101 | scoped_ptr<dbus::MethodCall> method_call; | ||
144 | 102 | method_call.reset( | ||
145 | 103 | new dbus::MethodCall(kUnityScreenInterface, "keepDisplayOn")); | ||
146 | 104 | scoped_ptr<dbus::MessageWriter> message_writer; | ||
147 | 105 | message_writer.reset(new dbus::MessageWriter(method_call.get())); | ||
148 | 106 | |||
149 | 107 | scoped_ptr<dbus::Response> response(object_proxy->CallMethodAndBlock( | ||
150 | 108 | method_call.get(), dbus::ObjectProxy::TIMEOUT_USE_DEFAULT)); | ||
151 | 109 | if (response) { | ||
152 | 110 | dbus::MessageReader message_reader(response.get()); | ||
153 | 111 | if (!message_reader.PopInt32(&cookie_)) { | ||
154 | 112 | LOG(ERROR) << "Invalid response for screen blanking inhibition request: " | ||
155 | 113 | << response->ToString(); | ||
156 | 114 | } | ||
157 | 115 | } else { | ||
158 | 116 | LOG(ERROR) << "Failed to inhibit screen blanking"; | ||
159 | 117 | } | ||
161 | 118 | } else { | 110 | } else { |
163 | 119 | NOTIMPLEMENTED(); | 111 | ApplyBlockFreedesktop(); |
164 | 120 | } | 112 | } |
165 | 121 | } | 113 | } |
166 | 122 | 114 | ||
167 | @@ -125,27 +117,121 @@ | |||
168 | 125 | 117 | ||
169 | 126 | if (form_factor_ == oxide::FORM_FACTOR_PHONE || | 118 | if (form_factor_ == oxide::FORM_FACTOR_PHONE || |
170 | 127 | form_factor_ == oxide::FORM_FACTOR_TABLET) { | 119 | form_factor_ == oxide::FORM_FACTOR_TABLET) { |
192 | 128 | if (cookie_ != kInvalidCookie) { | 120 | RemoveBlockUnityScreenService(); |
193 | 129 | DCHECK(bus_.get()); | 121 | } else { |
194 | 130 | scoped_refptr<dbus::ObjectProxy> object_proxy = bus_->GetObjectProxy( | 122 | RemoveBlockFreedesktop(); |
195 | 131 | kUnityScreenServiceName, | 123 | } |
196 | 132 | dbus::ObjectPath(kUnityScreenPath)); | 124 | } |
197 | 133 | scoped_ptr<dbus::MethodCall> method_call; | 125 | |
198 | 134 | method_call.reset( | 126 | void PowerSaveBlocker::ApplyBlockUnityScreenService() { |
199 | 135 | new dbus::MethodCall(kUnityScreenInterface, "removeDisplayOnRequest")); | 127 | DCHECK(!bus_.get()); |
200 | 136 | dbus::MessageWriter message_writer(method_call.get()); | 128 | dbus::Bus::Options options; |
201 | 137 | message_writer.AppendInt32(cookie_); | 129 | options.bus_type = dbus::Bus::SYSTEM; |
202 | 138 | object_proxy->CallMethodAndBlock( | 130 | options.connection_type = dbus::Bus::PRIVATE; |
203 | 139 | method_call.get(), dbus::ObjectProxy::TIMEOUT_USE_DEFAULT); | 131 | bus_ = new dbus::Bus(options); |
204 | 140 | cookie_ = kInvalidCookie; | 132 | |
205 | 141 | } | 133 | scoped_refptr<dbus::ObjectProxy> object_proxy = bus_->GetObjectProxy( |
206 | 142 | 134 | kUnityScreenServiceName, | |
207 | 143 | if (bus_.get()) { | 135 | dbus::ObjectPath(kUnityScreenPath)); |
208 | 144 | bus_->ShutdownAndBlock(); | 136 | scoped_ptr<dbus::MethodCall> method_call; |
209 | 145 | bus_ = nullptr; | 137 | method_call.reset( |
210 | 146 | } | 138 | new dbus::MethodCall(kUnityScreenInterface, "keepDisplayOn")); |
211 | 147 | } else { | 139 | scoped_ptr<dbus::MessageWriter> message_writer; |
212 | 148 | NOTIMPLEMENTED(); | 140 | message_writer.reset(new dbus::MessageWriter(method_call.get())); |
213 | 141 | |||
214 | 142 | scoped_ptr<dbus::Response> response(object_proxy->CallMethodAndBlock( | ||
215 | 143 | method_call.get(), dbus::ObjectProxy::TIMEOUT_USE_DEFAULT)); | ||
216 | 144 | if (response) { | ||
217 | 145 | dbus::MessageReader message_reader(response.get()); | ||
218 | 146 | if (!message_reader.PopInt32(&unity_cookie_)) { | ||
219 | 147 | LOG(ERROR) << "Invalid response for screen blanking inhibition request: " | ||
220 | 148 | << response->ToString(); | ||
221 | 149 | } | ||
222 | 150 | } else { | ||
223 | 151 | LOG(ERROR) << "Failed to inhibit screen blanking"; | ||
224 | 152 | } | ||
225 | 153 | } | ||
226 | 154 | |||
227 | 155 | void PowerSaveBlocker::RemoveBlockUnityScreenService() { | ||
228 | 156 | if (unity_cookie_ != kInvalidCookie) { | ||
229 | 157 | DCHECK(bus_.get()); | ||
230 | 158 | scoped_refptr<dbus::ObjectProxy> object_proxy = bus_->GetObjectProxy( | ||
231 | 159 | kUnityScreenServiceName, | ||
232 | 160 | dbus::ObjectPath(kUnityScreenPath)); | ||
233 | 161 | scoped_ptr<dbus::MethodCall> method_call; | ||
234 | 162 | method_call.reset( | ||
235 | 163 | new dbus::MethodCall(kUnityScreenInterface, "removeDisplayOnRequest")); | ||
236 | 164 | dbus::MessageWriter message_writer(method_call.get()); | ||
237 | 165 | message_writer.AppendInt32(unity_cookie_); | ||
238 | 166 | object_proxy->CallMethodAndBlock( | ||
239 | 167 | method_call.get(), dbus::ObjectProxy::TIMEOUT_USE_DEFAULT); | ||
240 | 168 | unity_cookie_ = kInvalidCookie; | ||
241 | 169 | } | ||
242 | 170 | |||
243 | 171 | if (bus_.get()) { | ||
244 | 172 | bus_->ShutdownAndBlock(); | ||
245 | 173 | bus_ = nullptr; | ||
246 | 174 | } | ||
247 | 175 | } | ||
248 | 176 | |||
249 | 177 | void PowerSaveBlocker::ApplyBlockFreedesktop() { | ||
250 | 178 | std::string application_name = | ||
251 | 179 | BrowserPlatformIntegration::GetInstance()->GetApplicationName(); | ||
252 | 180 | std::string description{kDefaultInhibitReason}; | ||
253 | 181 | |||
254 | 182 | if (!description_.empty()) { | ||
255 | 183 | description = description_; | ||
256 | 184 | } | ||
257 | 185 | |||
258 | 186 | DCHECK(!bus_.get()); | ||
259 | 187 | dbus::Bus::Options options; | ||
260 | 188 | options.bus_type = dbus::Bus::SESSION; | ||
261 | 189 | options.connection_type = dbus::Bus::PRIVATE; | ||
262 | 190 | bus_ = new dbus::Bus(options); | ||
263 | 191 | |||
264 | 192 | scoped_refptr<dbus::ObjectProxy> object_proxy = bus_->GetObjectProxy( | ||
265 | 193 | kFreeDesktopScreenSaverName, | ||
266 | 194 | dbus::ObjectPath(kFreeDesktopScreenSaverPath)); | ||
267 | 195 | scoped_ptr<dbus::MethodCall> method_call; | ||
268 | 196 | method_call.reset( | ||
269 | 197 | new dbus::MethodCall(kFreeDestopScreenSaverInterface, "Inhibit")); | ||
270 | 198 | scoped_ptr<dbus::MessageWriter> message_writer; | ||
271 | 199 | message_writer.reset(new dbus::MessageWriter(method_call.get())); | ||
272 | 200 | message_writer->AppendString(application_name); | ||
273 | 201 | message_writer->AppendString(description); | ||
274 | 202 | |||
275 | 203 | scoped_ptr<dbus::Response> response(object_proxy->CallMethodAndBlock( | ||
276 | 204 | method_call.get(), dbus::ObjectProxy::TIMEOUT_USE_DEFAULT)); | ||
277 | 205 | if (response) { | ||
278 | 206 | dbus::MessageReader message_reader(response.get()); | ||
279 | 207 | if (!message_reader.PopUint32(&freedesktop_cookie_)) { | ||
280 | 208 | LOG(ERROR) << "Invalid response for screen blanking inhibition request: " | ||
281 | 209 | << response->ToString(); | ||
282 | 210 | } | ||
283 | 211 | } else { | ||
284 | 212 | LOG(ERROR) << "Failed to inhibit screen blanking"; | ||
285 | 213 | } | ||
286 | 214 | } | ||
287 | 215 | |||
288 | 216 | void PowerSaveBlocker::RemoveBlockFreedesktop() { | ||
289 | 217 | if (freedesktop_cookie_ != uint32_t(kInvalidCookie)) { | ||
290 | 218 | DCHECK(bus_.get()); | ||
291 | 219 | scoped_refptr<dbus::ObjectProxy> object_proxy = bus_->GetObjectProxy( | ||
292 | 220 | kFreeDesktopScreenSaverName, | ||
293 | 221 | dbus::ObjectPath(kFreeDesktopScreenSaverPath)); | ||
294 | 222 | scoped_ptr<dbus::MethodCall> method_call; | ||
295 | 223 | method_call.reset( | ||
296 | 224 | new dbus::MethodCall(kFreeDestopScreenSaverInterface, "UnInhibit")); | ||
297 | 225 | dbus::MessageWriter message_writer(method_call.get()); | ||
298 | 226 | message_writer.AppendUint32(freedesktop_cookie_); | ||
299 | 227 | object_proxy->CallMethodAndBlock( | ||
300 | 228 | method_call.get(), dbus::ObjectProxy::TIMEOUT_USE_DEFAULT); | ||
301 | 229 | freedesktop_cookie_ = kInvalidCookie; | ||
302 | 230 | } | ||
303 | 231 | |||
304 | 232 | if (bus_.get()) { | ||
305 | 233 | bus_->ShutdownAndBlock(); | ||
306 | 234 | bus_ = nullptr; | ||
307 | 149 | } | 235 | } |
308 | 150 | } | 236 | } |
309 | 151 | 237 | ||
310 | @@ -153,23 +239,25 @@ | |||
311 | 153 | BrowserPlatformIntegration::ApplicationState state = | 239 | BrowserPlatformIntegration::ApplicationState state = |
312 | 154 | BrowserPlatformIntegration::GetInstance()->GetApplicationState(); | 240 | BrowserPlatformIntegration::GetInstance()->GetApplicationState(); |
313 | 155 | if (state != BrowserPlatformIntegration::APPLICATION_STATE_SUSPENDED && | 241 | if (state != BrowserPlatformIntegration::APPLICATION_STATE_SUSPENDED && |
315 | 156 | cookie_ == kInvalidCookie) { | 242 | unity_cookie_ == kInvalidCookie) { |
316 | 157 | Init(); | 243 | Init(); |
317 | 158 | } else if (state == BrowserPlatformIntegration::APPLICATION_STATE_SUSPENDED && | 244 | } else if (state == BrowserPlatformIntegration::APPLICATION_STATE_SUSPENDED && |
319 | 159 | cookie_ != kInvalidCookie) { | 245 | unity_cookie_ != kInvalidCookie) { |
320 | 160 | CleanUp(); | 246 | CleanUp(); |
321 | 161 | } | 247 | } |
322 | 162 | } | 248 | } |
323 | 163 | 249 | ||
325 | 164 | PowerSaveBlocker::PowerSaveBlocker() | 250 | PowerSaveBlocker::PowerSaveBlocker(const std::string& description) |
326 | 165 | : form_factor_(oxide::GetFormFactorHint()) | 251 | : form_factor_(oxide::GetFormFactorHint()) |
328 | 166 | , cookie_(kInvalidCookie) {} | 252 | , unity_cookie_(kInvalidCookie) |
329 | 253 | , description_(description) | ||
330 | 254 | {} | ||
331 | 167 | 255 | ||
332 | 168 | content::PowerSaveBlockerOxideDelegate* CreatePowerSaveBlocker( | 256 | content::PowerSaveBlockerOxideDelegate* CreatePowerSaveBlocker( |
333 | 169 | content::PowerSaveBlocker::PowerSaveBlockerType type, | 257 | content::PowerSaveBlocker::PowerSaveBlockerType type, |
334 | 170 | content::PowerSaveBlocker::Reason reason, | 258 | content::PowerSaveBlocker::Reason reason, |
335 | 171 | const std::string& description) { | 259 | const std::string& description) { |
337 | 172 | return new PowerSaveBlocker(); | 260 | return new PowerSaveBlocker(description); |
338 | 173 | } | 261 | } |
339 | 174 | 262 | ||
340 | 175 | } // namespace oxide | 263 | } // namespace oxide |
Thanks. This looks mostly ok - I've just left a few minor comments