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

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

Issue 12221127: Actually prevent sending notifications from apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
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 "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "chrome/browser/extensions/api/api_function.h" 9 #include "chrome/browser/extensions/api/api_function.h"
10 #include "chrome/browser/extensions/extension_function.h" 10 #include "chrome/browser/extensions/extension_function.h"
11 #include "chrome/common/extensions/api/experimental_notification.h" 11 #include "chrome/common/extensions/api/experimental_notification.h"
12 12
13 #include <string> 13 #include <string>
14 14
15 namespace extensions { 15 namespace extensions {
16 16
17 class NotificationApiFunction : public ApiFunction { 17 class NotificationApiFunction : public ApiFunction {
18 protected: 18 protected:
19 NotificationApiFunction(); 19 NotificationApiFunction();
20 virtual ~NotificationApiFunction(); 20 virtual ~NotificationApiFunction();
21 21
22 void CreateNotification( 22 void CreateNotification(
23 const std::string& id, 23 const std::string& id,
24 api::experimental_notification::NotificationOptions* options); 24 api::experimental_notification::NotificationOptions* options);
25
26 bool IsNotificationApiEnabled();
25 }; 27 };
26 28
27 class NotificationCreateFunction : public NotificationApiFunction { 29 class NotificationCreateFunction : public NotificationApiFunction {
28 public: 30 public:
29 NotificationCreateFunction(); 31 NotificationCreateFunction();
30 32
31 // UIThreadExtensionFunction: 33 // UIThreadExtensionFunction:
32 virtual bool RunImpl() OVERRIDE; 34 virtual bool RunImpl() OVERRIDE;
33 35
34 protected: 36 protected:
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 private: 73 private:
72 scoped_ptr<api::experimental_notification::Delete::Params> params_; 74 scoped_ptr<api::experimental_notification::Delete::Params> params_;
73 75
74 DECLARE_EXTENSION_FUNCTION("experimental.notification.delete", 76 DECLARE_EXTENSION_FUNCTION("experimental.notification.delete",
75 EXPERIMENTAL_NOTIFICATION_DELETE) 77 EXPERIMENTAL_NOTIFICATION_DELETE)
76 }; 78 };
77 79
78 } // namespace extensions 80 } // namespace extensions
79 81
80 #endif // CHROME_BROWSER_EXTENSIONS_API_NOTIFICATION_NOTIFICATION_API_H_ 82 #endif // CHROME_BROWSER_EXTENSIONS_API_NOTIFICATION_NOTIFICATION_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698