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/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/content_settings/host_content_settings_map.h" | 8 #include "chrome/browser/content_settings/host_content_settings_map.h" |
9 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 9 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
10 #include "chrome/browser/favicon/favicon_tab_helper.h" | 10 #include "chrome/browser/favicon/favicon_tab_helper.h" |
11 #include "chrome/browser/infobars/infobar_tab_helper.h" | 11 #include "chrome/browser/infobars/infobar_tab_helper.h" |
12 #include "chrome/browser/prefs/pref_service.h" | 12 #include "chrome/browser/prefs/pref_service.h" |
13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" | 14 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" |
15 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper_delegate.
h" | 15 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper_delegate.
h" |
16 #include "chrome/browser/ui/browser.h" | 16 #include "chrome/browser/ui/browser.h" |
17 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" | 17 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" |
18 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 18 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
19 #include "chrome/common/chrome_notification_types.h" | 19 #include "chrome/common/chrome_notification_types.h" |
20 #include "chrome/common/pref_names.h" | 20 #include "chrome/common/pref_names.h" |
21 #include "chrome/common/render_messages.h" | 21 #include "chrome/common/render_messages.h" |
22 #include "content/browser/renderer_host/render_view_host.h" | 22 #include "content/browser/renderer_host/render_view_host.h" |
23 #include "content/browser/tab_contents/tab_contents.h" | 23 #include "content/browser/tab_contents/tab_contents.h" |
24 #include "content/browser/tab_contents/tab_contents_delegate.h" | 24 #include "content/browser/tab_contents/tab_contents_delegate.h" |
25 #include "content/browser/user_metrics.h" | 25 #include "content/browser/user_metrics.h" |
26 #include "content/common/notification_service.h" | 26 #include "content/public/browser/notification_service.h" |
27 #include "grit/generated_resources.h" | 27 #include "grit/generated_resources.h" |
28 #include "net/base/net_util.h" | 28 #include "net/base/net_util.h" |
29 #include "ui/base/l10n/l10n_util.h" | 29 #include "ui/base/l10n/l10n_util.h" |
30 | 30 |
31 namespace { | 31 namespace { |
32 | 32 |
33 struct ContentSettingsTypeIdEntry { | 33 struct ContentSettingsTypeIdEntry { |
34 ContentSettingsType type; | 34 ContentSettingsType type; |
35 int id; | 35 int id; |
36 }; | 36 }; |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 InfoBarTabHelper* infobar_helper = tab_contents()->infobar_tab_helper(); | 320 InfoBarTabHelper* infobar_helper = tab_contents()->infobar_tab_helper(); |
321 infobar_helper->AddInfoBar( | 321 infobar_helper->AddInfoBar( |
322 new CollectedCookiesInfoBarDelegate(infobar_helper)); | 322 new CollectedCookiesInfoBarDelegate(infobar_helper)); |
323 } | 323 } |
324 } | 324 } |
325 | 325 |
326 private: | 326 private: |
327 virtual void OnCustomLinkClicked() OVERRIDE { | 327 virtual void OnCustomLinkClicked() OVERRIDE { |
328 if (!tab_contents()) | 328 if (!tab_contents()) |
329 return; | 329 return; |
330 NotificationService::current()->Notify( | 330 content::NotificationService::current()->Notify( |
331 chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, | 331 chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, |
332 content::Source<TabSpecificContentSettings>( | 332 content::Source<TabSpecificContentSettings>( |
333 tab_contents()->content_settings()), | 333 tab_contents()->content_settings()), |
334 NotificationService::NoDetails()); | 334 content::NotificationService::NoDetails()); |
335 browser()->ShowCollectedCookiesDialog(tab_contents()); | 335 browser()->ShowCollectedCookiesDialog(tab_contents()); |
336 } | 336 } |
337 }; | 337 }; |
338 | 338 |
339 class ContentSettingPluginBubbleModel : public ContentSettingSingleRadioGroup { | 339 class ContentSettingPluginBubbleModel : public ContentSettingSingleRadioGroup { |
340 public: | 340 public: |
341 ContentSettingPluginBubbleModel(Browser* browser, | 341 ContentSettingPluginBubbleModel(Browser* browser, |
342 TabContentsWrapper* tab_contents, | 342 TabContentsWrapper* tab_contents, |
343 Profile* profile, | 343 Profile* profile, |
344 ContentSettingsType content_type) | 344 ContentSettingsType content_type) |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 tab_contents_ = NULL; | 553 tab_contents_ = NULL; |
554 break; | 554 break; |
555 case chrome::NOTIFICATION_PROFILE_DESTROYED: | 555 case chrome::NOTIFICATION_PROFILE_DESTROYED: |
556 DCHECK(source == content::Source<Profile>(profile_)); | 556 DCHECK(source == content::Source<Profile>(profile_)); |
557 profile_ = NULL; | 557 profile_ = NULL; |
558 break; | 558 break; |
559 default: | 559 default: |
560 NOTREACHED(); | 560 NOTREACHED(); |
561 } | 561 } |
562 } | 562 } |
OLD | NEW |