OLD | NEW |
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 "extensions/browser/api/alarms/alarms_api.h" | 5 #include "extensions/browser/api/alarms/alarms_api.h" |
6 | 6 |
7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
8 #include "base/time/clock.h" | 8 #include "base/time/clock.h" |
9 #include "base/time/default_clock.h" | 9 #include "base/time/default_clock.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "extensions/browser/api/alarms/alarm_manager.h" | 11 #include "extensions/browser/api/alarms/alarm_manager.h" |
12 #include "extensions/common/api/alarms.h" | 12 #include "extensions/common/api/alarms.h" |
13 #include "extensions/common/error_utils.h" | 13 #include "extensions/common/error_utils.h" |
14 | 14 |
15 namespace extensions { | 15 namespace extensions { |
16 | 16 |
17 namespace alarms = core_api::alarms; | 17 namespace alarms = api::alarms; |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 const char kDefaultAlarmName[] = ""; | 21 const char kDefaultAlarmName[] = ""; |
22 const char kBothRelativeAndAbsoluteTime[] = | 22 const char kBothRelativeAndAbsoluteTime[] = |
23 "Cannot set both when and delayInMinutes."; | 23 "Cannot set both when and delayInMinutes."; |
24 const char kNoScheduledTime[] = | 24 const char kNoScheduledTime[] = |
25 "Must set at least one of when, delayInMinutes, or periodInMinutes."; | 25 "Must set at least one of when, delayInMinutes, or periodInMinutes."; |
26 const int kReleaseDelayMinimum = 1; | 26 const int kReleaseDelayMinimum = 1; |
27 const int kDevDelayMinimum = 0; | 27 const int kDevDelayMinimum = 0; |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 base::Bind(&AlarmsClearAllFunction::Callback, this)); | 197 base::Bind(&AlarmsClearAllFunction::Callback, this)); |
198 return true; | 198 return true; |
199 } | 199 } |
200 | 200 |
201 void AlarmsClearAllFunction::Callback() { | 201 void AlarmsClearAllFunction::Callback() { |
202 SetResult(new base::FundamentalValue(true)); | 202 SetResult(new base::FundamentalValue(true)); |
203 SendResponse(true); | 203 SendResponse(true); |
204 } | 204 } |
205 | 205 |
206 } // namespace extensions | 206 } // namespace extensions |
OLD | NEW |