| OLD | NEW |
| 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 } | 284 } |
| 285 | 285 |
| 286 /////////////////////////////////////////////////////////////////////////////// | 286 /////////////////////////////////////////////////////////////////////////////// |
| 287 // CollectedCookiesViews, views::View overrides: | 287 // CollectedCookiesViews, views::View overrides: |
| 288 | 288 |
| 289 gfx::Size CollectedCookiesViews::GetMinimumSize() const { | 289 gfx::Size CollectedCookiesViews::GetMinimumSize() const { |
| 290 // Allow UpdateWebContentsModalDialogPosition to clamp the dialog width. | 290 // Allow UpdateWebContentsModalDialogPosition to clamp the dialog width. |
| 291 return gfx::Size(0, View::GetMinimumSize().height()); | 291 return gfx::Size(0, View::GetMinimumSize().height()); |
| 292 } | 292 } |
| 293 | 293 |
| 294 gfx::Size CollectedCookiesViews::GetPreferredSize() const { | |
| 295 int preferred = LayoutDelegate::Get()->GetDialogPreferredWidth( | |
| 296 LayoutDelegate::DialogWidth::MEDIUM); | |
| 297 return gfx::Size(preferred ? preferred : View::GetPreferredSize().width(), | |
| 298 View::GetPreferredSize().height()); | |
| 299 } | |
| 300 | |
| 301 void CollectedCookiesViews::ViewHierarchyChanged( | 294 void CollectedCookiesViews::ViewHierarchyChanged( |
| 302 const ViewHierarchyChangedDetails& details) { | 295 const ViewHierarchyChangedDetails& details) { |
| 303 views::DialogDelegateView::ViewHierarchyChanged(details); | 296 views::DialogDelegateView::ViewHierarchyChanged(details); |
| 304 if (details.is_add && details.child == this) | 297 if (details.is_add && details.child == this) |
| 305 Init(); | 298 Init(); |
| 306 } | 299 } |
| 307 | 300 |
| 308 //////////////////////////////////////////////////////////////////////////////// | 301 //////////////////////////////////////////////////////////////////////////////// |
| 309 // CollectedCookiesViews, private: | 302 // CollectedCookiesViews, private: |
| 310 | 303 |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 /////////////////////////////////////////////////////////////////////////////// | 550 /////////////////////////////////////////////////////////////////////////////// |
| 558 // CollectedCookiesViews, content::NotificationObserver implementation: | 551 // CollectedCookiesViews, content::NotificationObserver implementation: |
| 559 | 552 |
| 560 void CollectedCookiesViews::Observe( | 553 void CollectedCookiesViews::Observe( |
| 561 int type, | 554 int type, |
| 562 const content::NotificationSource& source, | 555 const content::NotificationSource& source, |
| 563 const content::NotificationDetails& details) { | 556 const content::NotificationDetails& details) { |
| 564 DCHECK_EQ(chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, type); | 557 DCHECK_EQ(chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, type); |
| 565 GetWidget()->Close(); | 558 GetWidget()->Close(); |
| 566 } | 559 } |
| OLD | NEW |