OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_win.h" | 5 #include "chrome/browser/ui/views/collected_cookies_win.h" |
6 | 6 |
7 #include "chrome/browser/content_settings/host_content_settings_map.h" | 7 #include "chrome/browser/content_settings/host_content_settings_map.h" |
8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
9 #include "chrome/browser/cookies_tree_model.h" | 9 #include "chrome/browser/cookies_tree_model.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 kInfobarHorizontalPadding, | 118 kInfobarHorizontalPadding, |
119 kInfobarVerticalPadding, | 119 kInfobarVerticalPadding, |
120 views::kRelatedControlSmallHorizontalSpacing)); | 120 views::kRelatedControlSmallHorizontalSpacing)); |
121 content_->AddChildView(info_image_); | 121 content_->AddChildView(info_image_); |
122 content_->AddChildView(label_); | 122 content_->AddChildView(label_); |
123 UpdateVisibility(false, CONTENT_SETTING_BLOCK, std::wstring()); | 123 UpdateVisibility(false, CONTENT_SETTING_BLOCK, std::wstring()); |
124 } | 124 } |
125 | 125 |
126 // views::View overrides. | 126 // views::View overrides. |
127 virtual gfx::Size GetPreferredSize() { | 127 virtual gfx::Size GetPreferredSize() { |
128 if (!IsVisible()) | 128 if (!visible()) |
129 return gfx::Size(); | 129 return gfx::Size(); |
130 | 130 |
131 // Add space around the banner. | 131 // Add space around the banner. |
132 gfx::Size size(content_->GetPreferredSize()); | 132 gfx::Size size(content_->GetPreferredSize()); |
133 size.Enlarge(0, 2 * views::kRelatedControlVerticalSpacing); | 133 size.Enlarge(0, 2 * views::kRelatedControlVerticalSpacing); |
134 return size; | 134 return size; |
135 } | 135 } |
136 | 136 |
137 virtual void Layout() { | 137 virtual void Layout() { |
138 content_->SetBounds( | 138 content_->SetBounds( |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 | 491 |
492 /////////////////////////////////////////////////////////////////////////////// | 492 /////////////////////////////////////////////////////////////////////////////// |
493 // NotificationObserver implementation. | 493 // NotificationObserver implementation. |
494 | 494 |
495 void CollectedCookiesWin::Observe(NotificationType type, | 495 void CollectedCookiesWin::Observe(NotificationType type, |
496 const NotificationSource& source, | 496 const NotificationSource& source, |
497 const NotificationDetails& details) { | 497 const NotificationDetails& details) { |
498 DCHECK(type == NotificationType::COLLECTED_COOKIES_SHOWN); | 498 DCHECK(type == NotificationType::COLLECTED_COOKIES_SHOWN); |
499 window_->CloseConstrainedWindow(); | 499 window_->CloseConstrainedWindow(); |
500 } | 500 } |
OLD | NEW |