OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/web_modal/web_contents_modal_dialog_manager.h" | 5 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
6 | 6 |
7 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" | 7 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" |
8 #include "content/public/browser/navigation_details.h" | 8 #include "content/public/browser/navigation_details.h" |
9 #include "content/public/browser/navigation_entry.h" | 9 #include "content/public/browser/navigation_entry.h" |
10 #include "content/public/browser/render_view_host.h" | 10 #include "content/public/browser/render_view_host.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 BlockWebContentsInteraction(true); | 51 BlockWebContentsInteraction(true); |
52 if (delegate_ && delegate_->IsWebContentsVisible(web_contents())) | 52 if (delegate_ && delegate_->IsWebContentsVisible(web_contents())) |
53 child_dialogs_.back()->manager->Show(); | 53 child_dialogs_.back()->manager->Show(); |
54 } | 54 } |
55 } | 55 } |
56 | 56 |
57 bool WebContentsModalDialogManager::IsDialogActive() const { | 57 bool WebContentsModalDialogManager::IsDialogActive() const { |
58 return !child_dialogs_.empty(); | 58 return !child_dialogs_.empty(); |
59 } | 59 } |
60 | 60 |
61 void WebContentsModalDialogManager::FocusTopmostDialog() { | 61 void WebContentsModalDialogManager::FocusTopmostDialog() const { |
62 DCHECK(!child_dialogs_.empty()); | 62 DCHECK(!child_dialogs_.empty()); |
63 child_dialogs_.front()->manager->Focus(); | 63 child_dialogs_.front()->manager->Focus(); |
64 } | 64 } |
65 | 65 |
66 content::WebContents* WebContentsModalDialogManager::GetWebContents() const { | 66 content::WebContents* WebContentsModalDialogManager::GetWebContents() const { |
67 return web_contents(); | 67 return web_contents(); |
68 } | 68 } |
69 | 69 |
70 void WebContentsModalDialogManager::WillClose( | 70 void WebContentsModalDialogManager::WillClose( |
71 NativeWebContentsModalDialog dialog) { | 71 NativeWebContentsModalDialog dialog) { |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 } | 180 } |
181 | 181 |
182 void WebContentsModalDialogManager::DidAttachInterstitialPage() { | 182 void WebContentsModalDialogManager::DidAttachInterstitialPage() { |
183 // TODO(wittman): Test closing on interstitial webui works properly on Mac. | 183 // TODO(wittman): Test closing on interstitial webui works properly on Mac. |
184 #if defined(USE_AURA) | 184 #if defined(USE_AURA) |
185 CloseAllDialogs(); | 185 CloseAllDialogs(); |
186 #endif | 186 #endif |
187 } | 187 } |
188 | 188 |
189 } // namespace web_modal | 189 } // namespace web_modal |
OLD | NEW |