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

Side by Side Diff: chrome/browser/ui/views/website_settings/permissions_bubble_view.cc

Issue 2127703006: Permission prompts show in the top-left corner in fullscreen mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/website_settings/permissions_bubble_view.h" 5 #include "chrome/browser/ui/views/website_settings/permissions_bubble_view.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 // Update the border in the bubble: will either add or remove the arrow. 354 // Update the border in the bubble: will either add or remove the arrow.
355 views::BubbleFrameView* frame = 355 views::BubbleFrameView* frame =
356 views::BubbleDialogDelegateView::GetBubbleFrameView(); 356 views::BubbleDialogDelegateView::GetBubbleFrameView();
357 views::BubbleBorder::Arrow adjusted_arrow = anchor_arrow; 357 views::BubbleBorder::Arrow adjusted_arrow = anchor_arrow;
358 if (base::i18n::IsRTL()) 358 if (base::i18n::IsRTL())
359 adjusted_arrow = views::BubbleBorder::horizontal_mirror(adjusted_arrow); 359 adjusted_arrow = views::BubbleBorder::horizontal_mirror(adjusted_arrow);
360 frame->SetBubbleBorder(std::unique_ptr<views::BubbleBorder>( 360 frame->SetBubbleBorder(std::unique_ptr<views::BubbleBorder>(
361 new views::BubbleBorder(adjusted_arrow, shadow(), color()))); 361 new views::BubbleBorder(adjusted_arrow, shadow(), color())));
362 362
363 // Reposition the bubble based on the updated arrow and view. 363 // Reposition the bubble based on the updated arrow and view.
364 if (anchor_view) 364 SetAnchorView(anchor_view);
365 SetAnchorView(anchor_view); 365 // The anchor rect is ignored unless |anchor_view| is nullptr.
366 else 366 SetAnchorRect(gfx::Rect(anchor_point, gfx::Size()));
367 SetAnchorRect(gfx::Rect(anchor_point, gfx::Size()));
368 } 367 }
369 368
370 ////////////////////////////////////////////////////////////////////////////// 369 //////////////////////////////////////////////////////////////////////////////
371 // PermissionBubbleViewViews 370 // PermissionBubbleViewViews
372 371
373 PermissionBubbleViewViews::PermissionBubbleViewViews(Browser* browser) 372 PermissionBubbleViewViews::PermissionBubbleViewViews(Browser* browser)
374 : browser_(browser), 373 : browser_(browser),
375 delegate_(nullptr), 374 delegate_(nullptr),
376 bubble_delegate_(nullptr) { 375 bubble_delegate_(nullptr) {
377 DCHECK(browser); 376 DCHECK(browser);
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 450
452 void PermissionBubbleViewViews::Accept() { 451 void PermissionBubbleViewViews::Accept() {
453 if (delegate_) 452 if (delegate_)
454 delegate_->Accept(); 453 delegate_->Accept();
455 } 454 }
456 455
457 void PermissionBubbleViewViews::Deny() { 456 void PermissionBubbleViewViews::Deny() {
458 if (delegate_) 457 if (delegate_)
459 delegate_->Deny(); 458 delegate_->Deny();
460 } 459 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698