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 "components/app_modal/views/javascript_app_modal_dialog_views.h" | 5 #include "components/app_modal/views/javascript_app_modal_dialog_views.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "components/app_modal/javascript_app_modal_dialog.h" | 8 #include "components/app_modal/javascript_app_modal_dialog.h" |
9 #include "components/constrained_window/constrained_window_views.h" | 9 #include "components/constrained_window/constrained_window_views.h" |
10 #include "grit/components_strings.h" | 10 #include "grit/components_strings.h" |
11 #include "ui/base/l10n/l10n_util.h" | 11 #include "ui/base/l10n/l10n_util.h" |
12 #include "ui/events/keycodes/keyboard_codes.h" | 12 #include "ui/events/keycodes/keyboard_codes.h" |
13 #include "ui/views/controls/message_box_view.h" | 13 #include "ui/views/controls/message_box_view.h" |
14 #include "ui/views/controls/textfield/textfield.h" | 14 #include "ui/views/controls/textfield/textfield.h" |
15 #include "ui/views/widget/widget.h" | 15 #include "ui/views/widget/widget.h" |
16 #include "ui/views/window/dialog_client_view.h" | 16 #include "ui/views/window/dialog_client_view.h" |
17 | 17 |
| 18 namespace app_modal { |
| 19 |
18 //////////////////////////////////////////////////////////////////////////////// | 20 //////////////////////////////////////////////////////////////////////////////// |
19 // JavaScriptAppModalDialogViews, public: | 21 // JavaScriptAppModalDialogViews, public: |
20 | 22 |
21 JavaScriptAppModalDialogViews::JavaScriptAppModalDialogViews( | 23 JavaScriptAppModalDialogViews::JavaScriptAppModalDialogViews( |
22 JavaScriptAppModalDialog* parent) | 24 JavaScriptAppModalDialog* parent) |
23 : parent_(parent) { | 25 : parent_(parent) { |
24 int options = views::MessageBoxView::DETECT_DIRECTIONALITY; | 26 int options = views::MessageBoxView::DETECT_DIRECTIONALITY; |
25 if (parent->javascript_message_type() == | 27 if (parent->javascript_message_type() == |
26 content::JAVASCRIPT_MESSAGE_TYPE_PROMPT) | 28 content::JAVASCRIPT_MESSAGE_TYPE_PROMPT) |
27 options |= views::MessageBoxView::HAS_PROMPT_FIELD; | 29 options |= views::MessageBoxView::HAS_PROMPT_FIELD; |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 146 |
145 views::View* JavaScriptAppModalDialogViews::GetContentsView() { | 147 views::View* JavaScriptAppModalDialogViews::GetContentsView() { |
146 return message_box_view_; | 148 return message_box_view_; |
147 } | 149 } |
148 | 150 |
149 views::View* JavaScriptAppModalDialogViews::GetInitiallyFocusedView() { | 151 views::View* JavaScriptAppModalDialogViews::GetInitiallyFocusedView() { |
150 if (message_box_view_->text_box()) | 152 if (message_box_view_->text_box()) |
151 return message_box_view_->text_box(); | 153 return message_box_view_->text_box(); |
152 return views::DialogDelegate::GetInitiallyFocusedView(); | 154 return views::DialogDelegate::GetInitiallyFocusedView(); |
153 } | 155 } |
| 156 |
| 157 } // namespace app_modal |
OLD | NEW |