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_mac2.h" | 5 #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac2.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 #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_co
ntroller.h" | 10 #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_co
ntroller.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 void ConstrainedWindowMac2::PulseConstrainedWindow() { | 57 void ConstrainedWindowMac2::PulseConstrainedWindow() { |
58 [[ConstrainedWindowSheetController controllerForSheet:window_] | 58 [[ConstrainedWindowSheetController controllerForSheet:window_] |
59 pulseSheet:window_]; | 59 pulseSheet:window_]; |
60 } | 60 } |
61 | 61 |
62 gfx::NativeWindow ConstrainedWindowMac2::GetNativeWindow() { | 62 gfx::NativeWindow ConstrainedWindowMac2::GetNativeWindow() { |
63 return window_; | 63 return window_; |
64 } | 64 } |
65 | 65 |
66 bool ConstrainedWindowMac2::CanShowConstrainedWindow() { | 66 bool ConstrainedWindowMac2::CanShowConstrainedWindow() { |
67 Browser* browser = browser::FindBrowserWithWebContents(web_contents_); | 67 Browser* browser = chrome::FindBrowserWithWebContents(web_contents_); |
68 if (!browser) | 68 if (!browser) |
69 return true; | 69 return true; |
70 return !browser->window()->IsInstantTabShowing(); | 70 return !browser->window()->IsInstantTabShowing(); |
71 } | 71 } |
72 | 72 |
73 NSWindow* ConstrainedWindowMac2::GetParentWindow() const { | 73 NSWindow* ConstrainedWindowMac2::GetParentWindow() const { |
74 // Tab contents in a tabbed browser may not be inside a window. For this | 74 // Tab contents in a tabbed browser may not be inside a window. For this |
75 // reason use a browser window if possible. | 75 // reason use a browser window if possible. |
76 Browser* browser = browser::FindBrowserWithWebContents(web_contents_); | 76 Browser* browser = chrome::FindBrowserWithWebContents(web_contents_); |
77 if (browser) | 77 if (browser) |
78 return browser->window()->GetNativeWindow(); | 78 return browser->window()->GetNativeWindow(); |
79 | 79 |
80 return web_contents_->GetView()->GetTopLevelNativeWindow(); | 80 return web_contents_->GetView()->GetTopLevelNativeWindow(); |
81 } | 81 } |
OLD | NEW |