Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Side by Side Diff: ui/views/widget/widget.cc

Issue 10993087: Handle titlebar text updates properly (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 728
729 void* Widget::GetNativeWindowProperty(const char* name) const { 729 void* Widget::GetNativeWindowProperty(const char* name) const {
730 return native_widget_->GetNativeWindowProperty(name); 730 return native_widget_->GetNativeWindowProperty(name);
731 } 731 }
732 732
733 void Widget::UpdateWindowTitle() { 733 void Widget::UpdateWindowTitle() {
734 if (!non_client_view_) 734 if (!non_client_view_)
735 return; 735 return;
736 736
737 // If the non-client view is rendering its own title, it'll need to relayout 737 // If the non-client view is rendering its own title, it'll need to relayout
738 // now. 738 // now and to get a paint update later on.
739 non_client_view_->Layout(); 739 non_client_view_->Layout();
740 non_client_view_->UpdateWindowTitle();
740 741
741 // Update the native frame's text. We do this regardless of whether or not 742 // Update the native frame's text. We do this regardless of whether or not
742 // the native frame is being used, since this also updates the taskbar, etc. 743 // the native frame is being used, since this also updates the taskbar, etc.
743 string16 window_title; 744 string16 window_title;
744 if (native_widget_->IsScreenReaderActive()) { 745 if (native_widget_->IsScreenReaderActive()) {
745 window_title = widget_delegate_->GetAccessibleWindowTitle(); 746 window_title = widget_delegate_->GetAccessibleWindowTitle();
746 } else { 747 } else {
747 window_title = widget_delegate_->GetWindowTitle(); 748 window_title = widget_delegate_->GetWindowTitle();
748 } 749 }
749 base::i18n::AdjustStringForLocaleDirection(&window_title); 750 base::i18n::AdjustStringForLocaleDirection(&window_title);
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
1344 1345
1345 //////////////////////////////////////////////////////////////////////////////// 1346 ////////////////////////////////////////////////////////////////////////////////
1346 // internal::NativeWidgetPrivate, NativeWidget implementation: 1347 // internal::NativeWidgetPrivate, NativeWidget implementation:
1347 1348
1348 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { 1349 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() {
1349 return this; 1350 return this;
1350 } 1351 }
1351 1352
1352 } // namespace internal 1353 } // namespace internal
1353 } // namespace views 1354 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698