OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "gfx/rect.h" | 8 #include "gfx/rect.h" |
| 9 #include "base/i18n/rtl.h" |
9 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
10 #include "gfx/path.h" | 11 #include "gfx/path.h" |
11 #include "views/event.h" | 12 #include "views/event.h" |
12 #include "views/screen.h" | 13 #include "views/screen.h" |
13 #include "views/widget/root_view.h" | 14 #include "views/widget/root_view.h" |
14 #include "views/window/custom_frame_view.h" | 15 #include "views/window/custom_frame_view.h" |
15 #include "views/window/hit_test.h" | 16 #include "views/window/hit_test.h" |
16 #include "views/window/non_client_view.h" | 17 #include "views/window/non_client_view.h" |
17 #include "views/window/window_delegate.h" | 18 #include "views/window/window_delegate.h" |
18 | 19 |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 | 197 |
197 void WindowGtk::UpdateWindowTitle() { | 198 void WindowGtk::UpdateWindowTitle() { |
198 // If the non-client view is rendering its own title, it'll need to relayout | 199 // If the non-client view is rendering its own title, it'll need to relayout |
199 // now. | 200 // now. |
200 non_client_view_->Layout(); | 201 non_client_view_->Layout(); |
201 | 202 |
202 // Update the native frame's text. We do this regardless of whether or not | 203 // Update the native frame's text. We do this regardless of whether or not |
203 // the native frame is being used, since this also updates the taskbar, etc. | 204 // the native frame is being used, since this also updates the taskbar, etc. |
204 std::wstring window_title = window_delegate_->GetWindowTitle(); | 205 std::wstring window_title = window_delegate_->GetWindowTitle(); |
205 std::wstring localized_text; | 206 std::wstring localized_text; |
206 if (l10n_util::AdjustStringForLocaleDirection(window_title, &localized_text)) | 207 if (base::i18n::AdjustStringForLocaleDirection(window_title, &localized_text)) |
207 window_title.assign(localized_text); | 208 window_title.assign(localized_text); |
208 | 209 |
209 gtk_window_set_title(GetNativeWindow(), WideToUTF8(window_title).c_str()); | 210 gtk_window_set_title(GetNativeWindow(), WideToUTF8(window_title).c_str()); |
210 } | 211 } |
211 | 212 |
212 void WindowGtk::UpdateWindowIcon() { | 213 void WindowGtk::UpdateWindowIcon() { |
213 // Doesn't matter for chrome os. | 214 // Doesn't matter for chrome os. |
214 } | 215 } |
215 | 216 |
216 void WindowGtk::SetIsAlwaysOnTop(bool always_on_top) { | 217 void WindowGtk::SetIsAlwaysOnTop(bool always_on_top) { |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 size.width(), size.height()); | 476 size.width(), size.height()); |
476 SetBounds(bounds, NULL); | 477 SetBounds(bounds, NULL); |
477 } | 478 } |
478 | 479 |
479 void WindowGtk::OnDestroy() { | 480 void WindowGtk::OnDestroy() { |
480 non_client_view_->WindowClosing(); | 481 non_client_view_->WindowClosing(); |
481 WidgetGtk::OnDestroy(); | 482 WidgetGtk::OnDestroy(); |
482 } | 483 } |
483 | 484 |
484 } // namespace views | 485 } // namespace views |
OLD | NEW |