| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" |
| (...skipping 1229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1240 ~ContentSettingSubresourceFilterBubbleModel() {} | 1240 ~ContentSettingSubresourceFilterBubbleModel() {} |
| 1241 | 1241 |
| 1242 void ContentSettingSubresourceFilterBubbleModel::SetTitle() { | 1242 void ContentSettingSubresourceFilterBubbleModel::SetTitle() { |
| 1243 set_title( | 1243 set_title( |
| 1244 l10n_util::GetStringUTF16(IDS_FILTERED_DECEPTIVE_CONTENT_PROMPT_TITLE)); | 1244 l10n_util::GetStringUTF16(IDS_FILTERED_DECEPTIVE_CONTENT_PROMPT_TITLE)); |
| 1245 } | 1245 } |
| 1246 | 1246 |
| 1247 void ContentSettingSubresourceFilterBubbleModel::SetManageText() { | 1247 void ContentSettingSubresourceFilterBubbleModel::SetManageText() { |
| 1248 set_manage_text( | 1248 set_manage_text( |
| 1249 l10n_util::GetStringUTF8(IDS_FILTERED_DECEPTIVE_CONTENT_PROMPT_RELOAD)); | 1249 l10n_util::GetStringUTF8(IDS_FILTERED_DECEPTIVE_CONTENT_PROMPT_RELOAD)); |
| 1250 set_show_manage_text_as_button(true); | 1250 set_show_manage_text_as_checkbox(true); |
| 1251 } | 1251 } |
| 1252 | 1252 |
| 1253 void ContentSettingSubresourceFilterBubbleModel::SetMessage() { | 1253 void ContentSettingSubresourceFilterBubbleModel::SetMessage() { |
| 1254 set_message(l10n_util::GetStringUTF16( | 1254 set_message(l10n_util::GetStringUTF16( |
| 1255 IDS_FILTERED_DECEPTIVE_CONTENT_PROMPT_EXPLANATION)); | 1255 IDS_FILTERED_DECEPTIVE_CONTENT_PROMPT_EXPLANATION)); |
| 1256 } | 1256 } |
| 1257 | 1257 |
| 1258 void ContentSettingSubresourceFilterBubbleModel::OnManageLinkClicked() { | 1258 void ContentSettingSubresourceFilterBubbleModel::OnManageCheckboxChecked( |
| 1259 subresource_filter::ContentSubresourceFilterDriverFactory* driver_factory = | 1259 bool is_checked) { |
| 1260 subresource_filter::ContentSubresourceFilterDriverFactory:: | 1260 if (is_checked) |
| 1261 FromWebContents(web_contents()); | 1261 set_done_button_text(l10n_util::GetStringUTF16(IDS_APP_MENU_RELOAD)); |
| 1262 driver_factory->OnReloadRequested(); | 1262 else |
| 1263 set_done_button_text(base::string16()); |
| 1264 is_checked_ = is_checked; |
| 1265 } |
| 1266 |
| 1267 void ContentSettingSubresourceFilterBubbleModel::OnDoneClicked() { |
| 1268 if (is_checked_) { |
| 1269 subresource_filter::ContentSubresourceFilterDriverFactory* driver_factory = |
| 1270 subresource_filter::ContentSubresourceFilterDriverFactory:: |
| 1271 FromWebContents(web_contents()); |
| 1272 driver_factory->OnReloadRequested(); |
| 1273 } |
| 1263 } | 1274 } |
| 1264 | 1275 |
| 1265 ContentSettingSubresourceFilterBubbleModel* | 1276 ContentSettingSubresourceFilterBubbleModel* |
| 1266 ContentSettingSubresourceFilterBubbleModel::AsSubresourceFilterBubbleModel() { | 1277 ContentSettingSubresourceFilterBubbleModel::AsSubresourceFilterBubbleModel() { |
| 1267 return this; | 1278 return this; |
| 1268 } | 1279 } |
| 1269 | 1280 |
| 1270 // ContentSettingMidiSysExBubbleModel ------------------------------------------ | 1281 // ContentSettingMidiSysExBubbleModel ------------------------------------------ |
| 1271 | 1282 |
| 1272 class ContentSettingMidiSysExBubbleModel | 1283 class ContentSettingMidiSysExBubbleModel |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1547 | 1558 |
| 1548 ContentSettingBubbleModel::DomainList::~DomainList() {} | 1559 ContentSettingBubbleModel::DomainList::~DomainList() {} |
| 1549 | 1560 |
| 1550 ContentSettingBubbleModel::MediaMenu::MediaMenu() : disabled(false) {} | 1561 ContentSettingBubbleModel::MediaMenu::MediaMenu() : disabled(false) {} |
| 1551 | 1562 |
| 1552 ContentSettingBubbleModel::MediaMenu::MediaMenu(const MediaMenu& other) = | 1563 ContentSettingBubbleModel::MediaMenu::MediaMenu(const MediaMenu& other) = |
| 1553 default; | 1564 default; |
| 1554 | 1565 |
| 1555 ContentSettingBubbleModel::MediaMenu::~MediaMenu() {} | 1566 ContentSettingBubbleModel::MediaMenu::~MediaMenu() {} |
| 1556 | 1567 |
| 1557 ContentSettingBubbleModel::BubbleContent::BubbleContent() | 1568 ContentSettingBubbleModel::BubbleContent::BubbleContent() {} |
| 1558 : radio_group_enabled(false), | |
| 1559 custom_link_enabled(false), | |
| 1560 show_manage_text_as_button(false) {} | |
| 1561 | 1569 |
| 1562 ContentSettingBubbleModel::BubbleContent::~BubbleContent() {} | 1570 ContentSettingBubbleModel::BubbleContent::~BubbleContent() {} |
| 1563 | 1571 |
| 1564 void ContentSettingBubbleModel::Observe( | 1572 void ContentSettingBubbleModel::Observe( |
| 1565 int type, | 1573 int type, |
| 1566 const content::NotificationSource& source, | 1574 const content::NotificationSource& source, |
| 1567 const content::NotificationDetails& details) { | 1575 const content::NotificationDetails& details) { |
| 1568 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { | 1576 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { |
| 1569 DCHECK_EQ(web_contents_, | 1577 DCHECK_EQ(web_contents_, |
| 1570 content::Source<WebContents>(source).ptr()); | 1578 content::Source<WebContents>(source).ptr()); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1590 | 1598 |
| 1591 ContentSettingSubresourceFilterBubbleModel* | 1599 ContentSettingSubresourceFilterBubbleModel* |
| 1592 ContentSettingBubbleModel::AsSubresourceFilterBubbleModel() { | 1600 ContentSettingBubbleModel::AsSubresourceFilterBubbleModel() { |
| 1593 return nullptr; | 1601 return nullptr; |
| 1594 } | 1602 } |
| 1595 | 1603 |
| 1596 ContentSettingDownloadsBubbleModel* | 1604 ContentSettingDownloadsBubbleModel* |
| 1597 ContentSettingBubbleModel::AsDownloadsBubbleModel() { | 1605 ContentSettingBubbleModel::AsDownloadsBubbleModel() { |
| 1598 return nullptr; | 1606 return nullptr; |
| 1599 } | 1607 } |
| OLD | NEW |