| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |