OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/intent_picker_bubble_view.h" | 5 #include "chrome/browser/ui/views/intent_picker_bubble_view.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/i18n/rtl.h" | 8 #include "base/i18n/rtl.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/string_piece.h" | 10 #include "base/strings/string_piece.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
101 arc::ArcNavigationThrottle::CloseReason::ERROR); | 101 arc::ArcNavigationThrottle::CloseReason::ERROR); |
102 return; | 102 return; |
103 } | 103 } |
104 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser); | 104 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser); |
105 IntentPickerBubbleView* delegate = | 105 IntentPickerBubbleView* delegate = |
106 new IntentPickerBubbleView(app_info, intent_picker_cb, web_contents); | 106 new IntentPickerBubbleView(app_info, intent_picker_cb, web_contents); |
107 delegate->set_margins(gfx::Insets()); | 107 delegate->set_margins(gfx::Insets()); |
108 delegate->set_parent_window(browser_view->GetNativeWindow()); | 108 delegate->set_parent_window(browser_view->GetNativeWindow()); |
109 views::Widget* widget = | 109 views::Widget* widget = |
110 views::BubbleDialogDelegateView::CreateBubble(delegate); | 110 views::BubbleDialogDelegateView::CreateBubble(delegate); |
111 delegate->GetDialogClientView()->set_button_row_insets( | 111 delegate->GetDialogClientView()->set_button_row_insets( |
sky
2017/05/10 15:27:02
Can this be moved above line 109 such that 113 is
djacobo
2017/05/10 18:14:20
I don't think that's possible since CreateBubble c
| |
112 gfx::Insets(kDialogDelegateInsets)); | 112 gfx::Insets(kDialogDelegateInsets)); |
113 delegate->GetDialogClientView()->UpdateDialogButtons(); | |
113 | 114 |
114 delegate->SetArrowPaintType(views::BubbleBorder::PAINT_NONE); | 115 delegate->SetArrowPaintType(views::BubbleBorder::PAINT_NONE); |
115 delegate->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); | 116 delegate->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); |
116 | 117 |
117 // Using the TopContainerBoundsInScreen Rect to specify an anchor for the the | 118 // Using the TopContainerBoundsInScreen Rect to specify an anchor for the the |
118 // UI. Rect allow us to set the coordinates(x,y), the width and height for the | 119 // UI. Rect allow us to set the coordinates(x,y), the width and height for the |
119 // new Rectangle. | 120 // new Rectangle. |
120 delegate->SetAnchorRect( | 121 delegate->SetAnchorRect( |
121 gfx::Rect(browser_view->GetTopContainerBoundsInScreen().x(), | 122 gfx::Rect(browser_view->GetTopContainerBoundsInScreen().x(), |
122 browser_view->GetTopContainerBoundsInScreen().y(), | 123 browser_view->GetTopContainerBoundsInScreen().y(), |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
338 size_t index) { | 339 size_t index) { |
339 return GetIntentPickerLabelButtonAt(index)->GetTargetInkDropState(); | 340 return GetIntentPickerLabelButtonAt(index)->GetTargetInkDropState(); |
340 } | 341 } |
341 | 342 |
342 void IntentPickerBubbleView::PressButtonForTesting(size_t index, | 343 void IntentPickerBubbleView::PressButtonForTesting(size_t index, |
343 const ui::Event& event) { | 344 const ui::Event& event) { |
344 views::Button* button = | 345 views::Button* button = |
345 static_cast<views::Button*>(GetIntentPickerLabelButtonAt(index)); | 346 static_cast<views::Button*>(GetIntentPickerLabelButtonAt(index)); |
346 ButtonPressed(button, event); | 347 ButtonPressed(button, event); |
347 } | 348 } |
OLD | NEW |