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

Side by Side Diff: components/infobars/core/infobar_manager.cc

Issue 240193003: Move Infobars core files to the Infobars component (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix components/OWNERS Created 6 years, 8 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/infobars/infobar_manager.h" 5 #include "components/infobars/core/infobar_manager.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/infobars/infobar.h" 8 #include "components/infobars/core/infobar.h"
9 #include "chrome/common/chrome_switches.h" 9 #include "components/infobars/core/infobars_switches.h"
10 10
11 InfoBar* InfoBarManager::AddInfoBar(scoped_ptr<InfoBar> infobar) { 11 InfoBar* InfoBarManager::AddInfoBar(scoped_ptr<InfoBar> infobar) {
12 DCHECK(infobar); 12 DCHECK(infobar);
13 if (!infobars_enabled_) 13 if (!infobars_enabled_)
14 return NULL; 14 return NULL;
15 15
16 for (InfoBars::const_iterator i(infobars_.begin()); i != infobars_.end(); 16 for (InfoBars::const_iterator i(infobars_.begin()); i != infobars_.end();
17 ++i) { 17 ++i) {
18 if ((*i)->delegate()->EqualsDelegate(infobar->delegate())) { 18 if ((*i)->delegate()->EqualsDelegate(infobar->delegate())) {
19 DCHECK_NE((*i)->delegate(), infobar->delegate()); 19 DCHECK_NE((*i)->delegate(), infobar->delegate());
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 // Remove the infobar before notifying, so that if any observers call back to 128 // Remove the infobar before notifying, so that if any observers call back to
129 // AddInfoBar() or similar, we don't dupe-check against this infobar. 129 // AddInfoBar() or similar, we don't dupe-check against this infobar.
130 infobars_.erase(i); 130 infobars_.erase(i);
131 131
132 // This notification must happen before the call to CloseSoon() below, since 132 // This notification must happen before the call to CloseSoon() below, since
133 // observers may want to access |infobar| and that call can delete it. 133 // observers may want to access |infobar| and that call can delete it.
134 NotifyInfoBarRemoved(infobar, animate); 134 NotifyInfoBarRemoved(infobar, animate);
135 135
136 infobar->CloseSoon(); 136 infobar->CloseSoon();
137 } 137 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698