| 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 <utility> | 10 #include <utility> |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 // If |anchor_view| is nullptr, or has no Widget, |parent_window| may be | 210 // If |anchor_view| is nullptr, or has no Widget, |parent_window| may be |
| 211 // provided to ensure this bubble is closed when the parent closes. | 211 // provided to ensure this bubble is closed when the parent closes. |
| 212 InternalPageInfoBubbleView(views::View* anchor_view, | 212 InternalPageInfoBubbleView(views::View* anchor_view, |
| 213 gfx::NativeView parent_window, | 213 gfx::NativeView parent_window, |
| 214 const GURL& url); | 214 const GURL& url); |
| 215 ~InternalPageInfoBubbleView() override; | 215 ~InternalPageInfoBubbleView() override; |
| 216 | 216 |
| 217 // views::BubbleDialogDelegateView: | 217 // views::BubbleDialogDelegateView: |
| 218 void OnWidgetDestroying(views::Widget* widget) override; | 218 void OnWidgetDestroying(views::Widget* widget) override; |
| 219 int GetDialogButtons() const override; | 219 int GetDialogButtons() const override; |
| 220 bool ShouldSnapFrameWidth() const override; |
| 220 | 221 |
| 221 private: | 222 private: |
| 222 friend class PageInfoBubbleView; | 223 friend class PageInfoBubbleView; |
| 223 | 224 |
| 224 // Used around icon and inside bubble border. | 225 // Used around icon and inside bubble border. |
| 225 static constexpr int kSpacing = 12; | 226 static constexpr int kSpacing = 12; |
| 226 | 227 |
| 227 DISALLOW_COPY_AND_ASSIGN(InternalPageInfoBubbleView); | 228 DISALLOW_COPY_AND_ASSIGN(InternalPageInfoBubbleView); |
| 228 }; | 229 }; |
| 229 | 230 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 InternalPageInfoBubbleView::~InternalPageInfoBubbleView() {} | 372 InternalPageInfoBubbleView::~InternalPageInfoBubbleView() {} |
| 372 | 373 |
| 373 void InternalPageInfoBubbleView::OnWidgetDestroying(views::Widget* widget) { | 374 void InternalPageInfoBubbleView::OnWidgetDestroying(views::Widget* widget) { |
| 374 g_shown_bubble_type = PageInfoBubbleView::BUBBLE_NONE; | 375 g_shown_bubble_type = PageInfoBubbleView::BUBBLE_NONE; |
| 375 } | 376 } |
| 376 | 377 |
| 377 int InternalPageInfoBubbleView::GetDialogButtons() const { | 378 int InternalPageInfoBubbleView::GetDialogButtons() const { |
| 378 return ui::DIALOG_BUTTON_NONE; | 379 return ui::DIALOG_BUTTON_NONE; |
| 379 } | 380 } |
| 380 | 381 |
| 382 bool InternalPageInfoBubbleView::ShouldSnapFrameWidth() const { |
| 383 return false; |
| 384 } |
| 385 |
| 381 //////////////////////////////////////////////////////////////////////////////// | 386 //////////////////////////////////////////////////////////////////////////////// |
| 382 // PageInfoBubbleView | 387 // PageInfoBubbleView |
| 383 //////////////////////////////////////////////////////////////////////////////// | 388 //////////////////////////////////////////////////////////////////////////////// |
| 384 | 389 |
| 385 PageInfoBubbleView::~PageInfoBubbleView() {} | 390 PageInfoBubbleView::~PageInfoBubbleView() {} |
| 386 | 391 |
| 387 // static | 392 // static |
| 388 void PageInfoBubbleView::ShowBubble( | 393 void PageInfoBubbleView::ShowBubble( |
| 389 views::View* anchor_view, | 394 views::View* anchor_view, |
| 390 const gfx::Rect& anchor_rect, | 395 const gfx::Rect& anchor_rect, |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 PageInfo::PAGE_INFO_CONNECTION_HELP_OPENED); | 790 PageInfo::PAGE_INFO_CONNECTION_HELP_OPENED); |
| 786 break; | 791 break; |
| 787 case STYLED_LABEL_RESET_CERTIFICATE_DECISIONS: | 792 case STYLED_LABEL_RESET_CERTIFICATE_DECISIONS: |
| 788 presenter_->OnRevokeSSLErrorBypassButtonPressed(); | 793 presenter_->OnRevokeSSLErrorBypassButtonPressed(); |
| 789 GetWidget()->Close(); | 794 GetWidget()->Close(); |
| 790 break; | 795 break; |
| 791 default: | 796 default: |
| 792 NOTREACHED(); | 797 NOTREACHED(); |
| 793 } | 798 } |
| 794 } | 799 } |
| OLD | NEW |