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

Unified Diff: ui/views/bubble/bubble_dialog_delegate.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: fix ImmersiveFullscreenController 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: ui/views/bubble/bubble_dialog_delegate.cc
diff --git a/ui/views/bubble/bubble_dialog_delegate.cc b/ui/views/bubble/bubble_dialog_delegate.cc
index a893bcf23268a16c9b54f8c428cdc24e021e15dc..947efa586e78d8fd2360a2099561d3f243d1a2ff 100644
--- a/ui/views/bubble/bubble_dialog_delegate.cc
+++ b/ui/views/bubble/bubble_dialog_delegate.cc
@@ -83,6 +83,10 @@ Widget* BubbleDialogDelegateView::CreateBubble(
return bubble_widget;
}
+BubbleDialogDelegateView* BubbleDialogDelegateView::AsBubbleDialogDelegate() {
+ return this;
+}
+
bool BubbleDialogDelegateView::ShouldShowCloseButton() const {
return false;
}
@@ -208,8 +212,7 @@ BubbleDialogDelegateView::BubbleDialogDelegateView()
BubbleDialogDelegateView::BubbleDialogDelegateView(View* anchor_view,
BubbleBorder::Arrow arrow)
- : close_on_esc_(true),
- close_on_deactivate_(true),
+ : close_on_deactivate_(true),
anchor_view_storage_id_(ViewStorage::GetInstance()->CreateStorageID()),
anchor_widget_(NULL),
arrow_(arrow),
@@ -226,7 +229,6 @@ BubbleDialogDelegateView::BubbleDialogDelegateView(View* anchor_view,
close_reason_(CloseReason::UNKNOWN) {
if (anchor_view)
SetAnchorView(anchor_view);
- AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE));
UpdateColorsFromTheme(GetNativeTheme());
}
@@ -244,15 +246,6 @@ const gfx::FontList& BubbleDialogDelegateView::GetTitleFontList() const {
return rb.GetFontList(ui::ResourceBundle::MediumFont);
}
-bool BubbleDialogDelegateView::AcceleratorPressed(
- const ui::Accelerator& accelerator) {
- if (!close_on_esc() || accelerator.key_code() != ui::VKEY_ESCAPE)
- return false;
- close_reason_ = CloseReason::ESCAPE;
- GetWidget()->Close();
- return true;
-}
-
void BubbleDialogDelegateView::OnNativeThemeChanged(
const ui::NativeTheme* theme) {
UpdateColorsFromTheme(theme);

Powered by Google App Engine
This is Rietveld 408576698