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 "components/app_modal/app_modal_dialog.h" | 5 #include "components/app_modal/app_modal_dialog.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "components/app_modal/app_modal_dialog_queue.h" | 9 #include "components/app_modal/app_modal_dialog_queue.h" |
10 #include "components/app_modal/native_app_modal_dialog.h" | 10 #include "components/app_modal/native_app_modal_dialog.h" |
11 #include "content/public/browser/web_contents.h" | 11 #include "content/public/browser/web_contents.h" |
12 #include "content/public/browser/web_contents_delegate.h" | 12 #include "content/public/browser/web_contents_delegate.h" |
13 | 13 |
14 using content::WebContents; | 14 using content::WebContents; |
15 | 15 |
| 16 namespace app_modal { |
16 namespace { | 17 namespace { |
17 | 18 |
18 AppModalDialogObserver* app_modal_dialog_observer = NULL; | 19 AppModalDialogObserver* app_modal_dialog_observer = NULL; |
19 | 20 |
20 } // namespace | 21 } // namespace |
21 | 22 |
22 AppModalDialogObserver::AppModalDialogObserver() { | 23 AppModalDialogObserver::AppModalDialogObserver() { |
23 DCHECK(!app_modal_dialog_observer); | 24 DCHECK(!app_modal_dialog_observer); |
24 app_modal_dialog_observer = this; | 25 app_modal_dialog_observer = this; |
25 } | 26 } |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 DCHECK(native_dialog_); | 76 DCHECK(native_dialog_); |
76 native_dialog_->CloseAppModalDialog(); | 77 native_dialog_->CloseAppModalDialog(); |
77 } | 78 } |
78 | 79 |
79 void AppModalDialog::CompleteDialog() { | 80 void AppModalDialog::CompleteDialog() { |
80 if (!completed_) { | 81 if (!completed_) { |
81 completed_ = true; | 82 completed_ = true; |
82 AppModalDialogQueue::GetInstance()->ShowNextDialog(); | 83 AppModalDialogQueue::GetInstance()->ShowNextDialog(); |
83 } | 84 } |
84 } | 85 } |
| 86 |
| 87 } // namespace app_modal |
OLD | NEW |