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

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

Issue 231173004: [WebModal] Rename NativeWebContentsModalDialogManager to SingleWebContentsDialogManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: constrained window test Created 6 years, 8 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 12 matching lines...) Expand all
23 content::WebContents* web_contents, 23 content::WebContents* web_contents,
24 id<ConstrainedWindowSheet> sheet) 24 id<ConstrainedWindowSheet> sheet)
25 : delegate_(delegate), 25 : delegate_(delegate),
26 web_contents_(web_contents), 26 web_contents_(web_contents),
27 sheet_([sheet retain]), 27 sheet_([sheet retain]),
28 shown_(false) { 28 shown_(false) {
29 DCHECK(web_contents); 29 DCHECK(web_contents);
30 DCHECK(sheet_.get()); 30 DCHECK(sheet_.get());
31 WebContentsModalDialogManager* web_contents_modal_dialog_manager = 31 WebContentsModalDialogManager* web_contents_modal_dialog_manager =
32 WebContentsModalDialogManager::FromWebContents(web_contents); 32 WebContentsModalDialogManager::FromWebContents(web_contents);
33 web_contents_modal_dialog_manager->ShowDialog(this); 33 web_contents_modal_dialog_manager->ShowModalDialog(this);
34 } 34 }
35 35
36 ConstrainedWindowMac::~ConstrainedWindowMac() { 36 ConstrainedWindowMac::~ConstrainedWindowMac() {
37 CHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 37 CHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
38 } 38 }
39 39
40 void ConstrainedWindowMac::ShowWebContentsModalDialog() { 40 void ConstrainedWindowMac::ShowWebContentsModalDialog() {
41 if (shown_) 41 if (shown_)
42 return; 42 return;
43 43
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 NSWindow* ConstrainedWindowMac::GetParentWindow() const { 85 NSWindow* ConstrainedWindowMac::GetParentWindow() const {
86 // Tab contents in a tabbed browser may not be inside a window. For this 86 // Tab contents in a tabbed browser may not be inside a window. For this
87 // reason use a browser window if possible. 87 // reason use a browser window if possible.
88 Browser* browser = chrome::FindBrowserWithWebContents(web_contents_); 88 Browser* browser = chrome::FindBrowserWithWebContents(web_contents_);
89 if (browser) 89 if (browser)
90 return browser->window()->GetNativeWindow(); 90 return browser->window()->GetNativeWindow();
91 91
92 return web_contents_->GetView()->GetTopLevelNativeWindow(); 92 return web_contents_->GetView()->GetTopLevelNativeWindow();
93 } 93 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698