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

Unified Diff: chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.cc

Issue 1759453002: Convert location bar bubble delegates to bubble dialog delegates (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unit test Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.cc
diff --git a/chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.cc b/chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.cc
index 9b3f90bdad25d9c0dabe11713d19505fbeecacee..6267856d1cad02b66b3ca92f1978058ded355674 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view.cc
@@ -15,9 +15,9 @@
LocationBarBubbleDelegateView::LocationBarBubbleDelegateView(
views::View* anchor_view,
content::WebContents* web_contents)
- : BubbleDelegateView(anchor_view,
- anchor_view ? views::BubbleBorder::TOP_RIGHT
- : views::BubbleBorder::NONE) {
+ : BubbleDialogDelegateView(anchor_view,
+ anchor_view ? views::BubbleBorder::TOP_RIGHT
+ : views::BubbleBorder::NONE) {
// Add observer to close the bubble if the fullscreen state changes.
if (web_contents) {
Browser* browser = chrome::FindBrowserWithWebContents(web_contents);
@@ -42,19 +42,21 @@ void LocationBarBubbleDelegateView::ShowForReason(DisplayReason reason) {
}
}
+int LocationBarBubbleDelegateView::GetDialogButtons() const {
+ return ui::DIALOG_BUTTON_NONE;
+}
+
void LocationBarBubbleDelegateView::Observe(
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
DCHECK_EQ(chrome::NOTIFICATION_FULLSCREEN_CHANGED, type);
GetWidget()->SetVisibilityAnimationTransition(views::Widget::ANIMATE_NONE);
- Close();
+ CloseBubble();
}
-void LocationBarBubbleDelegateView::Close() {
- views::Widget* widget = GetWidget();
- if (!widget->IsClosed())
- widget->Close();
+void LocationBarBubbleDelegateView::CloseBubble() {
+ GetWidget()->Close();
}
void LocationBarBubbleDelegateView::AdjustForFullscreen(

Powered by Google App Engine
This is Rietveld 408576698