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/macros.h" | 10 #include "base/macros.h" |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 28 #include "chrome/common/chrome_switches.h" | 28 #include "chrome/common/chrome_switches.h" |
| 29 #include "chrome/common/pref_names.h" | 29 #include "chrome/common/pref_names.h" |
| 30 #include "chrome/common/render_messages.h" | 30 #include "chrome/common/render_messages.h" |
| 31 #include "chrome/grit/generated_resources.h" | 31 #include "chrome/grit/generated_resources.h" |
| 32 #include "components/content_settings/content/common/content_settings_messages.h " | 32 #include "components/content_settings/content/common/content_settings_messages.h " |
| 33 #include "components/content_settings/core/browser/content_settings_utils.h" | 33 #include "components/content_settings/core/browser/content_settings_utils.h" |
| 34 #include "components/content_settings/core/browser/cookie_settings.h" | 34 #include "components/content_settings/core/browser/cookie_settings.h" |
| 35 #include "components/content_settings/core/common/content_settings.h" | 35 #include "components/content_settings/core/common/content_settings.h" |
| 36 #include "components/prefs/pref_service.h" | 36 #include "components/prefs/pref_service.h" |
| 37 #include "components/rappor/rappor_utils.h" | 37 #include "components/rappor/rappor_utils.h" |
| 38 #include "components/subresource_filter/content/browser/content_subresource_filt er_driver_factory.h" | |
|
msramek
2016/07/27 09:46:21
nit: Unused (you just left a TODO)
melandory
2016/07/27 12:53:40
Done.
| |
| 38 #include "components/url_formatter/elide_url.h" | 39 #include "components/url_formatter/elide_url.h" |
| 39 #include "content/public/browser/notification_service.h" | 40 #include "content/public/browser/notification_service.h" |
| 40 #include "content/public/browser/render_frame_host.h" | 41 #include "content/public/browser/render_frame_host.h" |
| 41 #include "content/public/browser/render_process_host.h" | 42 #include "content/public/browser/render_process_host.h" |
| 42 #include "content/public/browser/render_view_host.h" | 43 #include "content/public/browser/render_view_host.h" |
| 43 #include "content/public/browser/user_metrics.h" | 44 #include "content/public/browser/user_metrics.h" |
| 44 #include "content/public/browser/web_contents.h" | 45 #include "content/public/browser/web_contents.h" |
| 45 #include "content/public/browser/web_contents_delegate.h" | 46 #include "content/public/browser/web_contents_delegate.h" |
| 46 #include "content/public/common/origin_util.h" | 47 #include "content/public/common/origin_util.h" |
| 47 #include "grit/components_strings.h" | 48 #include "grit/components_strings.h" |
| (...skipping 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1331 ContentSettingBubbleModel::AsSimpleBubbleModel() { | 1332 ContentSettingBubbleModel::AsSimpleBubbleModel() { |
| 1332 // In general, bubble models might not inherit from the simple bubble model. | 1333 // In general, bubble models might not inherit from the simple bubble model. |
| 1333 return nullptr; | 1334 return nullptr; |
| 1334 } | 1335 } |
| 1335 | 1336 |
| 1336 ContentSettingMediaStreamBubbleModel* | 1337 ContentSettingMediaStreamBubbleModel* |
| 1337 ContentSettingBubbleModel::AsMediaStreamBubbleModel() { | 1338 ContentSettingBubbleModel::AsMediaStreamBubbleModel() { |
| 1338 // In general, bubble models might not inherit from the media bubble model. | 1339 // In general, bubble models might not inherit from the media bubble model. |
| 1339 return nullptr; | 1340 return nullptr; |
| 1340 } | 1341 } |
| 1342 | |
| 1343 ContentSettingSubresourceFilterBubbleModel* | |
| 1344 ContentSettingBubbleModel::AsSubresourceFilterBubbleModel() { | |
| 1345 return nullptr; | |
|
msramek
2016/07/27 09:46:21
nit: Also copy-paste the comment? :)
melandory
2016/07/27 12:53:40
https://codereview.chromium.org/2171713002/diff/80
| |
| 1346 } | |
| 1347 | |
| 1348 // ContentSettingSubresourceFilterBubbleModel ---------------------------------- | |
|
msramek
2016/07/27 09:46:21
Please move this higher up. The most general secti
melandory
2016/07/27 12:53:40
Done.
| |
| 1349 | |
| 1350 ContentSettingSubresourceFilterBubbleModel:: | |
| 1351 ContentSettingSubresourceFilterBubbleModel(Delegate* delegate, | |
| 1352 WebContents* web_contents, | |
| 1353 Profile* profile) | |
| 1354 : ContentSettingBubbleModel(delegate, web_contents, profile) { | |
| 1355 SetTitle(); | |
| 1356 SetManageLink(); | |
| 1357 } | |
| 1358 | |
| 1359 ContentSettingSubresourceFilterBubbleModel:: | |
| 1360 ~ContentSettingSubresourceFilterBubbleModel() {} | |
| 1361 | |
| 1362 void ContentSettingSubresourceFilterBubbleModel::SetTitle() { | |
| 1363 // TODO(melandory): For this bubble we need to introduce ability to have a | |
| 1364 // caption (something which appears above title and has bigger font). | |
| 1365 set_title(l10n_util::GetStringUTF8( | |
| 1366 IDS_FILTERED_DECEPTIVE_CONTENT_PROMPT_EXPLANATION)); | |
| 1367 } | |
| 1368 | |
| 1369 void ContentSettingSubresourceFilterBubbleModel::SetManageLink() { | |
| 1370 // TODO(melandory): introduce the button instead of link. | |
| 1371 set_manage_link( | |
| 1372 l10n_util::GetStringUTF8(IDS_FILTERED_DECEPTIVE_CONTENT_PROMPT_RELOAD)); | |
| 1373 } | |
| 1374 | |
| 1375 void ContentSettingSubresourceFilterBubbleModel::OnManageLinkClicked() { | |
| 1376 // TODO(melandory): Notify ContentSubresourceFilterDriverFactory page reload | |
| 1377 // was requested. | |
| 1378 } | |
| 1379 | |
| 1380 ContentSettingSubresourceFilterBubbleModel* | |
| 1381 ContentSettingSubresourceFilterBubbleModel::AsSubresourceFilterBubbleModel() { | |
| 1382 return this; | |
| 1383 } | |
| OLD | NEW |