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