OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/content_settings/host_content_settings_map.h" | 9 #include "chrome/browser/content_settings/host_content_settings_map.h" |
10 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 10 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
11 #include "chrome/browser/favicon/favicon_tab_helper.h" | 11 #include "chrome/browser/favicon/favicon_tab_helper.h" |
| 12 #include "chrome/browser/infobars/infobar_tab_helper.h" |
12 #include "chrome/browser/prefs/pref_service.h" | 13 #include "chrome/browser/prefs/pref_service.h" |
13 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" | 15 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" |
15 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper_delegate.
h" | 16 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper_delegate.
h" |
16 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
17 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" | 18 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" |
18 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 19 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
19 #include "chrome/common/chrome_notification_types.h" | 20 #include "chrome/common/chrome_notification_types.h" |
20 #include "chrome/common/pref_names.h" | 21 #include "chrome/common/pref_names.h" |
21 #include "chrome/common/render_messages.h" | 22 #include "chrome/common/render_messages.h" |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 Profile* profile, | 311 Profile* profile, |
311 ContentSettingsType content_type) | 312 ContentSettingsType content_type) |
312 : ContentSettingSingleRadioGroup( | 313 : ContentSettingSingleRadioGroup( |
313 browser, tab_contents, profile, content_type) { | 314 browser, tab_contents, profile, content_type) { |
314 DCHECK_EQ(CONTENT_SETTINGS_TYPE_COOKIES, content_type); | 315 DCHECK_EQ(CONTENT_SETTINGS_TYPE_COOKIES, content_type); |
315 set_custom_link_enabled(true); | 316 set_custom_link_enabled(true); |
316 } | 317 } |
317 | 318 |
318 virtual ~ContentSettingCookiesBubbleModel() { | 319 virtual ~ContentSettingCookiesBubbleModel() { |
319 if (settings_changed()) { | 320 if (settings_changed()) { |
320 tab_contents()->AddInfoBar( | 321 tab_contents()->infobar_tab_helper()->AddInfoBar( |
321 new CollectedCookiesInfoBarDelegate(tab_contents()->tab_contents())); | 322 new CollectedCookiesInfoBarDelegate(tab_contents()->tab_contents())); |
322 } | 323 } |
323 } | 324 } |
324 | 325 |
325 private: | 326 private: |
326 virtual void OnCustomLinkClicked() OVERRIDE { | 327 virtual void OnCustomLinkClicked() OVERRIDE { |
327 if (!tab_contents()) | 328 if (!tab_contents()) |
328 return; | 329 return; |
329 NotificationService::current()->Notify( | 330 NotificationService::current()->Notify( |
330 chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, | 331 chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 tab_contents_ = NULL; | 550 tab_contents_ = NULL; |
550 break; | 551 break; |
551 case chrome::NOTIFICATION_PROFILE_DESTROYED: | 552 case chrome::NOTIFICATION_PROFILE_DESTROYED: |
552 DCHECK(source == Source<Profile>(profile_)); | 553 DCHECK(source == Source<Profile>(profile_)); |
553 profile_ = NULL; | 554 profile_ = NULL; |
554 break; | 555 break; |
555 default: | 556 default: |
556 NOTREACHED(); | 557 NOTREACHED(); |
557 } | 558 } |
558 } | 559 } |
OLD | NEW |