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/js_modal_dialog_views.h" | 5 #include "chrome/browser/ui/views/js_modal_dialog_views.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" | 8 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" |
9 #include "chrome/browser/ui/views/window.h" | 9 #include "chrome/browser/ui/views/window.h" |
10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 return UTF16ToWide(l10n_util::GetStringUTF16( | 126 return UTF16ToWide(l10n_util::GetStringUTF16( |
127 IDS_BEFOREUNLOAD_MESSAGEBOX_CANCEL_BUTTON_LABEL)); | 127 IDS_BEFOREUNLOAD_MESSAGEBOX_CANCEL_BUTTON_LABEL)); |
128 } | 128 } |
129 } | 129 } |
130 return DialogDelegate::GetDialogButtonLabel(button); | 130 return DialogDelegate::GetDialogButtonLabel(button); |
131 } | 131 } |
132 | 132 |
133 /////////////////////////////////////////////////////////////////////////////// | 133 /////////////////////////////////////////////////////////////////////////////// |
134 // JSModalDialogViews, views::WindowDelegate implementation: | 134 // JSModalDialogViews, views::WindowDelegate implementation: |
135 | 135 |
| 136 bool JSModalDialogViews::IsModal() const { |
| 137 return true; |
| 138 } |
| 139 |
136 views::View* JSModalDialogViews::GetContentsView() { | 140 views::View* JSModalDialogViews::GetContentsView() { |
137 return message_box_view_; | 141 return message_box_view_; |
138 } | 142 } |
139 | 143 |
140 views::View* JSModalDialogViews::GetInitiallyFocusedView() { | 144 views::View* JSModalDialogViews::GetInitiallyFocusedView() { |
141 if (message_box_view_->text_box()) | 145 if (message_box_view_->text_box()) |
142 return message_box_view_->text_box(); | 146 return message_box_view_->text_box(); |
143 return views::DialogDelegate::GetInitiallyFocusedView(); | 147 return views::DialogDelegate::GetInitiallyFocusedView(); |
144 } | 148 } |
145 | 149 |
146 //////////////////////////////////////////////////////////////////////////////// | 150 //////////////////////////////////////////////////////////////////////////////// |
147 // NativeAppModalDialog, public: | 151 // NativeAppModalDialog, public: |
148 | 152 |
149 // static | 153 // static |
150 NativeAppModalDialog* NativeAppModalDialog::CreateNativeJavaScriptPrompt( | 154 NativeAppModalDialog* NativeAppModalDialog::CreateNativeJavaScriptPrompt( |
151 JavaScriptAppModalDialog* dialog, | 155 JavaScriptAppModalDialog* dialog, |
152 gfx::NativeWindow parent_window) { | 156 gfx::NativeWindow parent_window) { |
153 JSModalDialogViews* d = new JSModalDialogViews(dialog); | 157 JSModalDialogViews* d = new JSModalDialogViews(dialog); |
154 | 158 |
155 browser::CreateViewsWindow(parent_window, gfx::Rect(), d); | 159 browser::CreateViewsWindow(parent_window, gfx::Rect(), d); |
156 return d; | 160 return d; |
157 } | 161 } |
OLD | NEW |