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

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

Issue 2589663002: Mac: Add CHECK() in ConstrainedWindowMac::GetDialogManager(). (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.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 "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 <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 delegate_->OnConstrainedWindowClosed(this); 74 delegate_->OnConstrainedWindowClosed(this);
75 } 75 }
76 76
77 bool ConstrainedWindowMac::DialogWasShown() { 77 bool ConstrainedWindowMac::DialogWasShown() {
78 // If the dialog was shown, |native_manager_| would have been released. 78 // If the dialog was shown, |native_manager_| would have been released.
79 return !native_manager_; 79 return !native_manager_;
80 } 80 }
81 81
82 WebContentsModalDialogManager* ConstrainedWindowMac::GetDialogManager() { 82 WebContentsModalDialogManager* ConstrainedWindowMac::GetDialogManager() {
83 DCHECK(web_contents_); 83 DCHECK(web_contents_);
84 return WebContentsModalDialogManager::FromWebContents(web_contents_); 84 WebContentsModalDialogManager* dialog_manager =
85 WebContentsModalDialogManager::FromWebContents(web_contents_);
86 // If WebContentsModalDialogManager::CreateForWebContents(web_contents_) was
87 // never called, then the manager will be null. E.g., for browser tabs,
88 // TabHelpers::AttachTabHelpers() calls CreateForWebContents(). It is invalid
89 // to show a dialog on some kinds of WebContents. Crash cleanly in that case.
90 CHECK(dialog_manager);
91 return dialog_manager;
85 } 92 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698