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..598b67d649d66f052b67b9cbd973dbc02ac1f67e 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,25 @@ void ContentSettingImageView::Update(content::WebContents* web_contents) { |
text_label_->SetVisible(true); |
slide_animator_.Show(); |
} |
+} |
Peter Kasting
2013/09/05 06:55:19
Nit: Add comment at end of function:
Since indica
npentrel
2013/09/05 08:28:09
Done.
|
+ |
+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( |
Peter Kasting
2013/09/05 06:55:19
Nit: Either put a blank line here, or remove the o
npentrel
2013/09/05 08:28:09
Done.
|
+ content_setting_image_model_->get_content_settings_type())) { |
+ if (content_setting_image_model_->ShouldShowBubbleOnBlockage()) { |
Peter Kasting
2013/09/05 06:55:19
Nit: No {}
npentrel
2013/09/05 08:28:09
Done.
|
+ CreateBubble(web_contents); |
+ } |
+ content_settings->SetBlockageHasBeenIndicated( |
+ content_setting_image_model_->get_content_settings_type()); |
+ } |
} |
// static |
@@ -246,14 +263,18 @@ void ContentSettingImageView::OnClick() { |
content::WebContents* web_contents = parent_->GetWebContents(); |
if (web_contents && !bubble_widget_) { |
- 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(); |
+ CreateBubble(web_contents); |
} |
} |
+ |
+void ContentSettingImageView::CreateBubble(content::WebContents* web_contents) { |
+ 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(); |
+} |