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

Side by Side Diff: chrome/browser/ui/views/keyboard_overlay_dialog_view.cc

Issue 9250029: Enable KeyboardOverlayDialog on aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix the alignment nit. Created 8 years, 10 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
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/browser/ui/views/window.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/keyboard_overlay_dialog_view.h" 5 #include "chrome/browser/ui/views/keyboard_overlay_dialog_view.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/chromeos/frame/bubble_window.h"
9 #include "chrome/browser/chromeos/input_method/input_method_manager.h" 8 #include "chrome/browser/chromeos/input_method/input_method_manager.h"
10 #include "chrome/browser/ui/browser_dialogs.h" 9 #include "chrome/browser/ui/browser_dialogs.h"
11 #include "chrome/browser/ui/views/accelerator_table.h" 10 #include "chrome/browser/ui/views/accelerator_table.h"
12 #include "chrome/browser/ui/views/frame/browser_view.h" 11 #include "chrome/browser/ui/views/frame/browser_view.h"
13 #include "chrome/browser/ui/views/keyboard_overlay_delegate.h" 12 #include "chrome/browser/ui/views/keyboard_overlay_delegate.h"
14 #include "chrome/browser/ui/views/window.h" 13 #include "chrome/browser/ui/views/window.h"
15 #include "content/public/browser/native_web_keyboard_event.h" 14 #include "content/public/browser/native_web_keyboard_event.h"
16 #include "grit/generated_resources.h" 15 #include "grit/generated_resources.h"
17 #include "ui/base/keycodes/keyboard_codes.h" 16 #include "ui/base/keycodes/keyboard_codes.h"
18 #include "ui/base/l10n/l10n_util.h" 17 #include "ui/base/l10n/l10n_util.h"
(...skipping 11 matching lines...) Expand all
30 {ui::VKEY_OEM_2, false, true, true}, 29 {ui::VKEY_OEM_2, false, true, true},
31 {ui::VKEY_OEM_2, true, true, true}, 30 {ui::VKEY_OEM_2, true, true, true},
32 {ui::VKEY_ESCAPE, true, false, false}, 31 {ui::VKEY_ESCAPE, true, false, false},
33 }; 32 };
34 } // namespace 33 } // namespace
35 34
36 KeyboardOverlayDialogView::KeyboardOverlayDialogView( 35 KeyboardOverlayDialogView::KeyboardOverlayDialogView(
37 Profile* profile, 36 Profile* profile,
38 HtmlDialogUIDelegate* delegate, 37 HtmlDialogUIDelegate* delegate,
39 BrowserView* parent_view) 38 BrowserView* parent_view)
40 : HtmlDialogView(profile, NULL, delegate), 39 : HtmlDialogView(profile, parent_view->browser(), delegate),
41 parent_view_(parent_view) { 40 parent_view_(parent_view) {
42 } 41 }
43 42
44 KeyboardOverlayDialogView::~KeyboardOverlayDialogView() { 43 KeyboardOverlayDialogView::~KeyboardOverlayDialogView() {
45 } 44 }
46 45
47 void KeyboardOverlayDialogView::RegisterDialogAccelerators() { 46 void KeyboardOverlayDialogView::RegisterDialogAccelerators() {
48 for (size_t i = 0; i < arraysize(kCloseAccelerators); ++i) { 47 for (size_t i = 0; i < arraysize(kCloseAccelerators); ++i) {
49 ui::Accelerator accelerator(kCloseAccelerators[i].keycode, 48 ui::Accelerator accelerator(kCloseAccelerators[i].keycode,
50 kCloseAccelerators[i].shift_pressed, 49 kCloseAccelerators[i].shift_pressed,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 chromeos::input_method::InputMethodManager::GetInstance()->RemoveHotkeys(); 85 chromeos::input_method::InputMethodManager::GetInstance()->RemoveHotkeys();
87 86
88 KeyboardOverlayDelegate* delegate = new KeyboardOverlayDelegate( 87 KeyboardOverlayDelegate* delegate = new KeyboardOverlayDelegate(
89 UTF16ToWide(l10n_util::GetStringUTF16(IDS_KEYBOARD_OVERLAY_TITLE))); 88 UTF16ToWide(l10n_util::GetStringUTF16(IDS_KEYBOARD_OVERLAY_TITLE)));
90 KeyboardOverlayDialogView* html_view = 89 KeyboardOverlayDialogView* html_view =
91 new KeyboardOverlayDialogView(parent_view->browser()->profile(), 90 new KeyboardOverlayDialogView(parent_view->browser()->profile(),
92 delegate, 91 delegate,
93 parent_view); 92 parent_view);
94 delegate->set_view(html_view); 93 delegate->set_view(html_view);
95 html_view->InitDialog(); 94 html_view->InitDialog();
96 chromeos::BubbleWindow::Create(owning_window, 95 browser::CreateFramelessViewsWindow(owning_window, html_view);
97 STYLE_FLUSH,
98 html_view);
99 html_view->GetWidget()->Show(); 96 html_view->GetWidget()->Show();
100 } 97 }
101 98
102 bool KeyboardOverlayDialogView::IsCloseAccelerator( 99 bool KeyboardOverlayDialogView::IsCloseAccelerator(
103 const ui::Accelerator& accelerator) { 100 const ui::Accelerator& accelerator) {
104 return close_accelerators_.find(accelerator) != close_accelerators_.end(); 101 return close_accelerators_.find(accelerator) != close_accelerators_.end();
105 } 102 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/browser/ui/views/window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698