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

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

Issue 2899583002: issue2882533003_180001.diff.txt (patch set 6)
Patch Set: DIFF 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
« no previous file with comments | « chrome/browser/ui/views/page_info/page_info_bubble_view.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 return ui::DIALOG_BUTTON_NONE; 378 return ui::DIALOG_BUTTON_NONE;
379 } 379 }
380 380
381 //////////////////////////////////////////////////////////////////////////////// 381 ////////////////////////////////////////////////////////////////////////////////
382 // PageInfoBubbleView 382 // PageInfoBubbleView
383 //////////////////////////////////////////////////////////////////////////////// 383 ////////////////////////////////////////////////////////////////////////////////
384 384
385 PageInfoBubbleView::~PageInfoBubbleView() {} 385 PageInfoBubbleView::~PageInfoBubbleView() {}
386 386
387 // static 387 // static
388 void PageInfoBubbleView::ShowBubble( 388 views::BubbleDialogDelegateView* PageInfoBubbleView::ShowBubble(
389 views::View* anchor_view, 389 views::View* anchor_view,
390 const gfx::Rect& anchor_rect, 390 const gfx::Rect& anchor_rect,
391 Profile* profile, 391 Profile* profile,
392 content::WebContents* web_contents, 392 content::WebContents* web_contents,
393 const GURL& url, 393 const GURL& url,
394 const security_state::SecurityInfo& security_info) { 394 const security_state::SecurityInfo& security_info) {
395 gfx::NativeView parent_window = 395 gfx::NativeView parent_window =
396 anchor_view ? nullptr : web_contents->GetNativeView(); 396 anchor_view ? nullptr : web_contents->GetNativeView();
397 if (url.SchemeIs(content::kChromeUIScheme) || 397 if (url.SchemeIs(content::kChromeUIScheme) ||
398 url.SchemeIs(content::kChromeDevToolsScheme) || 398 url.SchemeIs(content::kChromeDevToolsScheme) ||
399 url.SchemeIs(extensions::kExtensionScheme) || 399 url.SchemeIs(extensions::kExtensionScheme) ||
400 url.SchemeIs(content::kViewSourceScheme)) { 400 url.SchemeIs(content::kViewSourceScheme)) {
401 // Use the concrete type so that |SetAnchorRect| can be called as a friend. 401 // Use the concrete type so that |SetAnchorRect| can be called as a friend.
402 InternalPageInfoBubbleView* bubble = 402 InternalPageInfoBubbleView* bubble =
403 new InternalPageInfoBubbleView(anchor_view, parent_window, url); 403 new InternalPageInfoBubbleView(anchor_view, parent_window, url);
404 if (!anchor_view) 404 if (!anchor_view)
405 bubble->SetAnchorRect(anchor_rect); 405 bubble->SetAnchorRect(anchor_rect);
406 bubble->GetWidget()->Show(); 406 bubble->GetWidget()->Show();
407 return; 407 return bubble;
408 } 408 }
409 PageInfoBubbleView* bubble = new PageInfoBubbleView( 409 PageInfoBubbleView* bubble = new PageInfoBubbleView(
410 anchor_view, parent_window, profile, web_contents, url, security_info); 410 anchor_view, parent_window, profile, web_contents, url, security_info);
411 if (!anchor_view) 411 if (!anchor_view)
412 bubble->SetAnchorRect(anchor_rect); 412 bubble->SetAnchorRect(anchor_rect);
413 bubble->GetWidget()->Show(); 413 bubble->GetWidget()->Show();
414
415 return bubble;
414 } 416 }
415 417
416 // static 418 // static
417 PageInfoBubbleView::BubbleType PageInfoBubbleView::GetShownBubbleType() { 419 PageInfoBubbleView::BubbleType PageInfoBubbleView::GetShownBubbleType() {
418 return g_shown_bubble_type; 420 return g_shown_bubble_type;
419 } 421 }
420 422
421 PageInfoBubbleView::PageInfoBubbleView( 423 PageInfoBubbleView::PageInfoBubbleView(
422 views::View* anchor_view, 424 views::View* anchor_view,
423 gfx::NativeView parent_window, 425 gfx::NativeView parent_window,
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 PageInfo::PAGE_INFO_CONNECTION_HELP_OPENED); 787 PageInfo::PAGE_INFO_CONNECTION_HELP_OPENED);
786 break; 788 break;
787 case STYLED_LABEL_RESET_CERTIFICATE_DECISIONS: 789 case STYLED_LABEL_RESET_CERTIFICATE_DECISIONS:
788 presenter_->OnRevokeSSLErrorBypassButtonPressed(); 790 presenter_->OnRevokeSSLErrorBypassButtonPressed();
789 GetWidget()->Close(); 791 GetWidget()->Close();
790 break; 792 break;
791 default: 793 default:
792 NOTREACHED(); 794 NOTREACHED();
793 } 795 }
794 } 796 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/page_info/page_info_bubble_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698