| 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 "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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // NativeWidgetMac, internal::NativeWidgetPrivate implementation: | 84 // NativeWidgetMac, internal::NativeWidgetPrivate implementation: |
| 85 | 85 |
| 86 void NativeWidgetMac::InitNativeWidget(const Widget::InitParams& params) { | 86 void NativeWidgetMac::InitNativeWidget(const Widget::InitParams& params) { |
| 87 ownership_ = params.ownership; | 87 ownership_ = params.ownership; |
| 88 base::scoped_nsobject<NSWindow> window([CreateNSWindow(params) retain]); | 88 base::scoped_nsobject<NSWindow> window([CreateNSWindow(params) retain]); |
| 89 [window setReleasedWhenClosed:NO]; // Owned by scoped_nsobject. | 89 [window setReleasedWhenClosed:NO]; // Owned by scoped_nsobject. |
| 90 bridge_->Init(window, params); | 90 bridge_->Init(window, params); |
| 91 | 91 |
| 92 delegate_->OnNativeWidgetCreated(true); | 92 delegate_->OnNativeWidgetCreated(true); |
| 93 | 93 |
| 94 OnSizeConstraintsChanged(); | |
| 95 | |
| 96 bridge_->SetFocusManager(GetWidget()->GetFocusManager()); | 94 bridge_->SetFocusManager(GetWidget()->GetFocusManager()); |
| 97 | 95 |
| 98 DCHECK(GetWidget()->GetRootView()); | 96 DCHECK(GetWidget()->GetRootView()); |
| 99 bridge_->SetRootView(GetWidget()->GetRootView()); | 97 bridge_->SetRootView(GetWidget()->GetRootView()); |
| 100 | 98 |
| 101 // "Infer" must be handled by ViewsDelegate::OnBeforeWidgetInit(). | 99 // "Infer" must be handled by ViewsDelegate::OnBeforeWidgetInit(). |
| 102 DCHECK_NE(Widget::InitParams::INFER_OPACITY, params.opacity); | 100 DCHECK_NE(Widget::InitParams::INFER_OPACITY, params.opacity); |
| 103 bool translucent = params.opacity == Widget::InitParams::TRANSLUCENT_WINDOW; | 101 bool translucent = params.opacity == Widget::InitParams::TRANSLUCENT_WINDOW; |
| 104 switch (params.layer_type) { | 102 switch (params.layer_type) { |
| 105 case aura::WINDOW_LAYER_NONE: | 103 case aura::WINDOW_LAYER_NONE: |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 | 519 |
| 522 void NativeWidgetMac::OnRootViewLayout() { | 520 void NativeWidgetMac::OnRootViewLayout() { |
| 523 NOTIMPLEMENTED(); | 521 NOTIMPLEMENTED(); |
| 524 } | 522 } |
| 525 | 523 |
| 526 bool NativeWidgetMac::IsTranslucentWindowOpacitySupported() const { | 524 bool NativeWidgetMac::IsTranslucentWindowOpacitySupported() const { |
| 527 return false; | 525 return false; |
| 528 } | 526 } |
| 529 | 527 |
| 530 void NativeWidgetMac::OnSizeConstraintsChanged() { | 528 void NativeWidgetMac::OnSizeConstraintsChanged() { |
| 531 bridge_->OnSizeConstraintsChanged(); | 529 NOTIMPLEMENTED(); |
| 532 } | 530 } |
| 533 | 531 |
| 534 void NativeWidgetMac::RepostNativeEvent(gfx::NativeEvent native_event) { | 532 void NativeWidgetMac::RepostNativeEvent(gfx::NativeEvent native_event) { |
| 535 NOTIMPLEMENTED(); | 533 NOTIMPLEMENTED(); |
| 536 } | 534 } |
| 537 | 535 |
| 538 //////////////////////////////////////////////////////////////////////////////// | 536 //////////////////////////////////////////////////////////////////////////////// |
| 539 // NativeWidgetMac, protected: | 537 // NativeWidgetMac, protected: |
| 540 | 538 |
| 541 NSWindow* NativeWidgetMac::CreateNSWindow(const Widget::InitParams& params) { | 539 NSWindow* NativeWidgetMac::CreateNSWindow(const Widget::InitParams& params) { |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 } | 640 } |
| 643 | 641 |
| 644 // static | 642 // static |
| 645 gfx::FontList NativeWidgetPrivate::GetWindowTitleFontList() { | 643 gfx::FontList NativeWidgetPrivate::GetWindowTitleFontList() { |
| 646 NOTIMPLEMENTED(); | 644 NOTIMPLEMENTED(); |
| 647 return gfx::FontList(); | 645 return gfx::FontList(); |
| 648 } | 646 } |
| 649 | 647 |
| 650 } // namespace internal | 648 } // namespace internal |
| 651 } // namespace views | 649 } // namespace views |
| OLD | NEW |