OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/app_modal_dialog.h" | 5 #include "chrome/browser/app_modal_dialog.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 100 |
101 void AppModalDialog::ActivateModalDialog() { | 101 void AppModalDialog::ActivateModalDialog() { |
102 NOTIMPLEMENTED(); | 102 NOTIMPLEMENTED(); |
103 } | 103 } |
104 | 104 |
105 void AppModalDialog::CloseModalDialog() { | 105 void AppModalDialog::CloseModalDialog() { |
106 NOTIMPLEMENTED(); | 106 NOTIMPLEMENTED(); |
107 } | 107 } |
108 | 108 |
109 int AppModalDialog::GetDialogButtons() { | 109 int AppModalDialog::GetDialogButtons() { |
110 NOTIMPLEMENTED(); | 110 switch (dialog_flags_) { |
111 return 0; | 111 case MessageBoxFlags::kIsJavascriptAlert: |
| 112 return MessageBoxFlags::DIALOGBUTTON_OK; |
| 113 |
| 114 case MessageBoxFlags::kIsJavascriptConfirm: |
| 115 return MessageBoxFlags::DIALOGBUTTON_OK | |
| 116 MessageBoxFlags::DIALOGBUTTON_CANCEL; |
| 117 |
| 118 case MessageBoxFlags::kIsJavascriptPrompt: |
| 119 return MessageBoxFlags::DIALOGBUTTON_OK; |
| 120 |
| 121 default: |
| 122 NOTREACHED(); |
| 123 return 0; |
| 124 } |
112 } | 125 } |
113 | 126 |
114 void AppModalDialog::AcceptWindow() { | 127 void AppModalDialog::AcceptWindow() { |
115 NOTIMPLEMENTED(); | 128 OnDialogResponse(GTK_DIALOG(dialog_), GTK_RESPONSE_OK, this); |
116 } | 129 } |
117 | 130 |
118 void AppModalDialog::CancelWindow() { | 131 void AppModalDialog::CancelWindow() { |
119 NOTIMPLEMENTED(); | 132 OnDialogResponse(GTK_DIALOG(dialog_), GTK_RESPONSE_CANCEL, this); |
120 } | 133 } |
OLD | NEW |