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

Side by Side Diff: chrome/browser/ui/views/frame/browser_bubble_host.cc

Issue 8673009: Remove unused BrowserBubble remnants. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove more stale code. Created 9 years 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
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/views/frame/browser_bubble_host.h"
6
7 #include "base/logging.h"
8 #include "chrome/browser/ui/views/browser_bubble.h"
9
10 BrowserBubbleHost::BrowserBubbleHost() {}
11
12 BrowserBubbleHost::~BrowserBubbleHost() {}
13
14 void BrowserBubbleHost::WindowMoved() {
15 // Do safe iteration in case the bubble winds up closing as a result of this
16 // message.
17 for (BubbleSet::iterator i = browser_bubbles_.begin();
18 i != browser_bubbles_.end();) {
19 BubbleSet::iterator bubble = i++;
20 (*bubble)->BrowserWindowMoved();
21 }
22 }
23
24 void BrowserBubbleHost::AttachBrowserBubble(BrowserBubble* bubble) {
25 DCHECK(browser_bubbles_.find(bubble) == browser_bubbles_.end()) <<
26 "Attempt to register the same BrowserBubble multiple times.";
27 browser_bubbles_.insert(bubble);
28 }
29
30 void BrowserBubbleHost::DetachBrowserBubble(BrowserBubble* bubble) {
31 BubbleSet::iterator it = browser_bubbles_.find(bubble);
32 DCHECK(it != browser_bubbles_.end()) <<
33 "Attempt to detach an unrecognized BrowserBubble.";
34 if (it != browser_bubbles_.end())
35 browser_bubbles_.erase(it);
36 }
37
38 void BrowserBubbleHost::Close() {
39 // BrowserWindowClosing will usually cause the bubble to remove itself from
40 // the set, so we need to iterate in a way that's safe against deletion.
41 for (BubbleSet::iterator i = browser_bubbles_.begin();
42 i != browser_bubbles_.end();) {
43 BubbleSet::iterator bubble = i++;
44 (*bubble)->BrowserWindowClosing();
45 }
46 }
47
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_bubble_host.h ('k') | chrome/browser/ui/views/frame/browser_frame_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698