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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 if (parent_->dialog_flags() & ui::MessageBoxFlags::kFlagHasOKButton) | 73 if (parent_->dialog_flags() & ui::MessageBoxFlags::kFlagHasOKButton) |
74 return ui::DIALOG_BUTTON_OK; | 74 return ui::DIALOG_BUTTON_OK; |
75 | 75 |
76 if (parent_->dialog_flags() & ui::MessageBoxFlags::kFlagHasCancelButton) | 76 if (parent_->dialog_flags() & ui::MessageBoxFlags::kFlagHasCancelButton) |
77 return ui::DIALOG_BUTTON_CANCEL; | 77 return ui::DIALOG_BUTTON_CANCEL; |
78 | 78 |
79 return ui::DIALOG_BUTTON_NONE; | 79 return ui::DIALOG_BUTTON_NONE; |
80 } | 80 } |
81 | 81 |
82 int JSModalDialogViews::GetDialogButtons() const { | 82 int JSModalDialogViews::GetDialogButtons() const { |
83 int dialog_buttons = 0; | 83 int dialog_buttons = ui::DIALOG_BUTTON_NONE; |
84 if (parent_->dialog_flags() & ui::MessageBoxFlags::kFlagHasOKButton) | 84 if (parent_->dialog_flags() & ui::MessageBoxFlags::kFlagHasOKButton) |
85 dialog_buttons = ui::DIALOG_BUTTON_OK; | 85 dialog_buttons = ui::DIALOG_BUTTON_OK; |
86 | 86 |
87 if (parent_->dialog_flags() & ui::MessageBoxFlags::kFlagHasCancelButton) | 87 if (parent_->dialog_flags() & ui::MessageBoxFlags::kFlagHasCancelButton) |
88 dialog_buttons |= ui::DIALOG_BUTTON_CANCEL; | 88 dialog_buttons |= ui::DIALOG_BUTTON_CANCEL; |
89 | 89 |
90 return dialog_buttons; | 90 return dialog_buttons; |
91 } | 91 } |
92 | 92 |
93 string16 JSModalDialogViews::GetWindowTitle() const { | 93 string16 JSModalDialogViews::GetWindowTitle() const { |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 162 |
163 // static | 163 // static |
164 NativeAppModalDialog* NativeAppModalDialog::CreateNativeJavaScriptPrompt( | 164 NativeAppModalDialog* NativeAppModalDialog::CreateNativeJavaScriptPrompt( |
165 JavaScriptAppModalDialog* dialog, | 165 JavaScriptAppModalDialog* dialog, |
166 gfx::NativeWindow parent_window) { | 166 gfx::NativeWindow parent_window) { |
167 JSModalDialogViews* d = new JSModalDialogViews(dialog); | 167 JSModalDialogViews* d = new JSModalDialogViews(dialog); |
168 | 168 |
169 browser::CreateViewsWindow(parent_window, d); | 169 browser::CreateViewsWindow(parent_window, d); |
170 return d; | 170 return d; |
171 } | 171 } |
OLD | NEW |