| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/cocoa/tab_dialogs_views_mac.h" | 5 #include "chrome/browser/ui/cocoa/tab_dialogs_views_mac.h" |
| 6 | 6 |
| 7 #include "chrome/browser/platform_util.h" | 7 #include "chrome/browser/platform_util.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/browser_window.h" | 10 #include "chrome/browser/ui/browser_window.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 LocationBarBubbleDelegateView::DisplayReason reason = | 72 LocationBarBubbleDelegateView::DisplayReason reason = |
| 73 user_action ? LocationBarBubbleDelegateView::USER_GESTURE | 73 user_action ? LocationBarBubbleDelegateView::USER_GESTURE |
| 74 : LocationBarBubbleDelegateView::AUTOMATIC; | 74 : LocationBarBubbleDelegateView::AUTOMATIC; |
| 75 ManagePasswordsBubbleView* bubble_view = new ManagePasswordsBubbleView( | 75 ManagePasswordsBubbleView* bubble_view = new ManagePasswordsBubbleView( |
| 76 web_contents(), nullptr, anchor_point, reason); | 76 web_contents(), nullptr, anchor_point, reason); |
| 77 bubble_view->set_arrow(views::BubbleBorder::TOP_RIGHT); | 77 bubble_view->set_arrow(views::BubbleBorder::TOP_RIGHT); |
| 78 bubble_view->set_parent_window(parent); | 78 bubble_view->set_parent_window(parent); |
| 79 views::BubbleDialogDelegateView::CreateBubble(bubble_view); | 79 views::BubbleDialogDelegateView::CreateBubble(bubble_view); |
| 80 bubble_view->ShowForReason(reason); | 80 bubble_view->ShowForReason(reason); |
| 81 KeepBubbleAnchored(bubble_view); | 81 KeepBubbleAnchored(bubble_view, GetManagePasswordDecoration(bubble_view)); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void TabDialogsViewsMac::HideManagePasswordsBubble() { | 84 void TabDialogsViewsMac::HideManagePasswordsBubble() { |
| 85 // Close toolkit-views bubble. | 85 // Close toolkit-views bubble. |
| 86 if (!ui::MaterialDesignController::IsSecondaryUiMaterial()) { | 86 if (!ui::MaterialDesignController::IsSecondaryUiMaterial()) { |
| 87 TabDialogsCocoa::HideManagePasswordsBubble(); | 87 TabDialogsCocoa::HideManagePasswordsBubble(); |
| 88 return; | 88 return; |
| 89 } | 89 } |
| 90 ManagePasswordsBubbleView::CloseCurrentBubble(); | 90 ManagePasswordsBubbleView::CloseCurrentBubble(); |
| 91 } | 91 } |
| OLD | NEW |