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.h" | 8 #include "base/message_loop.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "ui/base/events/event.h" | 10 #include "ui/base/events/event.h" |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 } | 729 } |
730 | 730 |
731 void* Widget::GetNativeWindowProperty(const char* name) const { | 731 void* Widget::GetNativeWindowProperty(const char* name) const { |
732 return native_widget_->GetNativeWindowProperty(name); | 732 return native_widget_->GetNativeWindowProperty(name); |
733 } | 733 } |
734 | 734 |
735 void Widget::UpdateWindowTitle() { | 735 void Widget::UpdateWindowTitle() { |
736 if (!non_client_view_) | 736 if (!non_client_view_) |
737 return; | 737 return; |
738 | 738 |
739 // If the non-client view is rendering its own title, it'll need to relayout | |
740 // now. | |
741 non_client_view_->Layout(); | |
742 | |
743 // Update the native frame's text. We do this regardless of whether or not | 739 // Update the native frame's text. We do this regardless of whether or not |
744 // the native frame is being used, since this also updates the taskbar, etc. | 740 // the native frame is being used, since this also updates the taskbar, etc. |
745 string16 window_title; | 741 string16 window_title; |
746 if (native_widget_->IsScreenReaderActive()) { | 742 if (native_widget_->IsScreenReaderActive()) { |
747 window_title = widget_delegate_->GetAccessibleWindowTitle(); | 743 window_title = widget_delegate_->GetAccessibleWindowTitle(); |
748 } else { | 744 } else { |
749 window_title = widget_delegate_->GetWindowTitle(); | 745 window_title = widget_delegate_->GetWindowTitle(); |
750 } | 746 } |
751 base::i18n::AdjustStringForLocaleDirection(&window_title); | 747 base::i18n::AdjustStringForLocaleDirection(&window_title); |
752 native_widget_->SetWindowTitle(window_title); | 748 native_widget_->SetWindowTitle(window_title); |
| 749 non_client_view_->UpdateWindowTitle(); |
| 750 |
| 751 // If the non-client view is rendering its own title, it'll need to relayout |
| 752 // now and to get a paint update later on. |
| 753 non_client_view_->Layout(); |
753 } | 754 } |
754 | 755 |
755 void Widget::UpdateWindowIcon() { | 756 void Widget::UpdateWindowIcon() { |
756 if (non_client_view_) | 757 if (non_client_view_) |
757 non_client_view_->UpdateWindowIcon(); | 758 non_client_view_->UpdateWindowIcon(); |
758 native_widget_->SetWindowIcons(widget_delegate_->GetWindowIcon(), | 759 native_widget_->SetWindowIcons(widget_delegate_->GetWindowIcon(), |
759 widget_delegate_->GetWindowAppIcon()); | 760 widget_delegate_->GetWindowAppIcon()); |
760 } | 761 } |
761 | 762 |
762 FocusTraversable* Widget::GetFocusTraversable() { | 763 FocusTraversable* Widget::GetFocusTraversable() { |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1346 | 1347 |
1347 //////////////////////////////////////////////////////////////////////////////// | 1348 //////////////////////////////////////////////////////////////////////////////// |
1348 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1349 // internal::NativeWidgetPrivate, NativeWidget implementation: |
1349 | 1350 |
1350 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1351 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
1351 return this; | 1352 return this; |
1352 } | 1353 } |
1353 | 1354 |
1354 } // namespace internal | 1355 } // namespace internal |
1355 } // namespace views | 1356 } // namespace views |
OLD | NEW |