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()->SetButtonRowInsets( |
112 gfx::Insets(kDialogDelegateInsets)); | 112 gfx::Insets(kDialogDelegateInsets)); |
113 | 113 |
114 delegate->SetArrowPaintType(views::BubbleBorder::PAINT_NONE); | 114 delegate->SetArrowPaintType(views::BubbleBorder::PAINT_NONE); |
115 delegate->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); | 115 delegate->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); |
116 | 116 |
117 // Using the TopContainerBoundsInScreen Rect to specify an anchor for the the | 117 // 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 | 118 // UI. Rect allow us to set the coordinates(x,y), the width and height for the |
119 // new Rectangle. | 119 // new Rectangle. |
120 delegate->SetAnchorRect( | 120 delegate->SetAnchorRect( |
121 gfx::Rect(browser_view->GetTopContainerBoundsInScreen().x(), | 121 gfx::Rect(browser_view->GetTopContainerBoundsInScreen().x(), |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 size_t index) { | 338 size_t index) { |
339 return GetIntentPickerLabelButtonAt(index)->GetTargetInkDropState(); | 339 return GetIntentPickerLabelButtonAt(index)->GetTargetInkDropState(); |
340 } | 340 } |
341 | 341 |
342 void IntentPickerBubbleView::PressButtonForTesting(size_t index, | 342 void IntentPickerBubbleView::PressButtonForTesting(size_t index, |
343 const ui::Event& event) { | 343 const ui::Event& event) { |
344 views::Button* button = | 344 views::Button* button = |
345 static_cast<views::Button*>(GetIntentPickerLabelButtonAt(index)); | 345 static_cast<views::Button*>(GetIntentPickerLabelButtonAt(index)); |
346 ButtonPressed(button, event); | 346 ButtonPressed(button, event); |
347 } | 347 } |
OLD | NEW |