OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "views/window/window_gtk.h" | 5 #include "views/window/window_gtk.h" |
6 | 6 |
7 #include "gfx/rect.h" | 7 #include "gfx/rect.h" |
8 #include "base/i18n/rtl.h" | 8 #include "base/i18n/rtl.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "gfx/path.h" | 10 #include "gfx/path.h" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 } | 199 } |
200 | 200 |
201 void WindowGtk::UpdateWindowTitle() { | 201 void WindowGtk::UpdateWindowTitle() { |
202 // If the non-client view is rendering its own title, it'll need to relayout | 202 // If the non-client view is rendering its own title, it'll need to relayout |
203 // now. | 203 // now. |
204 non_client_view_->Layout(); | 204 non_client_view_->Layout(); |
205 | 205 |
206 // Update the native frame's text. We do this regardless of whether or not | 206 // Update the native frame's text. We do this regardless of whether or not |
207 // the native frame is being used, since this also updates the taskbar, etc. | 207 // the native frame is being used, since this also updates the taskbar, etc. |
208 std::wstring window_title = window_delegate_->GetWindowTitle(); | 208 std::wstring window_title = window_delegate_->GetWindowTitle(); |
209 std::wstring localized_text; | 209 base::i18n::AdjustStringForLocaleDirection(&window_title); |
210 if (base::i18n::AdjustStringForLocaleDirection(window_title, &localized_text)) | |
211 window_title.assign(localized_text); | |
212 | 210 |
213 gtk_window_set_title(GetNativeWindow(), WideToUTF8(window_title).c_str()); | 211 gtk_window_set_title(GetNativeWindow(), WideToUTF8(window_title).c_str()); |
214 } | 212 } |
215 | 213 |
216 void WindowGtk::UpdateWindowIcon() { | 214 void WindowGtk::UpdateWindowIcon() { |
217 // Doesn't matter for chrome os. | 215 // Doesn't matter for chrome os. |
218 } | 216 } |
219 | 217 |
220 void WindowGtk::SetIsAlwaysOnTop(bool always_on_top) { | 218 void WindowGtk::SetIsAlwaysOnTop(bool always_on_top) { |
221 gtk_window_set_keep_above(GetNativeWindow(), always_on_top); | 219 gtk_window_set_keep_above(GetNativeWindow(), always_on_top); |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 } | 489 } |
492 | 490 |
493 void WindowGtk::OnDestroy(GtkWidget* widget) { | 491 void WindowGtk::OnDestroy(GtkWidget* widget) { |
494 non_client_view_->WindowClosing(); | 492 non_client_view_->WindowClosing(); |
495 WidgetGtk::OnDestroy(widget); | 493 WidgetGtk::OnDestroy(widget); |
496 window_delegate_->DeleteDelegate(); | 494 window_delegate_->DeleteDelegate(); |
497 window_delegate_ = NULL; | 495 window_delegate_ = NULL; |
498 } | 496 } |
499 | 497 |
500 } // namespace views | 498 } // namespace views |
OLD | NEW |