| 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/page_info/page_info_popup_view.h" | 5 #include "chrome/browser/ui/views/page_info/page_info_popup_view.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 void PageInfoPopupView::LinkClicked(views::Link* source, int event_flags) { | 502 void PageInfoPopupView::LinkClicked(views::Link* source, int event_flags) { |
| 503 // The popup closes automatically when the collected cookies dialog or the | 503 // The popup closes automatically when the collected cookies dialog or the |
| 504 // certificate viewer opens. So delay handling of the link clicked to avoid | 504 // certificate viewer opens. So delay handling of the link clicked to avoid |
| 505 // a crash in the base class which needs to complete the mouse event handling. | 505 // a crash in the base class which needs to complete the mouse event handling. |
| 506 content::BrowserThread::PostTask( | 506 content::BrowserThread::PostTask( |
| 507 content::BrowserThread::UI, FROM_HERE, | 507 content::BrowserThread::UI, FROM_HERE, |
| 508 base::Bind(&PageInfoPopupView::HandleLinkClickedAsync, | 508 base::Bind(&PageInfoPopupView::HandleLinkClickedAsync, |
| 509 weak_factory_.GetWeakPtr(), source)); | 509 weak_factory_.GetWeakPtr(), source)); |
| 510 } | 510 } |
| 511 | 511 |
| 512 gfx::Size PageInfoPopupView::GetPreferredSize() const { | 512 gfx::Size PageInfoPopupView::GetUnsnappedPreferredSize() const { |
| 513 if (header_ == nullptr && site_settings_view_ == nullptr) | 513 if (header_ == nullptr && site_settings_view_ == nullptr) |
| 514 return views::View::GetPreferredSize(); | 514 return views::View::GetPreferredSize(); |
| 515 | 515 |
| 516 int height = 0; | 516 int height = 0; |
| 517 if (header_) | 517 if (header_) |
| 518 height += header_->GetPreferredSize().height() + kHeaderMarginBottom; | 518 height += header_->GetPreferredSize().height() + kHeaderMarginBottom; |
| 519 if (separator_) | 519 if (separator_) |
| 520 height += separator_->GetPreferredSize().height(); | 520 height += separator_->GetPreferredSize().height(); |
| 521 | 521 |
| 522 if (site_settings_view_) | 522 if (site_settings_view_) |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 PageInfo::PAGE_INFO_CONNECTION_HELP_OPENED); | 745 PageInfo::PAGE_INFO_CONNECTION_HELP_OPENED); |
| 746 break; | 746 break; |
| 747 case STYLED_LABEL_RESET_CERTIFICATE_DECISIONS: | 747 case STYLED_LABEL_RESET_CERTIFICATE_DECISIONS: |
| 748 presenter_->OnRevokeSSLErrorBypassButtonPressed(); | 748 presenter_->OnRevokeSSLErrorBypassButtonPressed(); |
| 749 GetWidget()->Close(); | 749 GetWidget()->Close(); |
| 750 break; | 750 break; |
| 751 default: | 751 default: |
| 752 NOTREACHED(); | 752 NOTREACHED(); |
| 753 } | 753 } |
| 754 } | 754 } |
| OLD | NEW |