Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(503)

Side by Side Diff: chrome/browser/ui/views/website_settings/chooser_bubble_ui_view.cc

Issue 2379783003: [omnibox] Return reference to ImageView instead of LocationIconView (2) (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/chooser_bubble_ui_view.h" 5 #include "chrome/browser/ui/views/website_settings/chooser_bubble_ui_view.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/ptr_util.h" 12 #include "base/memory/ptr_util.h"
13 #include "base/strings/string16.h" 13 #include "base/strings/string16.h"
14 #include "chrome/browser/chooser_controller/chooser_controller.h" 14 #include "chrome/browser/chooser_controller/chooser_controller.h"
15 #include "chrome/browser/ui/browser.h" 15 #include "chrome/browser/ui/browser.h"
16 #include "chrome/browser/ui/browser_window.h" 16 #include "chrome/browser/ui/browser_window.h"
17 #include "chrome/browser/ui/views/chooser_content_view.h" 17 #include "chrome/browser/ui/views/chooser_content_view.h"
18 #include "chrome/browser/ui/views/exclusive_access_bubble_views.h" 18 #include "chrome/browser/ui/views/exclusive_access_bubble_views.h"
19 #include "chrome/browser/ui/views/frame/browser_view.h" 19 #include "chrome/browser/ui/views/frame/browser_view.h"
20 #include "chrome/browser/ui/views/frame/top_container_view.h" 20 #include "chrome/browser/ui/views/frame/top_container_view.h"
21 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" 21 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
22 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" 22 #include "chrome/browser/ui/views/location_bar/location_icon_view.h"
23 #include "chrome/browser/ui/website_settings/chooser_bubble_delegate.h" 23 #include "chrome/browser/ui/website_settings/chooser_bubble_delegate.h"
24 #include "components/bubble/bubble_controller.h" 24 #include "components/bubble/bubble_controller.h"
25 #include "ui/views/controls/image_view.h"
25 #include "ui/views/controls/link.h" 26 #include "ui/views/controls/link.h"
26 #include "ui/views/controls/styled_label.h" 27 #include "ui/views/controls/styled_label.h"
27 #include "ui/views/controls/table/table_view_observer.h" 28 #include "ui/views/controls/table/table_view_observer.h"
28 #include "ui/views/window/dialog_client_view.h" 29 #include "ui/views/window/dialog_client_view.h"
29 30
30 std::unique_ptr<BubbleUi> ChooserBubbleDelegate::BuildBubbleUi() { 31 std::unique_ptr<BubbleUi> ChooserBubbleDelegate::BuildBubbleUi() {
31 return base::MakeUnique<ChooserBubbleUiView>(browser_, 32 return base::MakeUnique<ChooserBubbleUiView>(browser_,
32 std::move(chooser_controller_)); 33 std::move(chooser_controller_));
33 } 34 }
34 35
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 218
218 void ChooserBubbleUiView::UpdateAnchorPosition() { 219 void ChooserBubbleUiView::UpdateAnchorPosition() {
219 chooser_bubble_ui_view_delegate_->UpdateAnchor(GetAnchorView(), 220 chooser_bubble_ui_view_delegate_->UpdateAnchor(GetAnchorView(),
220 GetAnchorArrow()); 221 GetAnchorArrow());
221 } 222 }
222 223
223 views::View* ChooserBubbleUiView::GetAnchorView() { 224 views::View* ChooserBubbleUiView::GetAnchorView() {
224 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser_); 225 BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser_);
225 226
226 if (browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR)) 227 if (browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR))
227 return browser_view->GetLocationBarView()->location_icon_view(); 228 return browser_view->GetLocationBarView()
229 ->location_icon_view()
230 ->GetImageView();
228 231
229 if (browser_view->IsFullscreenBubbleVisible()) 232 if (browser_view->IsFullscreenBubbleVisible())
230 return browser_view->exclusive_access_bubble()->GetView(); 233 return browser_view->exclusive_access_bubble()->GetView();
231 234
232 return browser_view->top_container(); 235 return browser_view->top_container();
233 } 236 }
234 237
235 views::BubbleBorder::Arrow ChooserBubbleUiView::GetAnchorArrow() { 238 views::BubbleBorder::Arrow ChooserBubbleUiView::GetAnchorArrow() {
236 if (browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR)) 239 if (browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR))
237 return views::BubbleBorder::TOP_LEFT; 240 return views::BubbleBorder::TOP_LEFT;
238 return views::BubbleBorder::NONE; 241 return views::BubbleBorder::NONE;
239 } 242 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698