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

Side by Side Diff: ui/views/widget/native_widget_mac.mm

Issue 693523003: MacViews: Put wm window animation calls behind an interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@views-clipboard
Patch Set: Created 6 years, 1 month 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
OLDNEW
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 "base/mac/foundation_util.h" 9 #include "base/mac/foundation_util.h"
10 #include "base/mac/scoped_nsobject.h" 10 #include "base/mac/scoped_nsobject.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 return content_rect; 76 return content_rect;
77 } 77 }
78 78
79 gfx::Size WindowSizeForClientAreaSize(NSWindow* window, const gfx::Size& size) { 79 gfx::Size WindowSizeForClientAreaSize(NSWindow* window, const gfx::Size& size) {
80 NSRect content_rect = NSMakeRect(0, 0, size.width(), size.height()); 80 NSRect content_rect = NSMakeRect(0, 0, size.width(), size.height());
81 NSRect frame_rect = [window frameRectForContentRect:content_rect]; 81 NSRect frame_rect = [window frameRectForContentRect:content_rect];
82 return gfx::Size(NSWidth(frame_rect), NSHeight(frame_rect)); 82 return gfx::Size(NSWidth(frame_rect), NSHeight(frame_rect));
83 } 83 }
84 84
85 class VisibilityAnimationMac : public Widget::VisibilityAnimation {
86 public:
87 VisibilityAnimationMac() {}
88 virtual ~VisibilityAnimationMac() {}
89
90 void SetDuration(const base::TimeDelta& duration) override {
91 NOTIMPLEMENTED();
92 }
93 void SetTransition(Transition transition) override{
94 NOTIMPLEMENTED();
95 }
96
97 private:
98 DISALLOW_COPY_AND_ASSIGN(VisibilityAnimationMac);
99 };
100
85 } // namespace 101 } // namespace
86 102
87 //////////////////////////////////////////////////////////////////////////////// 103 ////////////////////////////////////////////////////////////////////////////////
88 // NativeWidgetMac, public: 104 // NativeWidgetMac, public:
89 105
90 NativeWidgetMac::NativeWidgetMac(internal::NativeWidgetDelegate* delegate) 106 NativeWidgetMac::NativeWidgetMac(internal::NativeWidgetDelegate* delegate)
91 : delegate_(delegate), 107 : delegate_(delegate),
92 bridge_(new BridgedNativeWidget(this)), 108 bridge_(new BridgedNativeWidget(this)),
109 visibility_animation_(new VisibilityAnimationMac),
93 ownership_(Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET) { 110 ownership_(Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET) {
94 } 111 }
95 112
96 NativeWidgetMac::~NativeWidgetMac() { 113 NativeWidgetMac::~NativeWidgetMac() {
97 if (ownership_ == Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET) 114 if (ownership_ == Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET)
98 delete delegate_; 115 delete delegate_;
99 else 116 else
100 CloseNow(); 117 CloseNow();
101 } 118 }
102 119
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 } 522 }
506 523
507 void NativeWidgetMac::EndMoveLoop() { 524 void NativeWidgetMac::EndMoveLoop() {
508 NOTIMPLEMENTED(); 525 NOTIMPLEMENTED();
509 } 526 }
510 527
511 void NativeWidgetMac::SetVisibilityChangedAnimationsEnabled(bool value) { 528 void NativeWidgetMac::SetVisibilityChangedAnimationsEnabled(bool value) {
512 NOTIMPLEMENTED(); 529 NOTIMPLEMENTED();
513 } 530 }
514 531
532 Widget::VisibilityAnimation* NativeWidgetMac::GetVisibilityAnimation() const {
533 return visibility_animation_.get();
534 }
535
515 ui::NativeTheme* NativeWidgetMac::GetNativeTheme() const { 536 ui::NativeTheme* NativeWidgetMac::GetNativeTheme() const {
516 return ui::NativeTheme::instance(); 537 return ui::NativeTheme::instance();
517 } 538 }
518 539
519 void NativeWidgetMac::OnRootViewLayout() { 540 void NativeWidgetMac::OnRootViewLayout() {
520 NOTIMPLEMENTED(); 541 NOTIMPLEMENTED();
521 } 542 }
522 543
523 bool NativeWidgetMac::IsTranslucentWindowOpacitySupported() const { 544 bool NativeWidgetMac::IsTranslucentWindowOpacitySupported() const {
524 return false; 545 return false;
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 } 641 }
621 642
622 // static 643 // static
623 gfx::FontList NativeWidgetPrivate::GetWindowTitleFontList() { 644 gfx::FontList NativeWidgetPrivate::GetWindowTitleFontList() {
624 NOTIMPLEMENTED(); 645 NOTIMPLEMENTED();
625 return gfx::FontList(); 646 return gfx::FontList();
626 } 647 }
627 648
628 } // namespace internal 649 } // namespace internal
629 } // namespace views 650 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698