forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move the keyboard overlay view to ash.
This change introduces an issue when Shift+Alt is pressed (http://code.google.com/p/chromium/issues/detail?id=131159). I'll fix it shortly together with the more general issue (http://code.google.com/p/chromium/issues/detail?id=129834). BUG=124222 TEST=None Review URL: https://chromiumcodereview.appspot.com/10829003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148383 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
mazda@chromium.org
committed
Jul 25, 2012
1 parent
73c7151
commit 3d86000
Showing
11 changed files
with
122 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Copyright (c) 2012 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "ash/keyboard_overlay/keyboard_overlay_view.h" | ||
|
||
#include "ash/keyboard_overlay/keyboard_overlay_delegate.h" | ||
#include "base/utf_string_conversions.h" | ||
#include "content/public/browser/browser_context.h" | ||
#include "grit/ash_strings.h" | ||
#include "ui/base/l10n/l10n_util.h" | ||
#include "ui/gfx/screen.h" | ||
#include "ui/views/widget/widget.h" | ||
#include "ui/web_dialogs/web_dialog_delegate.h" | ||
|
||
using ui::WebDialogDelegate; | ||
|
||
namespace { | ||
// Store the pointer to the view currently shown. | ||
KeyboardOverlayView* g_instance = NULL; | ||
} | ||
|
||
KeyboardOverlayView::KeyboardOverlayView( | ||
content::BrowserContext* context, | ||
WebDialogDelegate* delegate, | ||
WebContentsHandler* handler) | ||
: views::WebDialogView(context, delegate, handler) { | ||
} | ||
|
||
KeyboardOverlayView::~KeyboardOverlayView() { | ||
} | ||
|
||
void KeyboardOverlayView::ShowDialog( | ||
content::BrowserContext* context, | ||
WebContentsHandler* handler, | ||
const GURL& url) { | ||
// Ignore the call if another view is already shown. | ||
if (g_instance) | ||
return; | ||
|
||
KeyboardOverlayDelegate* delegate = new KeyboardOverlayDelegate( | ||
l10n_util::GetStringUTF16(IDS_ASH_KEYBOARD_OVERLAY_TITLE), url); | ||
KeyboardOverlayView* view = | ||
new KeyboardOverlayView(context, delegate, handler); | ||
delegate->Show(view); | ||
|
||
g_instance = view; | ||
} | ||
|
||
void KeyboardOverlayView::WindowClosing() { | ||
g_instance = NULL; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright (c) 2012 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef ASH_KEYBOARD_OVERLAY_KEYBOARD_OVERLAY_VIEW_H_ | ||
#define ASH_KEYBOARD_OVERLAY_KEYBOARD_OVERLAY_VIEW_H_ | ||
|
||
#include "ash/ash_export.h" | ||
#include "base/compiler_specific.h" | ||
#include "ui/views/controls/webview/web_dialog_view.h" | ||
|
||
class GURL; | ||
|
||
namespace content { | ||
class BrowserContext; | ||
} | ||
|
||
namespace ui { | ||
class WebDialogDelegate; | ||
} | ||
|
||
// A customized dialog view for the keyboard overlay. | ||
class ASH_EXPORT KeyboardOverlayView : public views::WebDialogView { | ||
public: | ||
KeyboardOverlayView(content::BrowserContext* context, | ||
ui::WebDialogDelegate* delegate, | ||
WebContentsHandler* handler); | ||
virtual ~KeyboardOverlayView(); | ||
|
||
// Shows the keyboard overlay. | ||
static void ShowDialog(content::BrowserContext* context, | ||
WebContentsHandler* handler, | ||
const GURL& url); | ||
|
||
private: | ||
// Overridden from views::WidgetDelegate: | ||
virtual void WindowClosing() OVERRIDE; | ||
|
||
DISALLOW_COPY_AND_ASSIGN(KeyboardOverlayView); | ||
}; | ||
|
||
#endif // ASH_KEYBOARD_OVERLAY_KEYBOARD_OVERLAY_VIEW_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters