OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/widget/native_widget_aura.h" | 5 #include "views/widget/native_widget_aura.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "ui/aura/desktop.h" | 8 #include "ui/aura/desktop.h" |
9 #include "ui/aura/event.h" | 9 #include "ui/aura/event.h" |
10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
11 #include "ui/aura/window_types.h" | 11 #include "ui/aura/window_types.h" |
12 #include "ui/base/view_prop.h" | 12 #include "ui/base/view_prop.h" |
13 #include "ui/base/ui_base_types.h" | 13 #include "ui/base/ui_base_types.h" |
14 #include "ui/gfx/canvas.h" | 14 #include "ui/gfx/canvas.h" |
15 #include "ui/gfx/compositor/layer.h" | 15 #include "ui/gfx/compositor/layer.h" |
16 #include "ui/gfx/font.h" | 16 #include "ui/gfx/font.h" |
17 #include "ui/gfx/screen.h" | 17 #include "ui/gfx/screen.h" |
18 #include "views/widget/native_widget_delegate.h" | 18 #include "views/widget/native_widget_delegate.h" |
| 19 #include "views/widget/tooltip_manager_views.h" |
19 | 20 |
20 #if defined(OS_WIN) | 21 #if defined(OS_WIN) |
21 #include "base/win/scoped_gdi_object.h" | 22 #include "base/win/scoped_gdi_object.h" |
22 #include "base/win/win_util.h" | 23 #include "base/win/win_util.h" |
23 #include "ui/base/l10n/l10n_util_win.h" | 24 #include "ui/base/l10n/l10n_util_win.h" |
24 #endif | 25 #endif |
25 | 26 |
26 #if defined(HAVE_IBUS) | 27 #if defined(HAVE_IBUS) |
27 #include "views/ime/input_method_ibus.h" | 28 #include "views/ime/input_method_ibus.h" |
28 #else | 29 #else |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 window_->SetBounds(params.bounds); | 87 window_->SetBounds(params.bounds); |
87 if (params.type == Widget::InitParams::TYPE_CONTROL) { | 88 if (params.type == Widget::InitParams::TYPE_CONTROL) { |
88 window_->SetParent(params.parent); | 89 window_->SetParent(params.parent); |
89 } else { | 90 } else { |
90 window_->SetParent(NULL); | 91 window_->SetParent(NULL); |
91 // TODO(derat): Set Transient Parent. | 92 // TODO(derat): Set Transient Parent. |
92 } | 93 } |
93 // TODO(beng): do this some other way. | 94 // TODO(beng): do this some other way. |
94 delegate_->OnNativeWidgetSizeChanged(params.bounds.size()); | 95 delegate_->OnNativeWidgetSizeChanged(params.bounds.size()); |
95 can_activate_ = params.can_activate; | 96 can_activate_ = params.can_activate; |
| 97 if (params.type != Widget::InitParams::TYPE_TOOLTIP && !params.child) { |
| 98 DCHECK(GetWidget()->GetRootView()); |
| 99 views::TooltipManagerViews* manager = new views::TooltipManagerViews( |
| 100 GetWidget()->GetRootView()); |
| 101 tooltip_manager_.reset(manager); |
| 102 } |
96 } | 103 } |
97 | 104 |
98 NonClientFrameView* NativeWidgetAura::CreateNonClientFrameView() { | 105 NonClientFrameView* NativeWidgetAura::CreateNonClientFrameView() { |
99 NOTIMPLEMENTED(); | 106 NOTIMPLEMENTED(); |
100 return NULL; | 107 return NULL; |
101 } | 108 } |
102 | 109 |
103 void NativeWidgetAura::UpdateFrameAfterFrameChange() { | 110 void NativeWidgetAura::UpdateFrameAfterFrameChange() { |
104 // We don't support changing the frame type. | 111 // We don't support changing the frame type. |
105 NOTREACHED(); | 112 NOTREACHED(); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 182 |
176 if (value) | 183 if (value) |
177 props_.push_back(new ViewProp(window_, name, value)); | 184 props_.push_back(new ViewProp(window_, name, value)); |
178 } | 185 } |
179 | 186 |
180 void* NativeWidgetAura::GetNativeWindowProperty(const char* name) const { | 187 void* NativeWidgetAura::GetNativeWindowProperty(const char* name) const { |
181 return window_ ? ViewProp::GetValue(window_, name) : NULL; | 188 return window_ ? ViewProp::GetValue(window_, name) : NULL; |
182 } | 189 } |
183 | 190 |
184 TooltipManager* NativeWidgetAura::GetTooltipManager() const { | 191 TooltipManager* NativeWidgetAura::GetTooltipManager() const { |
185 //NOTIMPLEMENTED(); | 192 return tooltip_manager_.get(); |
186 return NULL; | |
187 } | 193 } |
188 | 194 |
189 bool NativeWidgetAura::IsScreenReaderActive() const { | 195 bool NativeWidgetAura::IsScreenReaderActive() const { |
190 NOTIMPLEMENTED(); | 196 NOTIMPLEMENTED(); |
191 return false; | 197 return false; |
192 } | 198 } |
193 | 199 |
194 void NativeWidgetAura::SendNativeAccessibilityEvent( | 200 void NativeWidgetAura::SendNativeAccessibilityEvent( |
195 View* view, | 201 View* view, |
196 ui::AccessibilityTypes::Event event_type) { | 202 ui::AccessibilityTypes::Event event_type) { |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 } | 650 } |
645 | 651 |
646 // static | 652 // static |
647 bool NativeWidgetPrivate::IsMouseButtonDown() { | 653 bool NativeWidgetPrivate::IsMouseButtonDown() { |
648 NOTIMPLEMENTED(); | 654 NOTIMPLEMENTED(); |
649 return false; | 655 return false; |
650 } | 656 } |
651 | 657 |
652 } // namespace internal | 658 } // namespace internal |
653 } // namespace views | 659 } // namespace views |
OLD | NEW |