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