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

Side by Side Diff: chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.cc

Issue 2348853004: Remove non-md code in location bar (Views). (Closed)
Patch Set: resolve change collision Created 4 years, 3 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
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/location_bar/keyword_hint_view.cc ('k') | chrome/browser/ui/views/location_bar/location_bar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698