| 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/location_bar/location_bar_bubble_delegate_view
.h" | 5 #include "chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view
.h" |
| 6 | 6 |
| 7 #include "chrome/browser/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/browser_finder.h" | 9 #include "chrome/browser/ui/browser_finder.h" |
| 10 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" | 10 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 GetLayoutConstant(LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET), 0)); | 71 GetLayoutConstant(LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET), 0)); |
| 72 } | 72 } |
| 73 } | 73 } |
| 74 | 74 |
| 75 LocationBarBubbleDelegateView::~LocationBarBubbleDelegateView() {} | 75 LocationBarBubbleDelegateView::~LocationBarBubbleDelegateView() {} |
| 76 | 76 |
| 77 void LocationBarBubbleDelegateView::ShowForReason(DisplayReason reason) { | 77 void LocationBarBubbleDelegateView::ShowForReason(DisplayReason reason) { |
| 78 if (reason == USER_GESTURE) { | 78 if (reason == USER_GESTURE) { |
| 79 // In the USER_GESTURE case, the icon will be in an active state so the | 79 // In the USER_GESTURE case, the icon will be in an active state so the |
| 80 // bubble doesn't need an arrow. | 80 // bubble doesn't need an arrow. |
| 81 if (ui::MaterialDesignController::IsModeMaterial()) | 81 SetArrowPaintType(views::BubbleBorder::PAINT_TRANSPARENT); |
| 82 SetArrowPaintType(views::BubbleBorder::PAINT_TRANSPARENT); | |
| 83 GetWidget()->Show(); | 82 GetWidget()->Show(); |
| 84 } else { | 83 } else { |
| 85 GetWidget()->ShowInactive(); | 84 GetWidget()->ShowInactive(); |
| 86 } | 85 } |
| 87 } | 86 } |
| 88 | 87 |
| 89 int LocationBarBubbleDelegateView::GetDialogButtons() const { | 88 int LocationBarBubbleDelegateView::GetDialogButtons() const { |
| 90 return ui::DIALOG_BUTTON_NONE; | 89 return ui::DIALOG_BUTTON_NONE; |
| 91 } | 90 } |
| 92 | 91 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 108 if (GetAnchorView()) | 107 if (GetAnchorView()) |
| 109 return; | 108 return; |
| 110 | 109 |
| 111 const int kBubblePaddingFromScreenEdge = 20; | 110 const int kBubblePaddingFromScreenEdge = 20; |
| 112 int horizontal_offset = width() / 2 + kBubblePaddingFromScreenEdge; | 111 int horizontal_offset = width() / 2 + kBubblePaddingFromScreenEdge; |
| 113 const int x_pos = base::i18n::IsRTL() | 112 const int x_pos = base::i18n::IsRTL() |
| 114 ? (screen_bounds.x() + horizontal_offset) | 113 ? (screen_bounds.x() + horizontal_offset) |
| 115 : (screen_bounds.right() - horizontal_offset); | 114 : (screen_bounds.right() - horizontal_offset); |
| 116 SetAnchorRect(gfx::Rect(x_pos, screen_bounds.y(), 0, 0)); | 115 SetAnchorRect(gfx::Rect(x_pos, screen_bounds.y(), 0, 0)); |
| 117 } | 116 } |
| OLD | NEW |