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

Side by Side Diff: trunk/src/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.mm

Issue 21372006: Revert 212329 "Reland "Close web contents modal dialogs on conte..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 4 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
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 "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" 5 #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/ui/browser_finder.h" 8 #include "chrome/browser/ui/browser_finder.h"
9 #include "chrome/browser/ui/browser_window.h" 9 #include "chrome/browser/ui/browser_window.h"
10 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet.h" 10 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 pulseSheet:sheet_]; 71 pulseSheet:sheet_];
72 } 72 }
73 73
74 NativeWebContentsModalDialog ConstrainedWindowMac::GetNativeDialog() { 74 NativeWebContentsModalDialog ConstrainedWindowMac::GetNativeDialog() {
75 // TODO(wittman): Ultimately this should be changed to the 75 // TODO(wittman): Ultimately this should be changed to the
76 // ConstrainedWindowSheet pointer, in conjunction with the corresponding 76 // ConstrainedWindowSheet pointer, in conjunction with the corresponding
77 // changes to NativeWebContentsModalDialogManagerCocoa. 77 // changes to NativeWebContentsModalDialogManagerCocoa.
78 return this; 78 return this;
79 } 79 }
80 80
81 void ConstrainedWindowMac::SetPreventCloseOnLoadStart(bool prevent) {
82 WebContentsModalDialogManager* web_contents_modal_dialog_manager =
83 WebContentsModalDialogManager::FromWebContents(web_contents_);
84 web_contents_modal_dialog_manager->SetPreventCloseOnLoadStart(
85 GetNativeDialog(),
86 prevent);
87 }
88
89 NSWindow* ConstrainedWindowMac::GetParentWindow() const { 81 NSWindow* ConstrainedWindowMac::GetParentWindow() const {
90 // Tab contents in a tabbed browser may not be inside a window. For this 82 // Tab contents in a tabbed browser may not be inside a window. For this
91 // reason use a browser window if possible. 83 // reason use a browser window if possible.
92 Browser* browser = chrome::FindBrowserWithWebContents(web_contents_); 84 Browser* browser = chrome::FindBrowserWithWebContents(web_contents_);
93 if (browser) 85 if (browser)
94 return browser->window()->GetNativeWindow(); 86 return browser->window()->GetNativeWindow();
95 87
96 return web_contents_->GetView()->GetTopLevelNativeWindow(); 88 return web_contents_->GetView()->GetTopLevelNativeWindow();
97 } 89 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698