summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/app_notification.h
diff options
context:
space:
mode:
authorasargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-26 21:03:43 +0000
committerasargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-26 21:03:43 +0000
commit015ce6ebccb611b40e09c237042912840d2d1a4f (patch)
treee8b3d0db17999c58be3efef6a946f2eeb6a4d3b6 /chrome/browser/extensions/app_notification.h
parentd4cba0a8cbcead734975d7fe995856b7a40a76ed (diff)
downloadchromium_src-015ce6ebccb611b40e09c237042912840d2d1a4f.zip
chromium_src-015ce6ebccb611b40e09c237042912840d2d1a4f.tar.gz
chromium_src-015ce6ebccb611b40e09c237042912840d2d1a4f.tar.bz2
Move AppNotification and AppNotificationManager into their own files.
Previously they were defined inside extension_app_api.{h,cc}. Also: -Change AppNotification from a struct to a class. -Remove iconData parameter from notify function (support was never actually implemented) This CL is preparation for persisting the app notifications to disk. BUG=none TEST=none Review URL: http://codereview.chromium.org/8041007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102796 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/app_notification.h')
-rw-r--r--chrome/browser/extensions/app_notification.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/chrome/browser/extensions/app_notification.h b/chrome/browser/extensions/app_notification.h
new file mode 100644
index 0000000..95cf1f4
--- /dev/null
+++ b/chrome/browser/extensions/app_notification.h
@@ -0,0 +1,44 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_EXTENSIONS_APP_NOTIFICATION_H_
+#define CHROME_BROWSER_EXTENSIONS_APP_NOTIFICATION_H_
+#pragma once
+
+#include <string>
+#include <vector>
+
+#include "base/memory/linked_ptr.h"
+#include "googleurl/src/gurl.h"
+
+// This class is used to represent a notification for an installed app, to be
+// displayed on the New Tab Page.
+class AppNotification {
+ public:
+ AppNotification(const std::string& title, const std::string& body);
+ ~AppNotification();
+
+ // Setters for optional properties.
+ void set_link_url(const GURL& url) { link_url_ = url; }
+ void set_link_text(const std::string& text) { link_text_ = text; }
+
+ // Accessors.
+ const std::string& title() const { return title_; }
+ const std::string& body() const { return body_; }
+ const GURL& link_url() const { return link_url_; }
+ const std::string& link_text() const { return link_text_; }
+
+ private:
+ std::string title_;
+ std::string body_;
+ GURL link_url_;
+ std::string link_text_;
+
+ DISALLOW_COPY_AND_ASSIGN(AppNotification);
+};
+
+// A list of AppNotification's.
+typedef std::vector<linked_ptr<AppNotification> > AppNotificationList;
+
+#endif // CHROME_BROWSER_EXTENSIONS_APP_NOTIFICATION_H_