| 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 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 set_radio_group_enabled(true); | 588 set_radio_group_enabled(true); |
| 589 } | 589 } |
| 590 | 590 |
| 591 void ContentSettingMediaStreamBubbleModel::UpdateSettings( | 591 void ContentSettingMediaStreamBubbleModel::UpdateSettings( |
| 592 ContentSetting setting) { | 592 ContentSetting setting) { |
| 593 if (profile()) { | 593 if (profile()) { |
| 594 HostContentSettingsMap* content_settings = | 594 HostContentSettingsMap* content_settings = |
| 595 profile()->GetHostContentSettingsMap(); | 595 profile()->GetHostContentSettingsMap(); |
| 596 // The same patterns must be used as in other places (e.g. the infobar) in | 596 // The same patterns must be used as in other places (e.g. the infobar) in |
| 597 // order to override the existing rule. Otherwise a new rule is created. | 597 // order to override the existing rule. Otherwise a new rule is created. |
| 598 // TODO(markusheintz): Extract to a helper so thath there is only a single | 598 // TODO(markusheintz): Extract to a helper so that there is only a single |
| 599 // place to touch. | 599 // place to touch. |
| 600 ContentSettingsPattern primary_pattern = | 600 ContentSettingsPattern primary_pattern = |
| 601 ContentSettingsPattern::FromURLNoWildcard(web_contents()->GetURL()); | 601 ContentSettingsPattern::FromURLNoWildcard(web_contents()->GetURL()); |
| 602 ContentSettingsPattern secondary_pattern = | 602 ContentSettingsPattern secondary_pattern = |
| 603 ContentSettingsPattern::Wildcard(); | 603 ContentSettingsPattern::Wildcard(); |
| 604 content_settings->SetContentSetting( | 604 content_settings->SetContentSetting( |
| 605 primary_pattern, secondary_pattern, | 605 primary_pattern, secondary_pattern, |
| 606 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, "", setting); | 606 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, std::string(), setting); |
| 607 content_settings->SetContentSetting( | 607 content_settings->SetContentSetting( |
| 608 primary_pattern, secondary_pattern, | 608 primary_pattern, secondary_pattern, |
| 609 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, "", setting); | 609 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, std::string(), setting); |
| 610 } | 610 } |
| 611 } | 611 } |
| 612 | 612 |
| 613 void ContentSettingMediaStreamBubbleModel::OnRadioClicked(int radio_index) { | 613 void ContentSettingMediaStreamBubbleModel::OnRadioClicked(int radio_index) { |
| 614 selected_item_ = radio_index; | 614 selected_item_ = radio_index; |
| 615 } | 615 } |
| 616 | 616 |
| 617 class ContentSettingDomainListBubbleModel | 617 class ContentSettingDomainListBubbleModel |
| 618 : public ContentSettingTitleAndLinkModel { | 618 : public ContentSettingTitleAndLinkModel { |
| 619 public: | 619 public: |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 951 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { | 951 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { |
| 952 DCHECK_EQ(web_contents_, | 952 DCHECK_EQ(web_contents_, |
| 953 content::Source<WebContents>(source).ptr()); | 953 content::Source<WebContents>(source).ptr()); |
| 954 web_contents_ = NULL; | 954 web_contents_ = NULL; |
| 955 } else { | 955 } else { |
| 956 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); | 956 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); |
| 957 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr()); | 957 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr()); |
| 958 profile_ = NULL; | 958 profile_ = NULL; |
| 959 } | 959 } |
| 960 } | 960 } |
| OLD | NEW |