Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/views/widget/native_widget_mac.h" | 5 #include "ui/views/widget/native_widget_mac.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 299 gfx::Rect NativeWidgetMac::GetClientAreaBoundsInScreen() const { | 299 gfx::Rect NativeWidgetMac::GetClientAreaBoundsInScreen() const { |
| 300 NSWindow* window = GetNativeWindow(); | 300 NSWindow* window = GetNativeWindow(); |
| 301 return gfx::ScreenRectFromNSRect( | 301 return gfx::ScreenRectFromNSRect( |
| 302 [window contentRectForFrameRect:[window frame]]); | 302 [window contentRectForFrameRect:[window frame]]); |
| 303 } | 303 } |
| 304 | 304 |
| 305 gfx::Rect NativeWidgetMac::GetRestoredBounds() const { | 305 gfx::Rect NativeWidgetMac::GetRestoredBounds() const { |
| 306 return bridge_ ? bridge_->GetRestoredBounds() : gfx::Rect(); | 306 return bridge_ ? bridge_->GetRestoredBounds() : gfx::Rect(); |
| 307 } | 307 } |
| 308 | 308 |
| 309 std::string NativeWidgetMac::GetWorkspace() const { | |
| 310 return ""; | |
|
sky
2016/05/03 17:40:53
std::string()
Tom (Use chromium acct)
2016/05/03 19:38:39
Done.
| |
| 311 } | |
| 312 | |
| 309 void NativeWidgetMac::SetBounds(const gfx::Rect& bounds) { | 313 void NativeWidgetMac::SetBounds(const gfx::Rect& bounds) { |
| 310 if (bridge_) | 314 if (bridge_) |
| 311 bridge_->SetBounds(bounds); | 315 bridge_->SetBounds(bounds); |
| 312 } | 316 } |
| 313 | 317 |
| 314 void NativeWidgetMac::SetSize(const gfx::Size& size) { | 318 void NativeWidgetMac::SetSize(const gfx::Size& size) { |
| 315 // Ensure the top-left corner stays in-place (rather than the bottom-left, | 319 // Ensure the top-left corner stays in-place (rather than the bottom-left, |
| 316 // which -[NSWindow setContentSize:] would do). | 320 // which -[NSWindow setContentSize:] would do). |
| 317 SetBounds(gfx::Rect(GetWindowBoundsInScreen().origin(), size)); | 321 SetBounds(gfx::Rect(GetWindowBoundsInScreen().origin(), size)); |
| 318 } | 322 } |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 736 [[ViewsNSWindowCloseAnimator alloc] initWithWindow:window]; | 740 [[ViewsNSWindowCloseAnimator alloc] initWithWindow:window]; |
| 737 } | 741 } |
| 738 | 742 |
| 739 - (void)animationDidEnd:(NSAnimation*)animation { | 743 - (void)animationDidEnd:(NSAnimation*)animation { |
| 740 [window_ close]; | 744 [window_ close]; |
| 741 [animation_ setDelegate:nil]; | 745 [animation_ setDelegate:nil]; |
| 742 [self release]; | 746 [self release]; |
| 743 } | 747 } |
| 744 | 748 |
| 745 @end | 749 @end |
| OLD | NEW |