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/widget.h" | 5 #include "ui/views/widget/widget.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 BuildRootLayers(view->child_at(i), layers); | 52 BuildRootLayers(view->child_at(i), layers); |
53 } | 53 } |
54 } | 54 } |
55 | 55 |
56 // Create a native widget implementation. | 56 // Create a native widget implementation. |
57 // First, use the supplied one if non-NULL. | 57 // First, use the supplied one if non-NULL. |
58 // Finally, make a default one. | 58 // Finally, make a default one. |
59 NativeWidget* CreateNativeWidget(NativeWidget* native_widget, | 59 NativeWidget* CreateNativeWidget(NativeWidget* native_widget, |
60 internal::NativeWidgetDelegate* delegate) { | 60 internal::NativeWidgetDelegate* delegate) { |
61 if (!native_widget) { | 61 if (!native_widget) { |
62 native_widget = | 62 if (ViewsDelegate::GetInstance()) { |
63 internal::NativeWidgetPrivate::CreateNativeWidget(delegate); | 63 native_widget = ViewsDelegate::GetInstance()->CreateNativeWidget( |
| 64 delegate); |
| 65 } |
| 66 if (!native_widget) { |
| 67 native_widget = |
| 68 internal::NativeWidgetPrivate::CreateNativeWidget(delegate); |
| 69 } |
64 } | 70 } |
65 return native_widget; | 71 return native_widget; |
66 } | 72 } |
67 | 73 |
68 void NotifyCaretBoundsChanged(ui::InputMethod* input_method) { | 74 void NotifyCaretBoundsChanged(ui::InputMethod* input_method) { |
69 if (!input_method) | 75 if (!input_method) |
70 return; | 76 return; |
71 ui::TextInputClient* client = input_method->GetTextInputClient(); | 77 ui::TextInputClient* client = input_method->GetTextInputClient(); |
72 if (client) | 78 if (client) |
73 input_method->OnCaretBoundsChanged(client); | 79 input_method->OnCaretBoundsChanged(client); |
(...skipping 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1493 | 1499 |
1494 //////////////////////////////////////////////////////////////////////////////// | 1500 //////////////////////////////////////////////////////////////////////////////// |
1495 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1501 // internal::NativeWidgetPrivate, NativeWidget implementation: |
1496 | 1502 |
1497 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1503 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
1498 return this; | 1504 return this; |
1499 } | 1505 } |
1500 | 1506 |
1501 } // namespace internal | 1507 } // namespace internal |
1502 } // namespace views | 1508 } // namespace views |
OLD | NEW |