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

Unified Diff: chrome/browser/ui/views/location_bar/content_setting_image_view.cc

Issue 23557004: Save password bubble pops up automatically (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Readding UpdatePostLayout Created 7 years, 3 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/location_bar/content_setting_image_view.cc
diff --git a/chrome/browser/ui/views/location_bar/content_setting_image_view.cc b/chrome/browser/ui/views/location_bar/content_setting_image_view.cc
index 6d05e4fa6a7a3ec83dd6026879005839266391e2..423458e82d9f4fc64c3af901b662a032bc4ec066 100644
--- a/chrome/browser/ui/views/location_bar/content_setting_image_view.cc
+++ b/chrome/browser/ui/views/location_bar/content_setting_image_view.cc
@@ -94,7 +94,8 @@ ContentSettingImageView::~ContentSettingImageView() {
bubble_widget_->RemoveObserver(this);
}
-void ContentSettingImageView::Update(content::WebContents* web_contents) {
+void ContentSettingImageView::UpdatePreLayout(
+ content::WebContents* web_contents) {
// Note: We explicitly want to call this even if |web_contents| is NULL, so we
// get hidden properly while the user is editing the omnibox.
content_setting_image_model_->UpdateFromWebContents(web_contents);
@@ -127,9 +128,35 @@ void ContentSettingImageView::Update(content::WebContents* web_contents) {
text_label_->SetVisible(true);
slide_animator_.Show();
}
+}
+
+void ContentSettingImageView::UpdatePostLayout(
+ content::WebContents* web_contents) {
+ if (!content_setting_image_model_->is_visible())
+ return;
- content_settings->SetBlockageHasBeenIndicated(
- content_setting_image_model_->get_content_settings_type());
+ TabSpecificContentSettings* content_settings = web_contents ?
+ TabSpecificContentSettings::FromWebContents(web_contents) : NULL;
+ if (!content_settings)
+ return;
+ if (!content_settings->IsBlockageIndicated(
+ content_setting_image_model_->get_content_settings_type())) {
Peter Kasting 2013/09/04 20:59:11 Nit: Indent 4, not 9
npentrel 2013/09/04 21:50:18 Done.
+ if (content_setting_image_model_->ShouldShowBubbleOnBlockage()) {
+ if (web_contents && !bubble_widget_) {
Peter Kasting 2013/09/04 20:59:11 |web_contents| cannot be NULL here or we'd have re
npentrel 2013/09/04 21:50:18 true.
+ bubble_widget_ = parent_->delegate()->CreateViewsBubble(
+ new ContentSettingBubbleContents(
+ ContentSettingBubbleModel::CreateContentSettingBubbleModel(
+ parent_->delegate()->GetContentSettingBubbleModelDelegate(),
+ web_contents, parent_->profile(),
+ content_setting_image_model_->get_content_settings_type()),
+ web_contents, this, views::BubbleBorder::TOP_RIGHT));
+ bubble_widget_->AddObserver(this);
+ bubble_widget_->Show();
+ }
+ content_settings->SetBlockageHasBeenIndicated(
Peter Kasting 2013/09/04 20:59:11 This statement is one layer too deep.
npentrel 2013/09/04 21:50:18 Done.
+ content_setting_image_model_->get_content_settings_type());
+ }
+ }
}
// static

Powered by Google App Engine
This is Rietveld 408576698