Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6976)

Unified Diff: chrome/browser/ui/content_settings/content_setting_bubble_model.cc

Issue 2171713002: Safe browsing subresource filter bubble UI skeleton. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: self review Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/content_settings/content_setting_bubble_model.cc
diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
index bfd711a8d0e036d125082fc931d49a5f7ec52133..ba849d766ff5272b333efb453f7d7b6cd82b828d 100644
--- a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
+++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
@@ -35,6 +35,7 @@
#include "components/content_settings/core/common/content_settings.h"
#include "components/prefs/pref_service.h"
#include "components/rappor/rappor_utils.h"
+#include "components/subresource_filter/content/browser/content_subresource_filter_driver_factory.h"
#include "components/url_formatter/elide_url.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/render_frame_host.h"
@@ -1338,3 +1339,47 @@ ContentSettingMediaStreamBubbleModel*
// In general, bubble models might not inherit from the media bubble model.
return nullptr;
}
+
+ContentSettingSubresourceFilterBubbleModel*
+ContentSettingBubbleModel::AsSubresourceFilterBubbleModel() {
+ // In general, bubble models might not inherit from the subresource filter
+ // 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.
+ return nullptr;
+}
+
+// ContentSettingSubresourceFilterBubbleModel ----------------------------------
+
+ContentSettingSubresourceFilterBubbleModel::
+ 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 -
+ WebContents* web_contents,
+ Profile* profile)
+ : ContentSettingBubbleModel(delegate, web_contents, profile) {
+ SetTitle();
+ SetManageLink();
+}
+
+ContentSettingSubresourceFilterBubbleModel::
+ ~ContentSettingSubresourceFilterBubbleModel() {}
+
+void ContentSettingSubresourceFilterBubbleModel::SetTitle() {
+ // TODO(melandory): For this bubble we need to introduce ability to have a
+ // caption (something which appears above title and has bigger font).
+ set_title(l10n_util::GetStringUTF8(
+ IDS_FILTERED_DECEPTIVE_CONTENT_PROMPT_EXPLANATION));
+}
+
+void ContentSettingSubresourceFilterBubbleModel::SetManageLink() {
+ // TODO(melandory): introduce the button instead of link.
+ set_manage_link(
+ l10n_util::GetStringUTF8(IDS_FILTERED_DECEPTIVE_CONTENT_PROMPT_RELOAD));
+}
+
+void ContentSettingSubresourceFilterBubbleModel::OnManageLinkClicked() {
+ // TODO(melandory): Notify ContentSubresourceFilterDriverFactory page reload
+ // was requested.
+}
+
+ContentSettingSubresourceFilterBubbleModel*
+ContentSettingSubresourceFilterBubbleModel::AsSubresourceFilterBubbleModel() {
+ return this;
+}

Powered by Google App Engine
This is Rietveld 408576698