| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 OnSizeConstraintsChanged(); | 94 OnSizeConstraintsChanged(); |
| 95 | 95 |
| 96 bridge_->SetFocusManager(GetWidget()->GetFocusManager()); | 96 bridge_->SetFocusManager(GetWidget()->GetFocusManager()); |
| 97 | 97 |
| 98 DCHECK(GetWidget()->GetRootView()); | 98 DCHECK(GetWidget()->GetRootView()); |
| 99 bridge_->SetRootView(GetWidget()->GetRootView()); | 99 bridge_->SetRootView(GetWidget()->GetRootView()); |
| 100 | 100 |
| 101 // "Infer" must be handled by ViewsDelegate::OnBeforeWidgetInit(). | 101 // "Infer" must be handled by ViewsDelegate::OnBeforeWidgetInit(). |
| 102 DCHECK_NE(Widget::InitParams::INFER_OPACITY, params.opacity); | 102 DCHECK_NE(Widget::InitParams::INFER_OPACITY, params.opacity); |
| 103 bool translucent = params.opacity == Widget::InitParams::TRANSLUCENT_WINDOW; | 103 bool translucent = params.opacity == Widget::InitParams::TRANSLUCENT_WINDOW; |
| 104 switch (params.layer_type) { | 104 bridge_->CreateLayer(params.layer_type, translucent); |
| 105 case aura::WINDOW_LAYER_NONE: | |
| 106 break; | |
| 107 case aura::WINDOW_LAYER_TEXTURED: | |
| 108 bridge_->CreateLayer(ui::LAYER_TEXTURED, translucent); | |
| 109 break; | |
| 110 case aura::WINDOW_LAYER_NOT_DRAWN: | |
| 111 bridge_->CreateLayer(ui::LAYER_NOT_DRAWN, translucent); | |
| 112 break; | |
| 113 case aura::WINDOW_LAYER_SOLID_COLOR: | |
| 114 bridge_->CreateLayer(ui::LAYER_SOLID_COLOR, translucent); | |
| 115 break; | |
| 116 } | |
| 117 } | 105 } |
| 118 | 106 |
| 119 NonClientFrameView* NativeWidgetMac::CreateNonClientFrameView() { | 107 NonClientFrameView* NativeWidgetMac::CreateNonClientFrameView() { |
| 120 return new NativeFrameView(GetWidget()); | 108 return new NativeFrameView(GetWidget()); |
| 121 } | 109 } |
| 122 | 110 |
| 123 bool NativeWidgetMac::ShouldUseNativeFrame() const { | 111 bool NativeWidgetMac::ShouldUseNativeFrame() const { |
| 124 return true; | 112 return true; |
| 125 } | 113 } |
| 126 | 114 |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 } | 630 } |
| 643 | 631 |
| 644 // static | 632 // static |
| 645 gfx::FontList NativeWidgetPrivate::GetWindowTitleFontList() { | 633 gfx::FontList NativeWidgetPrivate::GetWindowTitleFontList() { |
| 646 NOTIMPLEMENTED(); | 634 NOTIMPLEMENTED(); |
| 647 return gfx::FontList(); | 635 return gfx::FontList(); |
| 648 } | 636 } |
| 649 | 637 |
| 650 } // namespace internal | 638 } // namespace internal |
| 651 } // namespace views | 639 } // namespace views |
| OLD | NEW |