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

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: reorder functions 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
« no previous file with comments | « chrome/browser/ui/views/keyboard_overlay_dialog_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..db2149c90667504d862c9ff35887e3ce9eb34bbf 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)
@@ -27,6 +32,9 @@ KeyboardOverlayDialogView::~KeyboardOverlayDialogView() {
}
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 +59,10 @@ void KeyboardOverlayDialogView::ShowDialog() {
size.height());
view->GetWidget()->SetBounds(bounds);
view->GetWidget()->Show();
+
+ g_instance = view;
+}
+
+void KeyboardOverlayDialogView::WindowClosing() {
+ g_instance = NULL;
}
« no previous file with comments | « chrome/browser/ui/views/keyboard_overlay_dialog_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698