| Index: chrome/browser/notifications/notification.h
|
| diff --git a/chrome/browser/notifications/notification.h b/chrome/browser/notifications/notification.h
|
| new file mode 100755
|
| index 0000000000000000000000000000000000000000..b0f29740921f204f6cd75d17506419baebc1369a
|
| --- /dev/null
|
| +++ b/chrome/browser/notifications/notification.h
|
| @@ -0,0 +1,59 @@
|
| +// Copyright (c) 2009 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_NOTIFICATIONS_NOTIFICATION_H_
|
| +#define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_H_
|
| +
|
| +#include "base/basictypes.h"
|
| +#include "googleurl/src/gurl.h"
|
| +#include "notification_object_proxy.h"
|
| +
|
| +// Representation of an HTML notification.
|
| +class Notification {
|
| + public:
|
| + Notification(const GURL& origin_url,
|
| + const GURL& content_url,
|
| + NotificationObjectProxy* proxy)
|
| + : origin_url_(origin_url),
|
| + content_url_(content_url),
|
| + proxy_(proxy) {
|
| + }
|
| +
|
| + Notification(const Notification& notification)
|
| + : origin_url_(notification.origin_url()),
|
| + content_url_(notification.content_url()),
|
| + proxy_(notification.proxy()) {
|
| + }
|
| +
|
| + const GURL& content_url() const {
|
| + return content_url_;
|
| + }
|
| +
|
| + const GURL& origin_url() const {
|
| + return origin_url_;
|
| + }
|
| +
|
| + void display() const { proxy()->display(); }
|
| + void error() const { proxy()->error(); }
|
| + void close(bool xplicit) const { proxy()->close(xplicit); }
|
| +
|
| + private:
|
| + NotificationObjectProxy* proxy() const { return proxy_.get(); }
|
| +
|
| + // The URL of the page/worker which created this notification.
|
| + GURL origin_url_;
|
| +
|
| + // The URL of the HTML content of the toast (may be a data: URL for simple
|
| + // string-based notifications).
|
| + GURL content_url_;
|
| +
|
| + // A proxy object that allows access back to the JavaScript object that
|
| + // represents the notification, for firing events.
|
| + scoped_refptr<NotificationObjectProxy> proxy_;
|
| +
|
| + // Disallow assign. Copy constructor written above.
|
| + void operator=(const Notification&);
|
| +};
|
| +
|
| +#endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_H_
|
|
|