Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Side by Side Diff: chrome/browser/ui/views/page_info/page_info_bubble_view.cc

Issue 2880433002: views: don't snap dialogs with no buttons (Closed)
Patch Set: add unittest Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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;
221 220
222 private: 221 private:
223 friend class PageInfoBubbleView; 222 friend class PageInfoBubbleView;
224 223
225 // Used around icon and inside bubble border. 224 // Used around icon and inside bubble border.
226 static constexpr int kSpacing = 12; 225 static constexpr int kSpacing = 12;
227 226
228 DISALLOW_COPY_AND_ASSIGN(InternalPageInfoBubbleView); 227 DISALLOW_COPY_AND_ASSIGN(InternalPageInfoBubbleView);
229 }; 228 };
230 229
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 InternalPageInfoBubbleView::~InternalPageInfoBubbleView() {} 371 InternalPageInfoBubbleView::~InternalPageInfoBubbleView() {}
373 372
374 void InternalPageInfoBubbleView::OnWidgetDestroying(views::Widget* widget) { 373 void InternalPageInfoBubbleView::OnWidgetDestroying(views::Widget* widget) {
375 g_shown_bubble_type = PageInfoBubbleView::BUBBLE_NONE; 374 g_shown_bubble_type = PageInfoBubbleView::BUBBLE_NONE;
376 } 375 }
377 376
378 int InternalPageInfoBubbleView::GetDialogButtons() const { 377 int InternalPageInfoBubbleView::GetDialogButtons() const {
379 return ui::DIALOG_BUTTON_NONE; 378 return ui::DIALOG_BUTTON_NONE;
380 } 379 }
381 380
382 bool InternalPageInfoBubbleView::ShouldSnapFrameWidth() const {
383 return false;
384 }
385
386 //////////////////////////////////////////////////////////////////////////////// 381 ////////////////////////////////////////////////////////////////////////////////
387 // PageInfoBubbleView 382 // PageInfoBubbleView
388 //////////////////////////////////////////////////////////////////////////////// 383 ////////////////////////////////////////////////////////////////////////////////
389 384
390 PageInfoBubbleView::~PageInfoBubbleView() {} 385 PageInfoBubbleView::~PageInfoBubbleView() {}
391 386
392 // static 387 // static
393 void PageInfoBubbleView::ShowBubble( 388 void PageInfoBubbleView::ShowBubble(
394 views::View* anchor_view, 389 views::View* anchor_view,
395 const gfx::Rect& anchor_rect, 390 const gfx::Rect& anchor_rect,
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 PageInfo::PAGE_INFO_CONNECTION_HELP_OPENED); 785 PageInfo::PAGE_INFO_CONNECTION_HELP_OPENED);
791 break; 786 break;
792 case STYLED_LABEL_RESET_CERTIFICATE_DECISIONS: 787 case STYLED_LABEL_RESET_CERTIFICATE_DECISIONS:
793 presenter_->OnRevokeSSLErrorBypassButtonPressed(); 788 presenter_->OnRevokeSSLErrorBypassButtonPressed();
794 GetWidget()->Close(); 789 GetWidget()->Close();
795 break; 790 break;
796 default: 791 default:
797 NOTREACHED(); 792 NOTREACHED();
798 } 793 }
799 } 794 }
OLDNEW
« no previous file with comments | « no previous file | ui/views/bubble/bubble_frame_view_unittest.cc » ('j') | ui/views/window/dialog_delegate.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698