Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 355 // Update the border in the bubble: will either add or remove the arrow. | 355 // Update the border in the bubble: will either add or remove the arrow. |
| 356 views::BubbleFrameView* frame = | 356 views::BubbleFrameView* frame = |
| 357 views::BubbleDialogDelegateView::GetBubbleFrameView(); | 357 views::BubbleDialogDelegateView::GetBubbleFrameView(); |
| 358 views::BubbleBorder::Arrow adjusted_arrow = anchor_arrow; | 358 views::BubbleBorder::Arrow adjusted_arrow = anchor_arrow; |
| 359 if (base::i18n::IsRTL()) | 359 if (base::i18n::IsRTL()) |
| 360 adjusted_arrow = views::BubbleBorder::horizontal_mirror(adjusted_arrow); | 360 adjusted_arrow = views::BubbleBorder::horizontal_mirror(adjusted_arrow); |
| 361 frame->SetBubbleBorder(std::unique_ptr<views::BubbleBorder>( | 361 frame->SetBubbleBorder(std::unique_ptr<views::BubbleBorder>( |
| 362 new views::BubbleBorder(adjusted_arrow, shadow(), color()))); | 362 new views::BubbleBorder(adjusted_arrow, shadow(), color()))); |
| 363 | 363 |
| 364 // Reposition the bubble based on the updated arrow and view. | 364 // Reposition the bubble based on the updated arrow and view. |
| 365 if (anchor_view) | 365 SetAnchorView(anchor_view); |
|
Matt Giuca
2016/07/05 05:44:20
This change was necessary to properly respond to t
benwells
2016/07/06 01:08:53
Acknowledged.
| |
| 366 SetAnchorView(anchor_view); | 366 // The anchor rect is ignored unless |anchor_view| is nullptr. |
| 367 else | 367 SetAnchorRect(gfx::Rect(anchor_point, gfx::Size())); |
| 368 SetAnchorRect(gfx::Rect(anchor_point, gfx::Size())); | |
| 369 } | 368 } |
| 370 | 369 |
| 371 ////////////////////////////////////////////////////////////////////////////// | 370 ////////////////////////////////////////////////////////////////////////////// |
| 372 // PermissionBubbleViewViews | 371 // PermissionBubbleViewViews |
| 373 | 372 |
| 374 PermissionBubbleViewViews::PermissionBubbleViewViews(Browser* browser) | 373 PermissionBubbleViewViews::PermissionBubbleViewViews(Browser* browser) |
| 375 : browser_(browser), | 374 : browser_(browser), |
| 376 delegate_(nullptr), | 375 delegate_(nullptr), |
| 377 bubble_delegate_(nullptr) { | 376 bubble_delegate_(nullptr) { |
| 378 DCHECK(browser); | 377 DCHECK(browser); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 452 | 451 |
| 453 void PermissionBubbleViewViews::Accept() { | 452 void PermissionBubbleViewViews::Accept() { |
| 454 if (delegate_) | 453 if (delegate_) |
| 455 delegate_->Accept(); | 454 delegate_->Accept(); |
| 456 } | 455 } |
| 457 | 456 |
| 458 void PermissionBubbleViewViews::Deny() { | 457 void PermissionBubbleViewViews::Deny() { |
| 459 if (delegate_) | 458 if (delegate_) |
| 460 delegate_->Deny(); | 459 delegate_->Deny(); |
| 461 } | 460 } |
| OLD | NEW |