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/ui_base_types.h" | 12 #include "ui/base/ui_base_types.h" |
13 #include "ui/gfx/canvas.h" | 13 #include "ui/gfx/canvas.h" |
14 #include "ui/gfx/compositor/layer.h" | 14 #include "ui/gfx/compositor/layer.h" |
15 #include "ui/gfx/font.h" | 15 #include "ui/gfx/font.h" |
16 #include "ui/gfx/screen.h" | 16 #include "ui/gfx/screen.h" |
17 #include "views/widget/native_widget_delegate.h" | 17 #include "views/widget/native_widget_delegate.h" |
| 18 #include "views/widget/tooltip_manager_views.h" |
18 | 19 |
19 #if defined(OS_WIN) | 20 #if defined(OS_WIN) |
20 #include "base/win/scoped_gdi_object.h" | 21 #include "base/win/scoped_gdi_object.h" |
21 #include "base/win/win_util.h" | 22 #include "base/win/win_util.h" |
22 #include "ui/base/l10n/l10n_util_win.h" | 23 #include "ui/base/l10n/l10n_util_win.h" |
23 #endif | 24 #endif |
24 | 25 |
25 #if defined(HAVE_IBUS) | 26 #if defined(HAVE_IBUS) |
26 #include "views/ime/input_method_ibus.h" | 27 #include "views/ime/input_method_ibus.h" |
27 #else | 28 #else |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 window_->SetParent(params.GetParent()); | 87 window_->SetParent(params.GetParent()); |
87 } else { | 88 } else { |
88 window_->SetParent(NULL); | 89 window_->SetParent(NULL); |
89 gfx::NativeView parent = params.GetParent(); | 90 gfx::NativeView parent = params.GetParent(); |
90 if (parent) | 91 if (parent) |
91 parent->AddTransientChild(window_); | 92 parent->AddTransientChild(window_); |
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 void NativeWidgetAura::SetNativeWindowProperty(const char* name, void* value) { | 170 void NativeWidgetAura::SetNativeWindowProperty(const char* name, void* value) { |
164 if (window_) | 171 if (window_) |
165 window_->SetProperty(name, value); | 172 window_->SetProperty(name, value); |
166 } | 173 } |
167 | 174 |
168 void* NativeWidgetAura::GetNativeWindowProperty(const char* name) const { | 175 void* NativeWidgetAura::GetNativeWindowProperty(const char* name) const { |
169 return window_ ? window_->GetProperty(name) : NULL; | 176 return window_ ? window_->GetProperty(name) : NULL; |
170 } | 177 } |
171 | 178 |
172 TooltipManager* NativeWidgetAura::GetTooltipManager() const { | 179 TooltipManager* NativeWidgetAura::GetTooltipManager() const { |
173 //NOTIMPLEMENTED(); | 180 return tooltip_manager_.get(); |
174 return NULL; | |
175 } | 181 } |
176 | 182 |
177 bool NativeWidgetAura::IsScreenReaderActive() const { | 183 bool NativeWidgetAura::IsScreenReaderActive() const { |
178 NOTIMPLEMENTED(); | 184 NOTIMPLEMENTED(); |
179 return false; | 185 return false; |
180 } | 186 } |
181 | 187 |
182 void NativeWidgetAura::SendNativeAccessibilityEvent( | 188 void NativeWidgetAura::SendNativeAccessibilityEvent( |
183 View* view, | 189 View* view, |
184 ui::AccessibilityTypes::Event event_type) { | 190 ui::AccessibilityTypes::Event event_type) { |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 } | 637 } |
632 | 638 |
633 // static | 639 // static |
634 bool NativeWidgetPrivate::IsMouseButtonDown() { | 640 bool NativeWidgetPrivate::IsMouseButtonDown() { |
635 NOTIMPLEMENTED(); | 641 NOTIMPLEMENTED(); |
636 return false; | 642 return false; |
637 } | 643 } |
638 | 644 |
639 } // namespace internal | 645 } // namespace internal |
640 } // namespace views | 646 } // namespace views |
OLD | NEW |