OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/panels/panel_browser_window_cocoa.h" | 5 #include "chrome/browser/ui/panels/panel_browser_window_cocoa.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/tabs/tab_strip_model.h" | 8 #include "chrome/browser/tabs/tab_strip_model.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/ui/browser_list.h" | 10 #include "chrome/browser/ui/browser_list.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 NSRect finalFrame = ConvertCoordinatesToCocoa(bounds_); | 95 NSRect finalFrame = ConvertCoordinatesToCocoa(bounds_); |
96 [controller_ revealAnimatedWithFrame:finalFrame]; | 96 [controller_ revealAnimatedWithFrame:finalFrame]; |
97 } | 97 } |
98 | 98 |
99 gfx::Rect PanelBrowserWindowCocoa::GetPanelBounds() const { | 99 gfx::Rect PanelBrowserWindowCocoa::GetPanelBounds() const { |
100 return bounds_; | 100 return bounds_; |
101 } | 101 } |
102 | 102 |
103 // |bounds| is the platform-independent screen coordinates, with (0,0) at | 103 // |bounds| is the platform-independent screen coordinates, with (0,0) at |
104 // top-left of the primary screen. | 104 // top-left of the primary screen. |
105 void PanelBrowserWindowCocoa::SetPanelBounds(const gfx::Rect& bounds) { | 105 void PanelBrowserWindowCocoa::SetPanelBounds(const gfx::Rect& bounds, |
| 106 bool animate) { |
106 if (bounds_ == bounds) | 107 if (bounds_ == bounds) |
107 return; | 108 return; |
108 | 109 |
109 bounds_ = bounds; | 110 bounds_ = bounds; |
110 | 111 |
111 NSRect frame = ConvertCoordinatesToCocoa(bounds); | 112 NSRect frame = ConvertCoordinatesToCocoa(bounds); |
112 [controller_ setPanelFrame:frame]; | 113 [controller_ setPanelFrame:frame animate:animate]; |
113 } | 114 } |
114 | 115 |
115 void PanelBrowserWindowCocoa::ClosePanel() { | 116 void PanelBrowserWindowCocoa::ClosePanel() { |
116 if (isClosed()) | 117 if (isClosed()) |
117 return; | 118 return; |
118 | 119 |
119 NSWindow* window = [controller_ window]; | 120 NSWindow* window = [controller_ window]; |
120 [window performClose:controller_]; | 121 [window performClose:controller_]; |
121 } | 122 } |
122 | 123 |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 return false; | 350 return false; |
350 } | 351 } |
351 | 352 |
352 bool NativePanelTestingCocoa::IsWindowSizeKnown() const { | 353 bool NativePanelTestingCocoa::IsWindowSizeKnown() const { |
353 return true; | 354 return true; |
354 } | 355 } |
355 | 356 |
356 bool NativePanelTestingCocoa::IsAnimatingBounds() const { | 357 bool NativePanelTestingCocoa::IsAnimatingBounds() const { |
357 return [native_panel_window_->controller_ isAnimatingBounds]; | 358 return [native_panel_window_->controller_ isAnimatingBounds]; |
358 } | 359 } |
OLD | NEW |