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

Side by Side Diff: ash/keyboard_overlay/keyboard_overlay_view.cc

Issue 10824023: Revert "Revert 148383 - Move the keyboard overlay view to ash." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ash/keyboard_overlay/keyboard_overlay_view.h"
6
7 #include "ash/keyboard_overlay/keyboard_overlay_delegate.h"
8 #include "base/utf_string_conversions.h"
9 #include "content/public/browser/browser_context.h"
10 #include "grit/ash_strings.h"
11 #include "ui/base/l10n/l10n_util.h"
12 #include "ui/gfx/screen.h"
13 #include "ui/views/widget/widget.h"
14 #include "ui/web_dialogs/web_dialog_delegate.h"
15
16 using ui::WebDialogDelegate;
17
18 namespace {
19 // Store the pointer to the view currently shown.
20 KeyboardOverlayView* g_instance = NULL;
21 }
22
23 KeyboardOverlayView::KeyboardOverlayView(
24 content::BrowserContext* context,
25 WebDialogDelegate* delegate,
26 WebContentsHandler* handler)
27 : views::WebDialogView(context, delegate, handler) {
28 }
29
30 KeyboardOverlayView::~KeyboardOverlayView() {
31 }
32
33 void KeyboardOverlayView::ShowDialog(
34 content::BrowserContext* context,
35 WebContentsHandler* handler,
36 const GURL& url) {
37 // Ignore the call if another view is already shown.
38 if (g_instance)
39 return;
40
41 KeyboardOverlayDelegate* delegate = new KeyboardOverlayDelegate(
42 l10n_util::GetStringUTF16(IDS_ASH_KEYBOARD_OVERLAY_TITLE), url);
43 KeyboardOverlayView* view =
44 new KeyboardOverlayView(context, delegate, handler);
45 delegate->Show(view);
46
47 g_instance = view;
48 }
49
50 void KeyboardOverlayView::WindowClosing() {
51 g_instance = NULL;
52 }
OLDNEW
« no previous file with comments | « ash/keyboard_overlay/keyboard_overlay_view.h ('k') | chrome/browser/ui/views/ash/chrome_shell_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698