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

Side by Side Diff: chrome/browser/notifications/balloon_collection_impl.cc

Issue 9692070: Ensure both PanelBrowserWindowGtk and BalloonCollectionImpl call RemoveObserver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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/ui/panels/panel_browser_window_gtk.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 #include "chrome/browser/notifications/balloon_collection_impl.h" 5 #include "chrome/browser/notifications/balloon_collection_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "chrome/browser/notifications/balloon.h" 10 #include "chrome/browser/notifications/balloon.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 content::NotificationService::AllSources()); 49 content::NotificationService::AllSources());
50 registrar_.Add(this, chrome::NOTIFICATION_PANEL_CLOSED, 50 registrar_.Add(this, chrome::NOTIFICATION_PANEL_CLOSED,
51 content::NotificationService::AllSources()); 51 content::NotificationService::AllSources());
52 registrar_.Add(this, chrome::NOTIFICATION_PANEL_CHANGED_BOUNDS, 52 registrar_.Add(this, chrome::NOTIFICATION_PANEL_CHANGED_BOUNDS,
53 content::NotificationService::AllSources()); 53 content::NotificationService::AllSources());
54 54
55 SetPositionPreference(BalloonCollection::DEFAULT_POSITION); 55 SetPositionPreference(BalloonCollection::DEFAULT_POSITION);
56 } 56 }
57 57
58 BalloonCollectionImpl::~BalloonCollectionImpl() { 58 BalloonCollectionImpl::~BalloonCollectionImpl() {
59 #if USE_OFFSETS
60 RemoveMessageLoopObserver();
61 #endif
59 } 62 }
60 63
61 void BalloonCollectionImpl::AddImpl(const Notification& notification, 64 void BalloonCollectionImpl::AddImpl(const Notification& notification,
62 Profile* profile, 65 Profile* profile,
63 bool add_to_front) { 66 bool add_to_front) {
64 Balloon* new_balloon = MakeBalloon(notification, profile); 67 Balloon* new_balloon = MakeBalloon(notification, profile);
65 // The +1 on width is necessary because width is fixed on notifications, 68 // The +1 on width is necessary because width is fixed on notifications,
66 // so since we always have the max size, we would always hit the scrollbar 69 // so since we always have the max size, we would always hit the scrollbar
67 // condition. We are only interested in comparing height to maximum. 70 // condition. We are only interested in comparing height to maximum.
68 new_balloon->set_min_scrollbar_size(gfx::Size(1 + layout_.max_balloon_width(), 71 new_balloon->set_min_scrollbar_size(gfx::Size(1 + layout_.max_balloon_width(),
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 gfx::Rect new_work_area = gfx::Screen::GetPrimaryMonitorWorkArea(); 489 gfx::Rect new_work_area = gfx::Screen::GetPrimaryMonitorWorkArea();
487 #endif 490 #endif
488 if (!work_area_.Equals(new_work_area)) { 491 if (!work_area_.Equals(new_work_area)) {
489 work_area_.SetRect(new_work_area.x(), new_work_area.y(), 492 work_area_.SetRect(new_work_area.x(), new_work_area.y(),
490 new_work_area.width(), new_work_area.height()); 493 new_work_area.width(), new_work_area.height());
491 changed = true; 494 changed = true;
492 } 495 }
493 496
494 return changed; 497 return changed;
495 } 498 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/panels/panel_browser_window_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698