Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Side by Side Diff: components/web_modal/web_contents_modal_dialog_manager.cc

Issue 287123002: [WebModals] New API for browser-scoped popup management. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « components/web_modal/web_contents_modal_dialog_manager.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « components/web_modal/web_contents_modal_dialog_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698