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

Unified Diff: chrome/browser/ui/views/keyboard_overlay_dialog_view.cc

Issue 10447125: Show only one instance of the keyboard overlay. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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/keyboard_overlay_dialog_view.cc
diff --git a/chrome/browser/ui/views/keyboard_overlay_dialog_view.cc b/chrome/browser/ui/views/keyboard_overlay_dialog_view.cc
index 432c31024fefa358c1add513c262fd981c795530..2cd32eac53b726576762c7d8fbeb50b6138cdf9f 100644
--- a/chrome/browser/ui/views/keyboard_overlay_dialog_view.cc
+++ b/chrome/browser/ui/views/keyboard_overlay_dialog_view.cc
@@ -17,6 +17,11 @@
using ui::WebDialogDelegate;
+namespace {
+// Store the pointer to the view currently shown.
+KeyboardOverlayDialogView* g_instance = NULL;
+}
+
KeyboardOverlayDialogView::KeyboardOverlayDialogView(
Profile* profile,
WebDialogDelegate* delegate)
@@ -26,7 +31,14 @@ KeyboardOverlayDialogView::KeyboardOverlayDialogView(
KeyboardOverlayDialogView::~KeyboardOverlayDialogView() {
}
+void KeyboardOverlayDialogView::WindowClosing() {
+ g_instance = NULL;
+}
+
void KeyboardOverlayDialogView::ShowDialog() {
+ // Ignore the call if another view is already shown.
+ if (g_instance)
+ return;
KeyboardOverlayDelegate* delegate = new KeyboardOverlayDelegate(
l10n_util::GetStringUTF16(IDS_KEYBOARD_OVERLAY_TITLE));
@@ -51,4 +63,6 @@ void KeyboardOverlayDialogView::ShowDialog() {
size.height());
view->GetWidget()->SetBounds(bounds);
view->GetWidget()->Show();
+
+ g_instance = view;
}

Powered by Google App Engine
This is Rietveld 408576698