| 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/content_settings/content_setting_bubble_model.h" | 5 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/api/infobars/infobar_service.h" | 8 #include "chrome/browser/api/infobars/infobar_service.h" |
| 9 #include "chrome/browser/content_settings/content_settings_utils.h" | 9 #include "chrome/browser/content_settings/content_settings_utils.h" |
| 10 #include "chrome/browser/content_settings/cookie_settings.h" | 10 #include "chrome/browser/content_settings/cookie_settings.h" |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 Profile* profile, | 372 Profile* profile, |
| 373 ContentSettingsType content_type) | 373 ContentSettingsType content_type) |
| 374 : ContentSettingSingleRadioGroup( | 374 : ContentSettingSingleRadioGroup( |
| 375 delegate, web_contents, profile, content_type) { | 375 delegate, web_contents, profile, content_type) { |
| 376 DCHECK_EQ(CONTENT_SETTINGS_TYPE_COOKIES, content_type); | 376 DCHECK_EQ(CONTENT_SETTINGS_TYPE_COOKIES, content_type); |
| 377 set_custom_link_enabled(true); | 377 set_custom_link_enabled(true); |
| 378 } | 378 } |
| 379 | 379 |
| 380 ContentSettingCookiesBubbleModel::~ContentSettingCookiesBubbleModel() { | 380 ContentSettingCookiesBubbleModel::~ContentSettingCookiesBubbleModel() { |
| 381 if (settings_changed()) { | 381 if (settings_changed()) { |
| 382 InfoBarService* infobar_service = | 382 CollectedCookiesInfoBarDelegate::Create( |
| 383 InfoBarService::FromWebContents(web_contents()); | 383 InfoBarService::FromWebContents(web_contents())); |
| 384 infobar_service->AddInfoBar( | |
| 385 new CollectedCookiesInfoBarDelegate(infobar_service)); | |
| 386 } | 384 } |
| 387 } | 385 } |
| 388 | 386 |
| 389 void ContentSettingCookiesBubbleModel::OnCustomLinkClicked() { | 387 void ContentSettingCookiesBubbleModel::OnCustomLinkClicked() { |
| 390 if (!web_contents()) | 388 if (!web_contents()) |
| 391 return; | 389 return; |
| 392 content::NotificationService::current()->Notify( | 390 content::NotificationService::current()->Notify( |
| 393 chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, | 391 chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, |
| 394 content::Source<TabSpecificContentSettings>( | 392 content::Source<TabSpecificContentSettings>( |
| 395 TabSpecificContentSettings::FromWebContents(web_contents())), | 393 TabSpecificContentSettings::FromWebContents(web_contents())), |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 818 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { | 816 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { |
| 819 DCHECK_EQ(web_contents_, | 817 DCHECK_EQ(web_contents_, |
| 820 content::Source<WebContents>(source).ptr()); | 818 content::Source<WebContents>(source).ptr()); |
| 821 web_contents_ = NULL; | 819 web_contents_ = NULL; |
| 822 } else { | 820 } else { |
| 823 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); | 821 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); |
| 824 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr()); | 822 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr()); |
| 825 profile_ = NULL; | 823 profile_ = NULL; |
| 826 } | 824 } |
| 827 } | 825 } |
| OLD | NEW |