| 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 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1249 set_manage_text( | 1249 set_manage_text( |
| 1250 l10n_util::GetStringUTF16(IDS_FILTERED_DECEPTIVE_CONTENT_PROMPT_RELOAD)); | 1250 l10n_util::GetStringUTF16(IDS_FILTERED_DECEPTIVE_CONTENT_PROMPT_RELOAD)); |
| 1251 set_show_manage_text_as_checkbox(true); | 1251 set_show_manage_text_as_checkbox(true); |
| 1252 } | 1252 } |
| 1253 | 1253 |
| 1254 void ContentSettingSubresourceFilterBubbleModel::SetMessage() { | 1254 void ContentSettingSubresourceFilterBubbleModel::SetMessage() { |
| 1255 set_message(l10n_util::GetStringUTF16( | 1255 set_message(l10n_util::GetStringUTF16( |
| 1256 IDS_FILTERED_DECEPTIVE_CONTENT_PROMPT_EXPLANATION)); | 1256 IDS_FILTERED_DECEPTIVE_CONTENT_PROMPT_EXPLANATION)); |
| 1257 } | 1257 } |
| 1258 | 1258 |
| 1259 // TODO(csharrison): This is only executed on Mac. It should also get the |
| 1260 // updated UI with a checkbox. |
| 1261 void ContentSettingSubresourceFilterBubbleModel::OnManageLinkClicked() { |
| 1262 auto* driver_factory = subresource_filter:: |
| 1263 ContentSubresourceFilterDriverFactory::FromWebContents(web_contents()); |
| 1264 driver_factory->OnReloadRequested(); |
| 1265 } |
| 1266 |
| 1259 void ContentSettingSubresourceFilterBubbleModel::OnManageCheckboxChecked( | 1267 void ContentSettingSubresourceFilterBubbleModel::OnManageCheckboxChecked( |
| 1260 bool is_checked) { | 1268 bool is_checked) { |
| 1261 if (is_checked) | 1269 if (is_checked) |
| 1262 set_done_button_text(l10n_util::GetStringUTF16(IDS_APP_MENU_RELOAD)); | 1270 set_done_button_text(l10n_util::GetStringUTF16(IDS_APP_MENU_RELOAD)); |
| 1263 else | 1271 else |
| 1264 set_done_button_text(base::string16()); | 1272 set_done_button_text(base::string16()); |
| 1265 is_checked_ = is_checked; | 1273 is_checked_ = is_checked; |
| 1266 } | 1274 } |
| 1267 | 1275 |
| 1268 void ContentSettingSubresourceFilterBubbleModel::OnDoneClicked() { | 1276 void ContentSettingSubresourceFilterBubbleModel::OnDoneClicked() { |
| 1269 if (is_checked_) { | 1277 if (is_checked_) { |
| 1270 subresource_filter::ContentSubresourceFilterDriverFactory* driver_factory = | 1278 auto* driver_factory = subresource_filter:: |
| 1271 subresource_filter::ContentSubresourceFilterDriverFactory:: | 1279 ContentSubresourceFilterDriverFactory::FromWebContents(web_contents()); |
| 1272 FromWebContents(web_contents()); | |
| 1273 driver_factory->OnReloadRequested(); | 1280 driver_factory->OnReloadRequested(); |
| 1274 } | 1281 } |
| 1275 } | 1282 } |
| 1276 | 1283 |
| 1277 ContentSettingSubresourceFilterBubbleModel* | 1284 ContentSettingSubresourceFilterBubbleModel* |
| 1278 ContentSettingSubresourceFilterBubbleModel::AsSubresourceFilterBubbleModel() { | 1285 ContentSettingSubresourceFilterBubbleModel::AsSubresourceFilterBubbleModel() { |
| 1279 return this; | 1286 return this; |
| 1280 } | 1287 } |
| 1281 | 1288 |
| 1282 // ContentSettingMidiSysExBubbleModel ------------------------------------------ | 1289 // ContentSettingMidiSysExBubbleModel ------------------------------------------ |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1599 | 1606 |
| 1600 ContentSettingSubresourceFilterBubbleModel* | 1607 ContentSettingSubresourceFilterBubbleModel* |
| 1601 ContentSettingBubbleModel::AsSubresourceFilterBubbleModel() { | 1608 ContentSettingBubbleModel::AsSubresourceFilterBubbleModel() { |
| 1602 return nullptr; | 1609 return nullptr; |
| 1603 } | 1610 } |
| 1604 | 1611 |
| 1605 ContentSettingDownloadsBubbleModel* | 1612 ContentSettingDownloadsBubbleModel* |
| 1606 ContentSettingBubbleModel::AsDownloadsBubbleModel() { | 1613 ContentSettingBubbleModel::AsDownloadsBubbleModel() { |
| 1607 return nullptr; | 1614 return nullptr; |
| 1608 } | 1615 } |
| OLD | NEW |