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" | |
| 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 // In general, bubble models might not inherit from the subresource filter | |
| 1346 // bubble model. | |
|
raymes
2016/07/26 07:19:35
nit: I think we can avoid propagating these commen
melandory
2016/07/26 11:58:11
Done.
| |
| 1347 return nullptr; | |
| 1348 } | |
| 1349 | |
| 1350 // ContentSettingSubresourceFilterBubbleModel ---------------------------------- | |
| 1351 | |
| 1352 ContentSettingSubresourceFilterBubbleModel:: | |
| 1353 ContentSettingSubresourceFilterBubbleModel(Delegate* delegate, | |
|
raymes
2016/07/26 07:19:35
Based on the mocks, this bubble seems really simil
melandory
2016/07/26 09:37:30
Talked to our UX. Despite the two bubble definitel
raymes
2016/07/28 05:10:58
Would we not want to add "learn more" for this too
raymes
2016/07/28 05:14:28
I guess not all the page actions have learn more -
| |
| 1354 WebContents* web_contents, | |
| 1355 Profile* profile) | |
| 1356 : ContentSettingBubbleModel(delegate, web_contents, profile) { | |
| 1357 SetTitle(); | |
| 1358 SetManageLink(); | |
| 1359 } | |
| 1360 | |
| 1361 ContentSettingSubresourceFilterBubbleModel:: | |
| 1362 ~ContentSettingSubresourceFilterBubbleModel() {} | |
| 1363 | |
| 1364 void ContentSettingSubresourceFilterBubbleModel::SetTitle() { | |
| 1365 // TODO(melandory): For this bubble we need to introduce ability to have a | |
| 1366 // caption (something which appears above title and has bigger font). | |
| 1367 set_title(l10n_util::GetStringUTF8( | |
| 1368 IDS_FILTERED_DECEPTIVE_CONTENT_PROMPT_EXPLANATION)); | |
| 1369 } | |
| 1370 | |
| 1371 void ContentSettingSubresourceFilterBubbleModel::SetManageLink() { | |
| 1372 // TODO(melandory): introduce the button instead of link. | |
| 1373 set_manage_link( | |
| 1374 l10n_util::GetStringUTF8(IDS_FILTERED_DECEPTIVE_CONTENT_PROMPT_RELOAD)); | |
| 1375 } | |
| 1376 | |
| 1377 void ContentSettingSubresourceFilterBubbleModel::OnManageLinkClicked() { | |
| 1378 // TODO(melandory): Notify ContentSubresourceFilterDriverFactory page reload | |
| 1379 // was requested. | |
| 1380 } | |
| 1381 | |
| 1382 ContentSettingSubresourceFilterBubbleModel* | |
| 1383 ContentSettingSubresourceFilterBubbleModel::AsSubresourceFilterBubbleModel() { | |
| 1384 return this; | |
| 1385 } | |
| OLD | NEW |