Chromium Code Reviews| 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); |
|
msw
2017/04/05 22:08:33
If this function is no longer used, and won't be i
Charlie Harrison
2017/04/05 22:35:32
Done.
| |
| 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::OnChecked(bool is_checked) { |
| 1259 subresource_filter::ContentSubresourceFilterDriverFactory* driver_factory = | 1259 set_done_text(is_checked ? base::UTF8ToUTF16("Reload") |
|
msw
2017/04/05 22:08:33
q: Does this need to trigger a layout/paint of the
Charlie Harrison
2017/04/05 22:35:32
Yes, this needs to trigger a layout/paint of the U
| |
| 1260 subresource_filter::ContentSubresourceFilterDriverFactory:: | 1260 : l10n_util::GetStringUTF16(IDS_DONE)); |
| 1261 FromWebContents(web_contents()); | 1261 is_checked_ = is_checked; |
| 1262 driver_factory->OnReloadRequested(); | 1262 } |
| 1263 | |
| 1264 void ContentSettingSubresourceFilterBubbleModel::OnDoneClicked() { | |
| 1265 if (is_checked_) { | |
| 1266 subresource_filter::ContentSubresourceFilterDriverFactory* driver_factory = | |
| 1267 subresource_filter::ContentSubresourceFilterDriverFactory:: | |
| 1268 FromWebContents(web_contents()); | |
| 1269 driver_factory->OnReloadRequested(); | |
| 1270 } | |
| 1263 } | 1271 } |
| 1264 | 1272 |
| 1265 ContentSettingSubresourceFilterBubbleModel* | 1273 ContentSettingSubresourceFilterBubbleModel* |
| 1266 ContentSettingSubresourceFilterBubbleModel::AsSubresourceFilterBubbleModel() { | 1274 ContentSettingSubresourceFilterBubbleModel::AsSubresourceFilterBubbleModel() { |
| 1267 return this; | 1275 return this; |
| 1268 } | 1276 } |
| 1269 | 1277 |
| 1270 // ContentSettingMidiSysExBubbleModel ------------------------------------------ | 1278 // ContentSettingMidiSysExBubbleModel ------------------------------------------ |
| 1271 | 1279 |
| 1272 class ContentSettingMidiSysExBubbleModel | 1280 class ContentSettingMidiSysExBubbleModel |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1550 ContentSettingBubbleModel::MediaMenu::MediaMenu() : disabled(false) {} | 1558 ContentSettingBubbleModel::MediaMenu::MediaMenu() : disabled(false) {} |
| 1551 | 1559 |
| 1552 ContentSettingBubbleModel::MediaMenu::MediaMenu(const MediaMenu& other) = | 1560 ContentSettingBubbleModel::MediaMenu::MediaMenu(const MediaMenu& other) = |
| 1553 default; | 1561 default; |
| 1554 | 1562 |
| 1555 ContentSettingBubbleModel::MediaMenu::~MediaMenu() {} | 1563 ContentSettingBubbleModel::MediaMenu::~MediaMenu() {} |
| 1556 | 1564 |
| 1557 ContentSettingBubbleModel::BubbleContent::BubbleContent() | 1565 ContentSettingBubbleModel::BubbleContent::BubbleContent() |
| 1558 : radio_group_enabled(false), | 1566 : radio_group_enabled(false), |
| 1559 custom_link_enabled(false), | 1567 custom_link_enabled(false), |
| 1560 show_manage_text_as_button(false) {} | 1568 show_manage_text_as_button(false), |
| 1569 show_manage_text_as_checkbox(false) {} | |
|
msw
2017/04/05 22:08:34
optional nit: move these default values to the str
Charlie Harrison
2017/04/05 22:35:32
Done.
| |
| 1561 | 1570 |
| 1562 ContentSettingBubbleModel::BubbleContent::~BubbleContent() {} | 1571 ContentSettingBubbleModel::BubbleContent::~BubbleContent() {} |
| 1563 | 1572 |
| 1564 void ContentSettingBubbleModel::Observe( | 1573 void ContentSettingBubbleModel::Observe( |
| 1565 int type, | 1574 int type, |
| 1566 const content::NotificationSource& source, | 1575 const content::NotificationSource& source, |
| 1567 const content::NotificationDetails& details) { | 1576 const content::NotificationDetails& details) { |
| 1568 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { | 1577 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { |
| 1569 DCHECK_EQ(web_contents_, | 1578 DCHECK_EQ(web_contents_, |
| 1570 content::Source<WebContents>(source).ptr()); | 1579 content::Source<WebContents>(source).ptr()); |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 1590 | 1599 |
| 1591 ContentSettingSubresourceFilterBubbleModel* | 1600 ContentSettingSubresourceFilterBubbleModel* |
| 1592 ContentSettingBubbleModel::AsSubresourceFilterBubbleModel() { | 1601 ContentSettingBubbleModel::AsSubresourceFilterBubbleModel() { |
| 1593 return nullptr; | 1602 return nullptr; |
| 1594 } | 1603 } |
| 1595 | 1604 |
| 1596 ContentSettingDownloadsBubbleModel* | 1605 ContentSettingDownloadsBubbleModel* |
| 1597 ContentSettingBubbleModel::AsDownloadsBubbleModel() { | 1606 ContentSettingBubbleModel::AsDownloadsBubbleModel() { |
| 1598 return nullptr; | 1607 return nullptr; |
| 1599 } | 1608 } |
| OLD | NEW |