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 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
759 return provider; | 759 return provider; |
760 | 760 |
761 provider = root_widget->default_theme_provider_.get(); | 761 provider = root_widget->default_theme_provider_.get(); |
762 if (provider) | 762 if (provider) |
763 return provider; | 763 return provider; |
764 } | 764 } |
765 return default_theme_provider_.get(); | 765 return default_theme_provider_.get(); |
766 } | 766 } |
767 | 767 |
768 const ui::NativeTheme* Widget::GetNativeTheme() const { | 768 const ui::NativeTheme* Widget::GetNativeTheme() const { |
769 if (ViewsDelegate::GetInstance()) { | |
770 ui::NativeTheme* theme = | |
771 ViewsDelegate::GetInstance()->GetNativeThemeOverride(this); | |
sky
2015/11/12 21:58:29
Can we cache this rather than querying the delegat
Evan Stade
2015/11/12 22:11:11
I suppose we could as long as we call NativeTheme:
| |
772 if (theme) | |
773 return theme; | |
774 } | |
769 return native_widget_->GetNativeTheme(); | 775 return native_widget_->GetNativeTheme(); |
770 } | 776 } |
771 | 777 |
772 FocusManager* Widget::GetFocusManager() { | 778 FocusManager* Widget::GetFocusManager() { |
773 Widget* toplevel_widget = GetTopLevelWidget(); | 779 Widget* toplevel_widget = GetTopLevelWidget(); |
774 return toplevel_widget ? toplevel_widget->focus_manager_.get() : NULL; | 780 return toplevel_widget ? toplevel_widget->focus_manager_.get() : NULL; |
775 } | 781 } |
776 | 782 |
777 const FocusManager* Widget::GetFocusManager() const { | 783 const FocusManager* Widget::GetFocusManager() const { |
778 const Widget* toplevel_widget = GetTopLevelWidget(); | 784 const Widget* toplevel_widget = GetTopLevelWidget(); |
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1498 | 1504 |
1499 //////////////////////////////////////////////////////////////////////////////// | 1505 //////////////////////////////////////////////////////////////////////////////// |
1500 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1506 // internal::NativeWidgetPrivate, NativeWidget implementation: |
1501 | 1507 |
1502 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1508 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
1503 return this; | 1509 return this; |
1504 } | 1510 } |
1505 | 1511 |
1506 } // namespace internal | 1512 } // namespace internal |
1507 } // namespace views | 1513 } // namespace views |
OLD | NEW |