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

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: Changed the comment line 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 d58a14111e601236060c7c1b66a849413cb8c02b..77cd38129b5fc6bba76075937c06b054dfbf4bcf 100644
--- a/chrome/browser/ui/views/content_setting_bubble_contents.cc
+++ b/chrome/browser/ui/views/content_setting_bubble_contents.cc
@@ -147,7 +147,8 @@ ContentSettingBubbleContents::ContentSettingBubbleContents(
content_setting_bubble_model_(content_setting_bubble_model),
custom_link_(NULL),
manage_link_(NULL),
- close_button_(NULL) {
+ close_button_(NULL),
+ learn_more_link_(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();

Powered by Google App Engine
This is Rietveld 408576698