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

Side by Side Diff: chrome/browser/ui/views/collected_cookies_views.cc

Issue 2503643002: Fixed collected cookies view info bar visibility (Closed)
Patch Set: Last comment wasn't accurate. This one explains what code was removed and why. Created 4 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/collected_cookies_views.h" 5 #include "chrome/browser/ui/views/collected_cookies_views.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "chrome/browser/browsing_data/browsing_data_appcache_helper.h" 8 #include "chrome/browser/browsing_data/browsing_data_appcache_helper.h"
9 #include "chrome/browser/browsing_data/browsing_data_channel_id_helper.h" 9 #include "chrome/browser/browsing_data/browsing_data_channel_id_helper.h"
10 #include "chrome/browser/browsing_data/browsing_data_cookie_helper.h" 10 #include "chrome/browser/browsing_data/browsing_data_cookie_helper.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 kInfobarHorizontalPadding, 143 kInfobarHorizontalPadding,
144 kInfobarVerticalPadding, 144 kInfobarVerticalPadding,
145 views::kRelatedControlSmallHorizontalSpacing)); 145 views::kRelatedControlSmallHorizontalSpacing));
146 content_->AddChildView(info_image_); 146 content_->AddChildView(info_image_);
147 content_->AddChildView(label_); 147 content_->AddChildView(label_);
148 UpdateVisibility(false, CONTENT_SETTING_BLOCK, base::string16()); 148 UpdateVisibility(false, CONTENT_SETTING_BLOCK, base::string16());
149 } 149 }
150 150
151 // views::View overrides. 151 // views::View overrides.
152 gfx::Size GetPreferredSize() const override { 152 gfx::Size GetPreferredSize() const override {
153 if (!visible()) 153 // Removed the "if (!visible())" check in order to always return the
154 return gfx::Size(); 154 // preferred size. This ensures that the layout manager always reserves
155 155 // space within the view so it can be displayed. Otherwise, the layout
156 // manager doesn't provide a space for it to display and the size of the
157 // containing dialog isn't large enough for it to ever become visible.
Peter Kasting 2016/11/29 20:51:17 This comment makes sense in the context of this pa
156 // Add space around the banner. 158 // Add space around the banner.
157 gfx::Size size(content_->GetPreferredSize()); 159 gfx::Size size(content_->GetPreferredSize());
158 size.Enlarge(0, 2 * views::kRelatedControlVerticalSpacing); 160 size.Enlarge(0, 2 * views::kRelatedControlVerticalSpacing);
159 return size; 161 return size;
160 } 162 }
161 163
162 void Layout() override { 164 void Layout() override {
163 content_->SetBounds( 165 content_->SetBounds(
164 0, views::kRelatedControlVerticalSpacing, 166 0, views::kRelatedControlVerticalSpacing,
165 width(), height() - views::kRelatedControlVerticalSpacing); 167 width(), height() - views::kRelatedControlVerticalSpacing);
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 /////////////////////////////////////////////////////////////////////////////// 563 ///////////////////////////////////////////////////////////////////////////////
562 // CollectedCookiesViews, content::NotificationObserver implementation: 564 // CollectedCookiesViews, content::NotificationObserver implementation:
563 565
564 void CollectedCookiesViews::Observe( 566 void CollectedCookiesViews::Observe(
565 int type, 567 int type,
566 const content::NotificationSource& source, 568 const content::NotificationSource& source,
567 const content::NotificationDetails& details) { 569 const content::NotificationDetails& details) {
568 DCHECK_EQ(chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, type); 570 DCHECK_EQ(chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, type);
569 GetWidget()->Close(); 571 GetWidget()->Close();
570 } 572 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698