| 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 "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/guest_view/web_view/web_view_guest.h" | |
| 9 #include "chrome/browser/ui/browser_finder.h" | 8 #include "chrome/browser/ui/browser_finder.h" |
| 10 #include "chrome/browser/ui/browser_window.h" | 9 #include "chrome/browser/ui/browser_window.h" |
| 11 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet.h" | 10 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet.h" |
| 12 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_con
troller.h" | 11 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_con
troller.h" |
| 13 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" | 12 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" |
| 14 #include "components/web_modal/popup_manager.h" | 13 #include "components/web_modal/popup_manager.h" |
| 15 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 14 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 16 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
| 17 #include "content/public/browser/web_contents.h" | 16 #include "content/public/browser/web_contents.h" |
| 17 #include "extensions/browser/guest_view/web_view/web_view_guest.h" |
| 18 | 18 |
| 19 using web_modal::WebContentsModalDialogManager; | 19 using web_modal::WebContentsModalDialogManager; |
| 20 using web_modal::NativeWebContentsModalDialog; | 20 using web_modal::NativeWebContentsModalDialog; |
| 21 | 21 |
| 22 ConstrainedWindowMac::ConstrainedWindowMac( | 22 ConstrainedWindowMac::ConstrainedWindowMac( |
| 23 ConstrainedWindowMacDelegate* delegate, | 23 ConstrainedWindowMacDelegate* delegate, |
| 24 content::WebContents* web_contents, | 24 content::WebContents* web_contents, |
| 25 id<ConstrainedWindowSheet> sheet) | 25 id<ConstrainedWindowSheet> sheet) |
| 26 : delegate_(delegate), | 26 : delegate_(delegate), |
| 27 web_contents_(NULL), | 27 web_contents_(NULL), |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 NSWindow* ConstrainedWindowMac::GetParentWindow() const { | 94 NSWindow* ConstrainedWindowMac::GetParentWindow() const { |
| 95 // Tab contents in a tabbed browser may not be inside a window. For this | 95 // Tab contents in a tabbed browser may not be inside a window. For this |
| 96 // reason use a browser window if possible. | 96 // reason use a browser window if possible. |
| 97 Browser* browser = chrome::FindBrowserWithWebContents(web_contents_); | 97 Browser* browser = chrome::FindBrowserWithWebContents(web_contents_); |
| 98 if (browser) | 98 if (browser) |
| 99 return browser->window()->GetNativeWindow(); | 99 return browser->window()->GetNativeWindow(); |
| 100 | 100 |
| 101 return web_contents_->GetTopLevelNativeWindow(); | 101 return web_contents_->GetTopLevelNativeWindow(); |
| 102 } | 102 } |
| OLD | NEW |