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/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // Overridden from WidgetDelegate: | 79 // Overridden from WidgetDelegate: |
80 virtual void DeleteDelegate() OVERRIDE { | 80 virtual void DeleteDelegate() OVERRIDE { |
81 delete this; | 81 delete this; |
82 } | 82 } |
83 virtual Widget* GetWidget() OVERRIDE { | 83 virtual Widget* GetWidget() OVERRIDE { |
84 return widget_; | 84 return widget_; |
85 } | 85 } |
86 virtual const Widget* GetWidget() const OVERRIDE { | 86 virtual const Widget* GetWidget() const OVERRIDE { |
87 return widget_; | 87 return widget_; |
88 } | 88 } |
89 | |
90 virtual bool CanActivate() const OVERRIDE { | 89 virtual bool CanActivate() const OVERRIDE { |
91 return can_activate_; | 90 return can_activate_; |
92 } | 91 } |
| 92 virtual bool ShouldAdvanceFocusToTopLevelWidget() const OVERRIDE { |
| 93 // In most situations where a Widget is used without a delegate the Widget |
| 94 // is used as a container, so that we want focus to advance to the top-level |
| 95 // widget. A good example of this is the find bar. |
| 96 return true; |
| 97 } |
93 | 98 |
94 private: | 99 private: |
95 Widget* widget_; | 100 Widget* widget_; |
96 bool can_activate_; | 101 bool can_activate_; |
97 | 102 |
98 DISALLOW_COPY_AND_ASSIGN(DefaultWidgetDelegate); | 103 DISALLOW_COPY_AND_ASSIGN(DefaultWidgetDelegate); |
99 }; | 104 }; |
100 | 105 |
101 //////////////////////////////////////////////////////////////////////////////// | 106 //////////////////////////////////////////////////////////////////////////////// |
102 // Widget, InitParams: | 107 // Widget, InitParams: |
(...skipping 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1427 | 1432 |
1428 //////////////////////////////////////////////////////////////////////////////// | 1433 //////////////////////////////////////////////////////////////////////////////// |
1429 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1434 // internal::NativeWidgetPrivate, NativeWidget implementation: |
1430 | 1435 |
1431 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1436 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
1432 return this; | 1437 return this; |
1433 } | 1438 } |
1434 | 1439 |
1435 } // namespace internal | 1440 } // namespace internal |
1436 } // namespace views | 1441 } // namespace views |
OLD | NEW |