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

Side by Side Diff: chrome/browser/extensions/api/notification/notification_api.h

Issue 12212037: Update notifications API after review. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge conflict resolved Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/api/notification/notification_api.cc » ('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 (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 #ifndef CHROME_BROWSER_EXTENSIONS_API_NOTIFICATION_NOTIFICATION_API_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_NOTIFICATION_NOTIFICATION_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_NOTIFICATION_NOTIFICATION_API_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_NOTIFICATION_NOTIFICATION_API_H_
7 7
8 #include <string>
9
8 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
9 #include "chrome/browser/extensions/api/api_function.h" 11 #include "chrome/browser/extensions/api/api_function.h"
10 #include "chrome/browser/extensions/extension_function.h" 12 #include "chrome/browser/extensions/extension_function.h"
11 #include "chrome/common/extensions/api/experimental_notification.h" 13 #include "chrome/common/extensions/api/experimental_notification.h"
12 14 #include "ui/notifications/notification_types.h"
13 #include <string>
14 15
15 namespace extensions { 16 namespace extensions {
16 17
17 class NotificationApiFunction : public ApiFunction { 18 class NotificationApiFunction : public ApiFunction {
18 protected: 19 protected:
19 NotificationApiFunction(); 20 NotificationApiFunction();
20 virtual ~NotificationApiFunction(); 21 virtual ~NotificationApiFunction();
21 22
22 void CreateNotification( 23 void CreateNotification(
23 const std::string& id, 24 const std::string& id,
24 api::experimental_notification::NotificationOptions* options); 25 api::experimental_notification::NotificationOptions* options);
25 26
26 bool IsNotificationApiEnabled(); 27 bool IsNotificationApiEnabled();
27 28
28 // Called inside of RunImpl. 29 // Called inside of RunImpl.
29 virtual bool RunNotificationApi() = 0; 30 virtual bool RunNotificationApi() = 0;
30 31
31 // UITHreadExtensionFunction: 32 // UITHreadExtensionFunction:
32 virtual bool RunImpl() OVERRIDE; 33 virtual bool RunImpl() OVERRIDE;
34
35 ui::notifications::NotificationType MapApiTemplateTypeToType(
36 api::experimental_notification::TemplateType type);
33 }; 37 };
34 38
35 class NotificationCreateFunction : public NotificationApiFunction { 39 class NotificationCreateFunction : public NotificationApiFunction {
36 public: 40 public:
37 NotificationCreateFunction(); 41 NotificationCreateFunction();
38 42
39 // UIThreadExtensionFunction: 43 // UIThreadExtensionFunction:
40 virtual bool RunNotificationApi() OVERRIDE; 44 virtual bool RunNotificationApi() OVERRIDE;
41 45
42 protected: 46 protected:
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 private: 83 private:
80 scoped_ptr<api::experimental_notification::Delete::Params> params_; 84 scoped_ptr<api::experimental_notification::Delete::Params> params_;
81 85
82 DECLARE_EXTENSION_FUNCTION("experimental.notification.delete", 86 DECLARE_EXTENSION_FUNCTION("experimental.notification.delete",
83 EXPERIMENTAL_NOTIFICATION_DELETE) 87 EXPERIMENTAL_NOTIFICATION_DELETE)
84 }; 88 };
85 89
86 } // namespace extensions 90 } // namespace extensions
87 91
88 #endif // CHROME_BROWSER_EXTENSIONS_API_NOTIFICATION_NOTIFICATION_API_H_ 92 #endif // CHROME_BROWSER_EXTENSIONS_API_NOTIFICATION_NOTIFICATION_API_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/notification/notification_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698