OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_UI_VIEWS_KEYBOARD_OVERLAY_DIALOG_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_KEYBOARD_OVERLAY_DIALOG_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_KEYBOARD_OVERLAY_DIALOG_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_KEYBOARD_OVERLAY_DIALOG_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 | 10 |
11 #include "chrome/browser/ui/webui/html_dialog_tab_contents_delegate.h" | 11 #include "chrome/browser/ui/webui/html_dialog_tab_contents_delegate.h" |
12 #include "chrome/browser/ui/webui/html_dialog_ui.h" | 12 #include "chrome/browser/ui/webui/html_dialog_ui.h" |
13 #include "chrome/browser/ui/views/html_dialog_view.h" | 13 #include "chrome/browser/ui/views/html_dialog_view.h" |
14 | 14 |
| 15 namespace ui { |
| 16 class Accelerator; |
| 17 } |
| 18 |
15 class BrowserView; | 19 class BrowserView; |
16 | 20 |
17 // A customized dialog view for the keyboard overlay. | 21 // A customized dialog view for the keyboard overlay. |
18 class KeyboardOverlayDialogView : public HtmlDialogView { | 22 class KeyboardOverlayDialogView : public HtmlDialogView { |
19 public: | 23 public: |
20 KeyboardOverlayDialogView(Profile* profile, | 24 KeyboardOverlayDialogView(Profile* profile, |
21 HtmlDialogUIDelegate* delegate, | 25 HtmlDialogUIDelegate* delegate, |
22 BrowserView* parent_view); | 26 BrowserView* parent_view); |
23 virtual ~KeyboardOverlayDialogView(); | 27 virtual ~KeyboardOverlayDialogView(); |
24 | 28 |
25 // Overridden from views::View: | 29 // Overridden from views::View: |
26 virtual bool AcceleratorPressed(const views::Accelerator& accelerator); | 30 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator); |
27 | 31 |
28 // Shows the keyboard overlay. | 32 // Shows the keyboard overlay. |
29 static void ShowDialog(gfx::NativeWindow owning_window, BrowserView* parent); | 33 static void ShowDialog(gfx::NativeWindow owning_window, BrowserView* parent); |
30 | 34 |
31 private: | 35 private: |
32 virtual void RegisterDialogAccelerators() OVERRIDE; | 36 virtual void RegisterDialogAccelerators() OVERRIDE; |
33 | 37 |
34 // Returns true if |accelerator| is an accelerator for closing the dialog. | 38 // Returns true if |accelerator| is an accelerator for closing the dialog. |
35 bool IsCloseAccelerator(const views::Accelerator& accelerator); | 39 bool IsCloseAccelerator(const ui::Accelerator& accelerator); |
36 | 40 |
37 // Points to the view from which this dialog is created. | 41 // Points to the view from which this dialog is created. |
38 BrowserView* parent_view_; | 42 BrowserView* parent_view_; |
39 | 43 |
40 // Contains accelerators for closing this dialog. | 44 // Contains accelerators for closing this dialog. |
41 std::set<views::Accelerator> close_accelerators_; | 45 std::set<ui::Accelerator> close_accelerators_; |
42 | 46 |
43 DISALLOW_COPY_AND_ASSIGN(KeyboardOverlayDialogView); | 47 DISALLOW_COPY_AND_ASSIGN(KeyboardOverlayDialogView); |
44 }; | 48 }; |
45 | 49 |
46 #endif // CHROME_BROWSER_UI_VIEWS_KEYBOARD_OVERLAY_DIALOG_VIEW_H_ | 50 #endif // CHROME_BROWSER_UI_VIEWS_KEYBOARD_OVERLAY_DIALOG_VIEW_H_ |
OLD | NEW |