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

Unified Diff: chrome/browser/ui/views/content_setting_bubble_contents.cc

Issue 319553008: Updated Plugin bubble model to add "learn more" link and to appear with a sliding yellow thing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated so that the yellow thing occurs only when the content setting is set to allow Created 6 years, 6 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/views/content_setting_bubble_contents.cc
diff --git a/chrome/browser/ui/views/content_setting_bubble_contents.cc b/chrome/browser/ui/views/content_setting_bubble_contents.cc
index 5980bb69fa30a04679c9ce92cc7672b472e1f78f..7b2133d32ab1f7237d34c6f8f5461dde185d7aaa 100644
--- a/chrome/browser/ui/views/content_setting_bubble_contents.cc
+++ b/chrome/browser/ui/views/content_setting_bubble_contents.cc
@@ -147,6 +147,7 @@ ContentSettingBubbleContents::ContentSettingBubbleContents(
content_setting_bubble_model_(content_setting_bubble_model),
custom_link_(NULL),
manage_link_(NULL),
+ learn_more_link_(NULL),
close_button_(NULL) {
// Compensate for built-in vertical padding in the anchor view's image.
set_anchor_view_insets(gfx::Insets(5, 0, 5, 0));
@@ -189,6 +190,9 @@ void ContentSettingBubbleContents::Init() {
views::ColumnSet* column_set = layout->AddColumnSet(kSingleColumnSetId);
column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL, 1,
GridLayout::USE_PREF, 0, 0);
+ column_set->AddPaddingColumn(0, views::kRelatedControlHorizontalSpacing);
+ column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL, 1,
+ GridLayout::USE_PREF, 0, 0);
const ContentSettingBubbleModel::BubbleContent& bubble_content =
content_setting_bubble_model_->bubble_content();
@@ -204,6 +208,15 @@ void ContentSettingBubbleContents::Init() {
bubble_content_empty = false;
}
+ if (!bubble_content.learn_more_link.empty()) {
+ learn_more_link_ =
+ new views::Link(base::UTF8ToUTF16(bubble_content.learn_more_link));
+ learn_more_link_->set_listener(this);
+ learn_more_link_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
+ layout->AddView(learn_more_link_);
+ bubble_content_empty = false;
+ }
+
if (content_setting_bubble_model_->content_type() ==
CONTENT_SETTINGS_TYPE_POPUPS) {
const int kPopupColumnSetId = 2;
@@ -427,6 +440,11 @@ void ContentSettingBubbleContents::ButtonPressed(views::Button* sender,
void ContentSettingBubbleContents::LinkClicked(views::Link* source,
int event_flags) {
+ if (source == learn_more_link_) {
+ content_setting_bubble_model_->OnLearnMoreLinkClicked();
+ GetWidget()->Close();
+ return;
+ }
if (source == custom_link_) {
content_setting_bubble_model_->OnCustomLinkClicked();
GetWidget()->Close();
« no previous file with comments | « chrome/browser/ui/views/content_setting_bubble_contents.h ('k') | chrome/renderer/chrome_content_renderer_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698