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 #include "chrome/browser/ui/views/keyboard_overlay_delegate.h" | 5 #include "chrome/browser/ui/views/keyboard_overlay_delegate.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
11 #include "chrome/browser/ui/views/html_dialog_view.h" | 11 #include "chrome/browser/ui/views/html_dialog_view.h" |
12 #include "chrome/browser/ui/webui/html_dialog_ui.h" | 12 #include "chrome/browser/ui/webui/html_dialog_ui.h" |
13 #include "chrome/common/url_constants.h" | 13 #include "chrome/common/url_constants.h" |
14 #include "grit/generated_resources.h" | 14 #include "grit/generated_resources.h" |
15 #include "ui/base/l10n/l10n_util.h" | 15 #include "ui/base/l10n/l10n_util.h" |
16 #include "ui/gfx/screen.h" | 16 #include "ui/gfx/screen.h" |
17 | 17 |
18 | 18 |
19 static const int kBaseWidth = 1252; | 19 static const int kBaseWidth = 1252; |
20 static const int kBaseHeight = 516; | 20 static const int kBaseHeight = 516; |
21 static const int kHorizontalMargin = 28; | 21 static const int kHorizontalMargin = 28; |
22 | 22 |
23 KeyboardOverlayDelegate::KeyboardOverlayDelegate( | 23 KeyboardOverlayDelegate::KeyboardOverlayDelegate( |
24 const std::wstring& title) | 24 const std::wstring& title) |
25 : title_(title), | 25 : title_(WideToUTF16Hack(title)), |
26 view_(NULL) { | 26 view_(NULL) { |
27 } | 27 } |
28 | 28 |
29 KeyboardOverlayDelegate::~KeyboardOverlayDelegate() { | 29 KeyboardOverlayDelegate::~KeyboardOverlayDelegate() { |
30 } | 30 } |
31 | 31 |
32 bool KeyboardOverlayDelegate::IsDialogModal() const { | 32 bool KeyboardOverlayDelegate::IsDialogModal() const { |
33 return true; | 33 return true; |
34 } | 34 } |
35 | 35 |
36 std::wstring KeyboardOverlayDelegate::GetDialogTitle() const { | 36 string16 KeyboardOverlayDelegate::GetDialogTitle() const { |
37 return title_; | 37 return title_; |
38 } | 38 } |
39 | 39 |
40 GURL KeyboardOverlayDelegate::GetDialogContentURL() const { | 40 GURL KeyboardOverlayDelegate::GetDialogContentURL() const { |
41 std::string url_string(chrome::kChromeUIKeyboardOverlayURL); | 41 std::string url_string(chrome::kChromeUIKeyboardOverlayURL); |
42 return GURL(url_string); | 42 return GURL(url_string); |
43 } | 43 } |
44 | 44 |
45 void KeyboardOverlayDelegate::GetWebUIMessageHandlers( | 45 void KeyboardOverlayDelegate::GetWebUIMessageHandlers( |
46 std::vector<WebUIMessageHandler*>* handlers) const { | 46 std::vector<WebUIMessageHandler*>* handlers) const { |
(...skipping 25 matching lines...) Expand all Loading... |
72 } | 72 } |
73 | 73 |
74 bool KeyboardOverlayDelegate::ShouldShowDialogTitle() const { | 74 bool KeyboardOverlayDelegate::ShouldShowDialogTitle() const { |
75 return false; | 75 return false; |
76 } | 76 } |
77 | 77 |
78 bool KeyboardOverlayDelegate::HandleContextMenu( | 78 bool KeyboardOverlayDelegate::HandleContextMenu( |
79 const ContextMenuParams& params) { | 79 const ContextMenuParams& params) { |
80 return true; | 80 return true; |
81 } | 81 } |
OLD | NEW |