diff options
author | johnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-18 01:46:07 +0000 |
---|---|---|
committer | johnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-18 01:46:07 +0000 |
commit | 301e5f36c2539ddebd68d98eec9a2c91480d477f (patch) | |
tree | e2f00243ab9367d74fad3f3427a726a771f08b26 /chrome/browser/notifications/balloon_collection_base.h | |
parent | cb0612ea5b10d6003de853d0339869df5adcc985 (diff) | |
download | chromium_src-301e5f36c2539ddebd68d98eec9a2c91480d477f.zip chromium_src-301e5f36c2539ddebd68d98eec9a2c91480d477f.tar.gz chromium_src-301e5f36c2539ddebd68d98eec9a2c91480d477f.tar.bz2 |
Revert 66571 - When an extension is uninstalled, close all desktop notifications from that extension.
This change also refactors the balloon collection code to remove duplication between chrome and chromeos.
Removes some gross removal code which was using fake notifications just to get the right ID.
BUG=58266
TEST=open notifications from extension, uninstall extensions
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=65879
Review URL: http://codereview.chromium.org/4635007
TBR=johnnyg@chromium.org
Review URL: http://codereview.chromium.org/5162003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66572 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/notifications/balloon_collection_base.h')
-rw-r--r-- | chrome/browser/notifications/balloon_collection_base.h | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/chrome/browser/notifications/balloon_collection_base.h b/chrome/browser/notifications/balloon_collection_base.h deleted file mode 100644 index 8511030..0000000 --- a/chrome/browser/notifications/balloon_collection_base.h +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) 2010 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. - -// Handles the visible notification (or balloons). - -#ifndef CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_BASE_H_ -#define CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_BASE_H_ -#pragma once - -#include <deque> -#include <string> - -#include "base/basictypes.h" - -class Balloon; -class GURL; -class Notification; - -// This class provides support for implementing a BalloonCollection -// including the parts common between Chrome UI and ChromeOS UI. -class BalloonCollectionBase { - public: - BalloonCollectionBase(); - virtual ~BalloonCollectionBase(); - - typedef std::deque<Balloon*> Balloons; - - // Adds a balloon to the collection. Takes ownership of pointer. - virtual void Add(Balloon* balloon); - - // Removes a balloon from the collection (if present). Frees - // the pointer after removal. - virtual void Remove(Balloon* balloon); - - // Finds any balloon matching the given notification id, and - // calls CloseByScript on it. Returns true if anything was - // found. - virtual bool CloseById(const std::string& id); - - // Finds all balloons matching the given notification source, - // and calls CloseByScript on them. Returns true if anything - // was found. - virtual bool CloseAllBySourceOrigin(const GURL& source_origin); - - const Balloons& balloons() const { return balloons_; } - - // Returns the balloon matching the given notification, or - // NULL if there is no matching balloon. - Balloon* FindBalloon(const Notification& notification); - - // The number of balloons being displayed. - int count() const { return static_cast<int>(balloons_.size()); } - - private: - // Queue of active balloons. Pointers are owned by this class. - Balloons balloons_; - - DISALLOW_COPY_AND_ASSIGN(BalloonCollectionBase); -}; - -#endif // CHROME_BROWSER_NOTIFICATIONS_BALLOON_COLLECTION_BASE_H_ |