OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_aura.h" | 5 #include "ui/views/widget/native_widget_aura.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "third_party/skia/include/core/SkRegion.h" | 9 #include "third_party/skia/include/core/SkRegion.h" |
10 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "ui/views/ime/input_method_bridge.h" | 29 #include "ui/views/ime/input_method_bridge.h" |
30 #include "ui/views/ime/null_input_method.h" | 30 #include "ui/views/ime/null_input_method.h" |
31 #include "ui/views/views_delegate.h" | 31 #include "ui/views/views_delegate.h" |
32 #include "ui/views/widget/drop_helper.h" | 32 #include "ui/views/widget/drop_helper.h" |
33 #include "ui/views/widget/native_widget_delegate.h" | 33 #include "ui/views/widget/native_widget_delegate.h" |
34 #include "ui/views/widget/root_view.h" | 34 #include "ui/views/widget/root_view.h" |
35 #include "ui/views/widget/tooltip_manager_aura.h" | 35 #include "ui/views/widget/tooltip_manager_aura.h" |
36 #include "ui/views/widget/widget_aura_utils.h" | 36 #include "ui/views/widget/widget_aura_utils.h" |
37 #include "ui/views/widget/widget_delegate.h" | 37 #include "ui/views/widget/widget_delegate.h" |
38 #include "ui/views/widget/window_reorderer.h" | 38 #include "ui/views/widget/window_reorderer.h" |
| 39 #include "ui/wm/core/shadow_types.h" |
39 #include "ui/wm/core/window_util.h" | 40 #include "ui/wm/core/window_util.h" |
40 #include "ui/wm/public/activation_client.h" | 41 #include "ui/wm/public/activation_client.h" |
41 #include "ui/wm/public/drag_drop_client.h" | 42 #include "ui/wm/public/drag_drop_client.h" |
42 #include "ui/wm/public/window_move_client.h" | 43 #include "ui/wm/public/window_move_client.h" |
43 #include "ui/wm/public/window_types.h" | 44 #include "ui/wm/public/window_types.h" |
44 | 45 |
45 #if defined(OS_WIN) | 46 #if defined(OS_WIN) |
46 #include "base/win/scoped_gdi_object.h" | 47 #include "base/win/scoped_gdi_object.h" |
47 #include "base/win/win_util.h" | 48 #include "base/win/win_util.h" |
48 #include "ui/base/l10n/l10n_util_win.h" | 49 #include "ui/base/l10n/l10n_util_win.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 ownership_ = params.ownership; | 102 ownership_ = params.ownership; |
102 | 103 |
103 RegisterNativeWidgetForWindow(this, window_); | 104 RegisterNativeWidgetForWindow(this, window_); |
104 window_->SetType(GetAuraWindowTypeForWidgetType(params.type)); | 105 window_->SetType(GetAuraWindowTypeForWidgetType(params.type)); |
105 window_->SetProperty(aura::client::kShowStateKey, params.show_state); | 106 window_->SetProperty(aura::client::kShowStateKey, params.show_state); |
106 if (params.type == Widget::InitParams::TYPE_BUBBLE) | 107 if (params.type == Widget::InitParams::TYPE_BUBBLE) |
107 aura::client::SetHideOnDeactivate(window_, true); | 108 aura::client::SetHideOnDeactivate(window_, true); |
108 window_->SetTransparent( | 109 window_->SetTransparent( |
109 params.opacity == Widget::InitParams::TRANSLUCENT_WINDOW); | 110 params.opacity == Widget::InitParams::TRANSLUCENT_WINDOW); |
110 window_->Init(params.layer_type); | 111 window_->Init(params.layer_type); |
| 112 if (params.shadow_type == Widget::InitParams::SHADOW_TYPE_NONE) |
| 113 SetShadowType(window_, wm::SHADOW_TYPE_NONE); |
| 114 else if (params.shadow_type == Widget::InitParams::SHADOW_TYPE_DROP) |
| 115 SetShadowType(window_, wm::SHADOW_TYPE_RECTANGULAR); |
111 if (params.type == Widget::InitParams::TYPE_CONTROL) | 116 if (params.type == Widget::InitParams::TYPE_CONTROL) |
112 window_->Show(); | 117 window_->Show(); |
113 | 118 |
114 delegate_->OnNativeWidgetCreated(false); | 119 delegate_->OnNativeWidgetCreated(false); |
115 | 120 |
116 gfx::Rect window_bounds = params.bounds; | 121 gfx::Rect window_bounds = params.bounds; |
117 gfx::NativeView parent = params.parent; | 122 gfx::NativeView parent = params.parent; |
118 gfx::NativeView context = params.context; | 123 gfx::NativeView context = params.context; |
119 if (!params.child) { | 124 if (!params.child) { |
120 // Set up the transient child before the window is added. This way the | 125 // Set up the transient child before the window is added. This way the |
(...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1153 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); | 1158 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); |
1154 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); | 1159 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); |
1155 return gfx::FontList(gfx::Font(caption_font)); | 1160 return gfx::FontList(gfx::Font(caption_font)); |
1156 #else | 1161 #else |
1157 return gfx::FontList(); | 1162 return gfx::FontList(); |
1158 #endif | 1163 #endif |
1159 } | 1164 } |
1160 | 1165 |
1161 } // namespace internal | 1166 } // namespace internal |
1162 } // namespace views | 1167 } // namespace views |
OLD | NEW |