OLD | NEW |
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_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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
12 #include "base/values.h" | 12 #include "base/values.h" |
13 #include "chrome/browser/ui/views/web_dialog_view.h" | |
14 #include "chrome/common/url_constants.h" | 13 #include "chrome/common/url_constants.h" |
15 #include "content/public/browser/web_ui.h" | 14 #include "content/public/browser/web_ui.h" |
16 #include "content/public/browser/web_ui_message_handler.h" | 15 #include "content/public/browser/web_ui_message_handler.h" |
17 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
18 #include "grit/generated_resources.h" | 17 #include "grit/generated_resources.h" |
19 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
20 #include "ui/gfx/screen.h" | 19 #include "ui/gfx/screen.h" |
| 20 #include "ui/views/controls/webview/web_dialog_view.h" |
21 #include "ui/views/widget/widget.h" | 21 #include "ui/views/widget/widget.h" |
22 | 22 |
23 using content::WebContents; | 23 using content::WebContents; |
24 using content::WebUIMessageHandler; | 24 using content::WebUIMessageHandler; |
25 | 25 |
26 namespace { | 26 namespace { |
27 | 27 |
28 const int kBaseWidth = 1252; | 28 const int kBaseWidth = 1252; |
29 const int kBaseHeight = 516; | 29 const int kBaseHeight = 516; |
30 const int kHorizontalMargin = 28; | 30 const int kHorizontalMargin = 28; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 } // namespace | 62 } // namespace |
63 | 63 |
64 KeyboardOverlayDelegate::KeyboardOverlayDelegate(const string16& title) | 64 KeyboardOverlayDelegate::KeyboardOverlayDelegate(const string16& title) |
65 : title_(title), | 65 : title_(title), |
66 view_(NULL) { | 66 view_(NULL) { |
67 } | 67 } |
68 | 68 |
69 KeyboardOverlayDelegate::~KeyboardOverlayDelegate() { | 69 KeyboardOverlayDelegate::~KeyboardOverlayDelegate() { |
70 } | 70 } |
71 | 71 |
72 void KeyboardOverlayDelegate::Show(WebDialogView* view) { | 72 void KeyboardOverlayDelegate::Show(views::WebDialogView* view) { |
73 view_ = view; | 73 view_ = view; |
74 | 74 |
75 views::Widget* widget = new views::Widget; | 75 views::Widget* widget = new views::Widget; |
76 views::Widget::InitParams params( | 76 views::Widget::InitParams params( |
77 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 77 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
78 params.delegate = view; | 78 params.delegate = view; |
79 widget->Init(params); | 79 widget->Init(params); |
80 | 80 |
81 // Show the widget at the bottom of the work area. | 81 // Show the widget at the bottom of the work area. |
82 gfx::Size size; | 82 gfx::Size size; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 } | 136 } |
137 | 137 |
138 bool KeyboardOverlayDelegate::ShouldShowDialogTitle() const { | 138 bool KeyboardOverlayDelegate::ShouldShowDialogTitle() const { |
139 return false; | 139 return false; |
140 } | 140 } |
141 | 141 |
142 bool KeyboardOverlayDelegate::HandleContextMenu( | 142 bool KeyboardOverlayDelegate::HandleContextMenu( |
143 const content::ContextMenuParams& params) { | 143 const content::ContextMenuParams& params) { |
144 return true; | 144 return true; |
145 } | 145 } |
OLD | NEW |