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

Side by Side Diff: chrome/browser/ui/website_settings/website_settings_unittest.cc

Issue 11644059: Change infobar creation to use a public static Create() method on the infobar delegate classes. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 11 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 (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/ui/website_settings/website_settings.h" 5 #include "chrome/browser/ui/website_settings/website_settings.h"
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/string16.h" 9 #include "base/string16.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 CONTENT_SETTINGS_TYPE_GEOLOCATION, CONTENT_SETTING_ALLOW); 395 CONTENT_SETTINGS_TYPE_GEOLOCATION, CONTENT_SETTING_ALLOW);
396 website_settings()->OnUIClosing(); 396 website_settings()->OnUIClosing();
397 EXPECT_EQ(1u, infobar_service()->GetInfoBarCount()); 397 EXPECT_EQ(1u, infobar_service()->GetInfoBarCount());
398 398
399 // Removing an |InfoBarDelegate| from the |InfoBarService| does not delete 399 // Removing an |InfoBarDelegate| from the |InfoBarService| does not delete
400 // it. Hence the |delegate| must be cleaned up after it was removed from the 400 // it. Hence the |delegate| must be cleaned up after it was removed from the
401 // |infobar_service|. 401 // |infobar_service|.
402 scoped_ptr<InfoBarDelegate> delegate( 402 scoped_ptr<InfoBarDelegate> delegate(
403 infobar_service()->GetInfoBarDelegateAt(0)); 403 infobar_service()->GetInfoBarDelegateAt(0));
404 infobar_service()->RemoveInfoBar(delegate.get()); 404 infobar_service()->RemoveInfoBar(delegate.get());
405 // Right now InfoBarDelegates delete themselves via
406 // InfoBarClosed(); once InfoBars own their delegates, this can become a
407 // simple reset() call
408 delegate.release()->InfoBarClosed();
409 } 405 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/website_settings/website_settings_infobar_delegate.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698