/extensions/api/calendar/calendar_api.h

https://github.com/ric2b/Vivaldi-browser · C Header · 658 lines · 424 code · 160 blank · 74 comment · 0 complexity · 8aaea45244966f8666fe3fe6485c5baf MD5 · raw file

  1. // Copyright (c) 2017 Vivaldi Technologies AS. All rights reserved
  2. #ifndef EXTENSIONS_API_CALENDAR_CALENDAR_API_H_
  3. #define EXTENSIONS_API_CALENDAR_CALENDAR_API_H_
  4. #include <memory>
  5. #include <string>
  6. #include "calendar/calendar_model_observer.h"
  7. #include "calendar/calendar_service.h"
  8. #include "calendar/calendar_type.h"
  9. #include "calendar/event_type.h"
  10. #include "calendar/notification_type.h"
  11. #include "extensions/browser/browser_context_keyed_api_factory.h"
  12. #include "extensions/browser/event_router.h"
  13. #include "extensions/browser/extension_function.h"
  14. #include "extensions/schema/calendar.h"
  15. using calendar::CalendarModelObserver;
  16. using calendar::CalendarService;
  17. namespace extensions {
  18. using vivaldi::calendar::CalendarEvent;
  19. // Observes CalendarModel and then routes (some of) the notifications as
  20. // events to the extension system.
  21. class CalendarEventRouter : public CalendarModelObserver {
  22. public:
  23. explicit CalendarEventRouter(Profile* profile);
  24. ~CalendarEventRouter() override;
  25. private:
  26. // Helper to actually dispatch an event to extension listeners.
  27. void DispatchEvent(const std::string& event_name,
  28. std::unique_ptr<base::ListValue> event_args);
  29. content::BrowserContext* browser_context_;
  30. CalendarService* model_;
  31. // CalendarModelObserver
  32. void OnEventCreated(CalendarService* service,
  33. const calendar::EventResult& event) override;
  34. void OnEventDeleted(CalendarService* service,
  35. const calendar::EventResult& event) override;
  36. void OnEventChanged(CalendarService* service,
  37. const calendar::EventResult& event) override;
  38. void OnEventTypeCreated(CalendarService* service,
  39. const calendar::EventTypeRow& row) override;
  40. void OnEventTypeDeleted(CalendarService* service,
  41. const calendar::EventTypeRow& row) override;
  42. void OnEventTypeChanged(CalendarService* service,
  43. const calendar::EventTypeRow& row) override;
  44. void OnCalendarCreated(CalendarService* service,
  45. const calendar::CalendarRow& row) override;
  46. void OnCalendarDeleted(CalendarService* service,
  47. const calendar::CalendarRow& row) override;
  48. void OnCalendarChanged(CalendarService* service,
  49. const calendar::CalendarRow& row) override;
  50. void OnNotificationChanged(CalendarService* service,
  51. const calendar::NotificationRow& row) override;
  52. void OnCalendarModified(CalendarService* service) override;
  53. void ExtensiveCalendarChangesBeginning(CalendarService* model) override;
  54. void ExtensiveCalendarChangesEnded(CalendarService* model) override;
  55. DISALLOW_COPY_AND_ASSIGN(CalendarEventRouter);
  56. };
  57. class CalendarAPI : public BrowserContextKeyedAPI,
  58. public EventRouter::Observer {
  59. public:
  60. explicit CalendarAPI(content::BrowserContext* context);
  61. ~CalendarAPI() override;
  62. // KeyedService implementation.
  63. void Shutdown() override;
  64. // BrowserContextKeyedAPI implementation.
  65. static BrowserContextKeyedAPIFactory<CalendarAPI>* GetFactoryInstance();
  66. // EventRouter::Observer implementation.
  67. void OnListenerAdded(const EventListenerInfo& details) override;
  68. private:
  69. friend class BrowserContextKeyedAPIFactory<CalendarAPI>;
  70. content::BrowserContext* browser_context_;
  71. // BrowserContextKeyedAPI implementation.
  72. static const char* service_name() { return "CalendarAPI"; }
  73. static const bool kServiceIsNULLWhileTesting = true;
  74. static const bool kServiceRedirectedInIncognito = true;
  75. // Created lazily upon OnListenerAdded.
  76. std::unique_ptr<CalendarEventRouter> calendar_event_router_;
  77. DISALLOW_COPY_AND_ASSIGN(CalendarAPI);
  78. };
  79. class CalendarAsyncFunction : public ExtensionFunction {
  80. public:
  81. CalendarAsyncFunction() = default;
  82. protected:
  83. CalendarService* GetCalendarService();
  84. Profile* GetProfile() const;
  85. ~CalendarAsyncFunction() override {}
  86. private:
  87. DISALLOW_COPY_AND_ASSIGN(CalendarAsyncFunction);
  88. };
  89. // Base class for calendar funciton APIs which require async interaction with
  90. // chrome services and the extension thread.
  91. class CalendarFunctionWithCallback : public CalendarAsyncFunction {
  92. public:
  93. CalendarFunctionWithCallback() = default;
  94. protected:
  95. ~CalendarFunctionWithCallback() override = default;
  96. // The task tracker for the CalendarService callbacks.
  97. base::CancelableTaskTracker task_tracker_;
  98. private:
  99. DISALLOW_COPY_AND_ASSIGN(CalendarFunctionWithCallback);
  100. };
  101. class CalendarGetAllEventsFunction : public CalendarFunctionWithCallback {
  102. DECLARE_EXTENSION_FUNCTION("calendar.getAllEvents", CALENDAR_GETALLEVENTS)
  103. public:
  104. CalendarGetAllEventsFunction() = default;
  105. protected:
  106. ~CalendarGetAllEventsFunction() override = default;
  107. // ExtensionFunction:
  108. ResponseAction Run() override;
  109. // Callback for the calendar function to provide results.
  110. void GetAllEventsComplete(
  111. std::shared_ptr<calendar::EventQueryResults> results);
  112. private:
  113. DISALLOW_COPY_AND_ASSIGN(CalendarGetAllEventsFunction);
  114. };
  115. class CalendarEventCreateFunction : public CalendarAsyncFunction {
  116. public:
  117. DECLARE_EXTENSION_FUNCTION("calendar.eventCreate", CALENDAR_CREATEEVENT)
  118. CalendarEventCreateFunction() = default;
  119. protected:
  120. ~CalendarEventCreateFunction() override = default;
  121. // ExtensionFunction:
  122. ResponseAction Run() override;
  123. // Callback for the calendar function to provide results.
  124. void CreateEventComplete(std::shared_ptr<calendar::EventResultCB> results);
  125. private:
  126. // The task tracker for the CalendarService callbacks.
  127. base::CancelableTaskTracker task_tracker_;
  128. DISALLOW_COPY_AND_ASSIGN(CalendarEventCreateFunction);
  129. };
  130. class CalendarEventsCreateFunction : public CalendarAsyncFunction {
  131. public:
  132. DECLARE_EXTENSION_FUNCTION("calendar.eventsCreate", CALENDAR_CREATEEVENTS)
  133. CalendarEventsCreateFunction() = default;
  134. protected:
  135. ~CalendarEventsCreateFunction() override = default;
  136. // ExtensionFunction:
  137. ResponseAction Run() override;
  138. // Callback for the calendar function to provide results.
  139. void CreateEventsComplete(
  140. std::shared_ptr<calendar::CreateEventsResult> results);
  141. private:
  142. // The task tracker for the CalendarService callbacks.
  143. base::CancelableTaskTracker task_tracker_;
  144. DISALLOW_COPY_AND_ASSIGN(CalendarEventsCreateFunction);
  145. };
  146. class CalendarUpdateEventFunction : public CalendarFunctionWithCallback {
  147. public:
  148. DECLARE_EXTENSION_FUNCTION("calendar.updateEvent", CALENDAR_UPDATEEVENT)
  149. CalendarUpdateEventFunction() = default;
  150. protected:
  151. ~CalendarUpdateEventFunction() override = default;
  152. // ExtensionFunction:
  153. ResponseAction Run() override;
  154. void UpdateEventComplete(std::shared_ptr<calendar::EventResultCB> results);
  155. private:
  156. DISALLOW_COPY_AND_ASSIGN(CalendarUpdateEventFunction);
  157. };
  158. class CalendarDeleteEventFunction : public CalendarAsyncFunction {
  159. public:
  160. DECLARE_EXTENSION_FUNCTION("calendar.deleteEvent", CALENDAR_DELETEEVENT)
  161. CalendarDeleteEventFunction() = default;
  162. protected:
  163. ~CalendarDeleteEventFunction() override = default;
  164. // ExtensionFunction:
  165. ResponseAction Run() override;
  166. void DeleteEventComplete(
  167. std::shared_ptr<calendar::DeleteEventResult> results);
  168. // The task tracker for the CalendarService callbacks.
  169. base::CancelableTaskTracker task_tracker_;
  170. private:
  171. DISALLOW_COPY_AND_ASSIGN(CalendarDeleteEventFunction);
  172. };
  173. class CalendarCreateFunction : public CalendarAsyncFunction {
  174. public:
  175. DECLARE_EXTENSION_FUNCTION("calendar.create", CALENDAR_CREATE)
  176. CalendarCreateFunction() = default;
  177. protected:
  178. ~CalendarCreateFunction() override = default;
  179. // ExtensionFunction:
  180. ResponseAction Run() override;
  181. // Callback for the calendar function to provide results.
  182. void CreateComplete(std::shared_ptr<calendar::CreateCalendarResult> results);
  183. private:
  184. // The task tracker for the CalendarService callbacks.
  185. base::CancelableTaskTracker task_tracker_;
  186. DISALLOW_COPY_AND_ASSIGN(CalendarCreateFunction);
  187. };
  188. class CalendarGetAllFunction : public CalendarFunctionWithCallback {
  189. DECLARE_EXTENSION_FUNCTION("calendar.getAll", CALENDAR_GETALL)
  190. public:
  191. CalendarGetAllFunction() = default;
  192. protected:
  193. ~CalendarGetAllFunction() override;
  194. // ExtensionFunction:
  195. ResponseAction Run() override;
  196. // Callback for the calendar function to provide results.
  197. void GetAllComplete(std::shared_ptr<calendar::CalendarQueryResults> results);
  198. private:
  199. DISALLOW_COPY_AND_ASSIGN(CalendarGetAllFunction);
  200. };
  201. class CalendarUpdateFunction : public CalendarFunctionWithCallback {
  202. public:
  203. DECLARE_EXTENSION_FUNCTION("calendar.update", CALENDAR_UPDATE)
  204. CalendarUpdateFunction() = default;
  205. protected:
  206. ~CalendarUpdateFunction() override = default;
  207. // ExtensionFunction:
  208. ResponseAction Run() override;
  209. void UpdateCalendarComplete(
  210. std::shared_ptr<calendar::UpdateCalendarResult> results);
  211. private:
  212. DISALLOW_COPY_AND_ASSIGN(CalendarUpdateFunction);
  213. };
  214. class CalendarDeleteFunction : public CalendarAsyncFunction {
  215. public:
  216. DECLARE_EXTENSION_FUNCTION("calendar.delete", CALENDAR_DELETE)
  217. CalendarDeleteFunction() = default;
  218. protected:
  219. ~CalendarDeleteFunction() override = default;
  220. // ExtensionFunction:
  221. ResponseAction Run() override;
  222. void DeleteCalendarComplete(
  223. std::shared_ptr<calendar::DeleteCalendarResult> results);
  224. // The task tracker for the CalendarService callbacks.
  225. base::CancelableTaskTracker task_tracker_;
  226. private:
  227. DISALLOW_COPY_AND_ASSIGN(CalendarDeleteFunction);
  228. };
  229. class CalendarGetAllEventTypesFunction : public CalendarAsyncFunction {
  230. public:
  231. DECLARE_EXTENSION_FUNCTION("calendar.getAllEventTypes",
  232. CALENDAR_GETALL_EVENT_TYPES)
  233. CalendarGetAllEventTypesFunction() = default;
  234. protected:
  235. ~CalendarGetAllEventTypesFunction() override = default;
  236. // ExtensionFunction:
  237. ResponseAction Run() override;
  238. // Callback for the calendar function to provide results.
  239. void GetAllEventTypesComplete(
  240. std::shared_ptr<calendar::EventTypeRows> results);
  241. private:
  242. // The task tracker for the CalendarService callbacks.
  243. base::CancelableTaskTracker task_tracker_;
  244. DISALLOW_COPY_AND_ASSIGN(CalendarGetAllEventTypesFunction);
  245. };
  246. class CalendarEventTypeCreateFunction : public CalendarAsyncFunction {
  247. public:
  248. DECLARE_EXTENSION_FUNCTION("calendar.eventTypeCreate",
  249. CALENDAR_CREATEEVENTTYPE)
  250. CalendarEventTypeCreateFunction() = default;
  251. protected:
  252. ~CalendarEventTypeCreateFunction() override = default;
  253. // ExtensionFunction:
  254. ResponseAction Run() override;
  255. // Callback for the calendar function to provide results.
  256. void CreateEventTypeComplete(
  257. std::shared_ptr<calendar::CreateEventTypeResult> results);
  258. private:
  259. // The task tracker for the CalendarService callbacks.
  260. base::CancelableTaskTracker task_tracker_;
  261. DISALLOW_COPY_AND_ASSIGN(CalendarEventTypeCreateFunction);
  262. };
  263. class CalendarEventTypeUpdateFunction : public CalendarAsyncFunction {
  264. public:
  265. DECLARE_EXTENSION_FUNCTION("calendar.eventTypeUpdate",
  266. CALENDAR_UPDATEEVENTTYPE)
  267. CalendarEventTypeUpdateFunction() = default;
  268. protected:
  269. ~CalendarEventTypeUpdateFunction() override = default;
  270. // ExtensionFunction:
  271. ResponseAction Run() override;
  272. // Callback for the calendar function to provide results.
  273. void UpdateEventTypeComplete(
  274. std::shared_ptr<calendar::UpdateEventTypeResult> results);
  275. private:
  276. // The task tracker for the CalendarService callbacks.
  277. base::CancelableTaskTracker task_tracker_;
  278. DISALLOW_COPY_AND_ASSIGN(CalendarEventTypeUpdateFunction);
  279. };
  280. class CalendarDeleteEventTypeFunction : public CalendarAsyncFunction {
  281. public:
  282. DECLARE_EXTENSION_FUNCTION("calendar.deleteEventType",
  283. CALENDAR_DELETEEVENTTYPE)
  284. CalendarDeleteEventTypeFunction() = default;
  285. protected:
  286. ~CalendarDeleteEventTypeFunction() override = default;
  287. // ExtensionFunction:
  288. ResponseAction Run() override;
  289. void DeleteEventTypeComplete(
  290. std::shared_ptr<calendar::DeleteEventTypeResult> result);
  291. // The task tracker for the CalendarService callbacks.
  292. base::CancelableTaskTracker task_tracker_;
  293. private:
  294. DISALLOW_COPY_AND_ASSIGN(CalendarDeleteEventTypeFunction);
  295. };
  296. class CalendarCreateEventExceptionFunction : public CalendarAsyncFunction {
  297. public:
  298. DECLARE_EXTENSION_FUNCTION("calendar.createEventException",
  299. CALENDAR_CREATE_EVENT_RECURRENCE_EXCEPTION)
  300. CalendarCreateEventExceptionFunction() = default;
  301. protected:
  302. ~CalendarCreateEventExceptionFunction() override = default;
  303. // ExtensionFunction:
  304. ResponseAction Run() override;
  305. // Callback for the calendar function to provide results.
  306. void CreateEventExceptionComplete(
  307. std::shared_ptr<calendar::EventResultCB> results);
  308. private:
  309. // The task tracker for the CalendarService callbacks.
  310. base::CancelableTaskTracker task_tracker_;
  311. DISALLOW_COPY_AND_ASSIGN(CalendarCreateEventExceptionFunction);
  312. };
  313. class CalendarGetAllNotificationsFunction
  314. : public CalendarFunctionWithCallback {
  315. DECLARE_EXTENSION_FUNCTION("calendar.getAllNotifications",
  316. CALENDAR_GETALL_NOTIFICATIONS)
  317. public:
  318. CalendarGetAllNotificationsFunction() = default;
  319. protected:
  320. ~CalendarGetAllNotificationsFunction() override = default;
  321. // ExtensionFunction:
  322. ResponseAction Run() override;
  323. void GetAllNotificationsComplete(
  324. std::shared_ptr<calendar::GetAllNotificationResult> results);
  325. private:
  326. DISALLOW_COPY_AND_ASSIGN(CalendarGetAllNotificationsFunction);
  327. };
  328. class CalendarCreateNotificationFunction : public CalendarAsyncFunction {
  329. public:
  330. DECLARE_EXTENSION_FUNCTION("calendar.createNotification",
  331. CALENDAR_CREATE_NOTIFICATION)
  332. CalendarCreateNotificationFunction() = default;
  333. protected:
  334. ~CalendarCreateNotificationFunction() override = default;
  335. // ExtensionFunction:
  336. ResponseAction Run() override;
  337. // Callback for the calendar function to provide results.
  338. void CreateNotificationComplete(
  339. std::shared_ptr<calendar::NotificationResult> results);
  340. private:
  341. // The task tracker for the CalendarService callbacks.
  342. base::CancelableTaskTracker task_tracker_;
  343. DISALLOW_COPY_AND_ASSIGN(CalendarCreateNotificationFunction);
  344. };
  345. class CalendarUpdateNotificationFunction : public CalendarFunctionWithCallback {
  346. public:
  347. DECLARE_EXTENSION_FUNCTION("calendar.updateNotification",
  348. CALENDAR_UPDATENOTIFICATION)
  349. CalendarUpdateNotificationFunction() = default;
  350. protected:
  351. ~CalendarUpdateNotificationFunction() override = default;
  352. // ExtensionFunction:
  353. ResponseAction Run() override;
  354. void UpdateNotificationComplete(
  355. std::shared_ptr<calendar::NotificationResult> results);
  356. private:
  357. DISALLOW_COPY_AND_ASSIGN(CalendarUpdateNotificationFunction);
  358. };
  359. class CalendarDeleteNotificationFunction : public CalendarAsyncFunction {
  360. public:
  361. DECLARE_EXTENSION_FUNCTION("calendar.deleteNotification",
  362. CALENDAR_DELETE_NOTIFICATION)
  363. CalendarDeleteNotificationFunction() = default;
  364. protected:
  365. ~CalendarDeleteNotificationFunction() override = default;
  366. // ExtensionFunction:
  367. ResponseAction Run() override;
  368. void DeleteNotificationComplete(
  369. std::shared_ptr<calendar::DeleteNotificationResult> results);
  370. // The task tracker for the CalendarService callbacks.
  371. base::CancelableTaskTracker task_tracker_;
  372. private:
  373. DISALLOW_COPY_AND_ASSIGN(CalendarDeleteNotificationFunction);
  374. };
  375. class CalendarCreateInviteFunction : public CalendarAsyncFunction {
  376. public:
  377. DECLARE_EXTENSION_FUNCTION("calendar.createInvite", CALENDAR_CREATE_INVITE)
  378. CalendarCreateInviteFunction() = default;
  379. protected:
  380. ~CalendarCreateInviteFunction() override = default;
  381. // ExtensionFunction:
  382. ResponseAction Run() override;
  383. // Callback for the calendar function to provide results.
  384. void CreateInviteComplete(std::shared_ptr<calendar::InviteResult> results);
  385. private:
  386. // The task tracker for the CalendarService callbacks.
  387. base::CancelableTaskTracker task_tracker_;
  388. DISALLOW_COPY_AND_ASSIGN(CalendarCreateInviteFunction);
  389. };
  390. class CalendarDeleteInviteFunction : public CalendarAsyncFunction {
  391. public:
  392. DECLARE_EXTENSION_FUNCTION("calendar.deleteInvite", CALENDAR_DELETE_INVITE)
  393. CalendarDeleteInviteFunction() = default;
  394. protected:
  395. ~CalendarDeleteInviteFunction() override = default;
  396. // ExtensionFunction:
  397. ResponseAction Run() override;
  398. void DeleteInviteComplete(
  399. std::shared_ptr<calendar::DeleteInviteResult> results);
  400. // The task tracker for the CalendarService callbacks.
  401. base::CancelableTaskTracker task_tracker_;
  402. private:
  403. DISALLOW_COPY_AND_ASSIGN(CalendarDeleteInviteFunction);
  404. };
  405. class CalendarUpdateInviteFunction : public CalendarAsyncFunction {
  406. public:
  407. DECLARE_EXTENSION_FUNCTION("calendar.updateInvite", CALENDAR_UPDATE_INVITE)
  408. CalendarUpdateInviteFunction() = default;
  409. protected:
  410. ~CalendarUpdateInviteFunction() override = default;
  411. // ExtensionFunction:
  412. ResponseAction Run() override;
  413. // Callback for the calendar function to provide results.
  414. void UpdateInviteComplete(std::shared_ptr<calendar::InviteResult> results);
  415. private:
  416. // The task tracker for the CalendarService callbacks.
  417. base::CancelableTaskTracker task_tracker_;
  418. DISALLOW_COPY_AND_ASSIGN(CalendarUpdateInviteFunction);
  419. };
  420. class CalendarCreateAccountFunction : public CalendarAsyncFunction {
  421. public:
  422. DECLARE_EXTENSION_FUNCTION("calendar.createAccount", CALENDAR_CREATE_ACCOUNT)
  423. CalendarCreateAccountFunction() = default;
  424. protected:
  425. ~CalendarCreateAccountFunction() override = default;
  426. // ExtensionFunction:
  427. ResponseAction Run() override;
  428. // Callback for the calendar function to provide results.
  429. void CreateAccountComplete(
  430. std::shared_ptr<calendar::CreateAccountResult> result);
  431. private:
  432. // The task tracker for the CalendarService callbacks.
  433. base::CancelableTaskTracker task_tracker_;
  434. DISALLOW_COPY_AND_ASSIGN(CalendarCreateAccountFunction);
  435. };
  436. class CalendarDeleteAccountFunction : public CalendarAsyncFunction {
  437. public:
  438. DECLARE_EXTENSION_FUNCTION("calendar.deleteAccount", CALENDAR_DELETEACCOUNT)
  439. CalendarDeleteAccountFunction() = default;
  440. protected:
  441. ~CalendarDeleteAccountFunction() override = default;
  442. // ExtensionFunction:
  443. ResponseAction Run() override;
  444. // Callback for the calendar function to provide results.
  445. void DeleteAccountComplete(
  446. std::shared_ptr<calendar::DeleteAccountResult> result);
  447. private:
  448. // The task tracker for the CalendarService callbacks.
  449. base::CancelableTaskTracker task_tracker_;
  450. DISALLOW_COPY_AND_ASSIGN(CalendarDeleteAccountFunction);
  451. };
  452. class CalendarUpdateAccountFunction : public CalendarAsyncFunction {
  453. public:
  454. DECLARE_EXTENSION_FUNCTION("calendar.updateAccount", CALENDAR_UPDATEACCOUNT)
  455. CalendarUpdateAccountFunction() = default;
  456. protected:
  457. ~CalendarUpdateAccountFunction() override = default;
  458. // ExtensionFunction:
  459. ResponseAction Run() override;
  460. // Callback for the calendar function to provide results.
  461. void UpdateAccountComplete(
  462. std::shared_ptr<calendar::UpdateAccountResult> result);
  463. private:
  464. // The task tracker for the CalendarService callbacks.
  465. base::CancelableTaskTracker task_tracker_;
  466. DISALLOW_COPY_AND_ASSIGN(CalendarUpdateAccountFunction);
  467. };
  468. class CalendarGetAllAccountsFunction : public CalendarFunctionWithCallback {
  469. DECLARE_EXTENSION_FUNCTION("calendar.getAllAccounts", CALENDAR_GETALLACCOUNTS)
  470. public:
  471. CalendarGetAllAccountsFunction() = default;
  472. protected:
  473. ~CalendarGetAllAccountsFunction() override = default;
  474. // ExtensionFunction:
  475. ResponseAction Run() override;
  476. // Callback for the calendar function to provide results.
  477. void GetAllAccountsComplete(std::shared_ptr<calendar::AccountRows> results);
  478. private:
  479. DISALLOW_COPY_AND_ASSIGN(CalendarGetAllAccountsFunction);
  480. };
  481. class CalendarGetAllEventTemplatesFunction
  482. : public CalendarFunctionWithCallback {
  483. DECLARE_EXTENSION_FUNCTION("calendar.getAllEventTemplates",
  484. CALENDAR_GETALLEVENT_TEMPLATES)
  485. public:
  486. CalendarGetAllEventTemplatesFunction() = default;
  487. protected:
  488. ~CalendarGetAllEventTemplatesFunction() override = default;
  489. // ExtensionFunction:
  490. ResponseAction Run() override;
  491. // Callback for the calendar function to provide results.
  492. void GetAllEventTemplatesComplete(
  493. std::shared_ptr<calendar::EventQueryResults> results);
  494. private:
  495. DISALLOW_COPY_AND_ASSIGN(CalendarGetAllEventTemplatesFunction);
  496. };
  497. } // namespace extensions
  498. #endif // EXTENSIONS_API_CALENDAR_CALENDAR_API_H_