OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/app_modal_dialogs/app_modal_dialog.h" | 5 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" |
6 | 6 |
7 #include "chrome/browser/tab_contents/tab_contents.h" | 7 #include "chrome/browser/tab_contents/tab_contents.h" |
8 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" | 8 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" |
9 #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h" | 9 #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h" |
10 #include "chrome/common/notification_service.h" | 10 #include "chrome/common/notification_service.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 NotificationType::APP_MODAL_DIALOG_SHOWN, | 31 NotificationType::APP_MODAL_DIALOG_SHOWN, |
32 Source<AppModalDialog>(this), | 32 Source<AppModalDialog>(this), |
33 NotificationService::NoDetails()); | 33 NotificationService::NoDetails()); |
34 } | 34 } |
35 | 35 |
36 void AppModalDialog::CreateAndShowDialog() { | 36 void AppModalDialog::CreateAndShowDialog() { |
37 native_dialog_ = CreateNativeDialog(); | 37 native_dialog_ = CreateNativeDialog(); |
38 native_dialog_->ShowAppModalDialog(); | 38 native_dialog_->ShowAppModalDialog(); |
39 } | 39 } |
40 | 40 |
| 41 bool AppModalDialog::IsValid() { |
| 42 return !skip_this_dialog_; |
| 43 } |
| 44 |
41 void AppModalDialog::ActivateModalDialog() { | 45 void AppModalDialog::ActivateModalDialog() { |
42 DCHECK(native_dialog_); | 46 DCHECK(native_dialog_); |
43 native_dialog_->ActivateAppModalDialog(); | 47 native_dialog_->ActivateAppModalDialog(); |
44 } | 48 } |
45 | 49 |
46 void AppModalDialog::CloseModalDialog() { | 50 void AppModalDialog::CloseModalDialog() { |
47 DCHECK(native_dialog_); | 51 DCHECK(native_dialog_); |
48 native_dialog_->CloseAppModalDialog(); | 52 native_dialog_->CloseAppModalDialog(); |
49 } | 53 } |
50 | 54 |
51 void AppModalDialog::CompleteDialog() { | 55 void AppModalDialog::CompleteDialog() { |
52 AppModalDialogQueue::GetInstance()->ShowNextDialog(); | 56 AppModalDialogQueue::GetInstance()->ShowNextDialog(); |
53 } | 57 } |
OLD | NEW |