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

Side by Side Diff: views/controls/menu/native_menu_gtk.cc

Issue 1073005: Move RTL related functions from app/l10n_util to base/i18n/rtl... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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
« no previous file with comments | « views/controls/menu/menu_controller.cc ('k') | views/controls/message_box_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/controls/menu/native_menu_gtk.h" 5 #include "views/controls/menu/native_menu_gtk.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
11 #include "app/gfx/font.h" 11 #include "app/gfx/font.h"
12 #include "app/l10n_util.h"
13 #include "app/menus/menu_model.h" 12 #include "app/menus/menu_model.h"
13 #include "base/i18n/rtl.h"
14 #include "base/keyboard_code_conversion_gtk.h" 14 #include "base/keyboard_code_conversion_gtk.h"
15 #include "base/keyboard_codes.h" 15 #include "base/keyboard_codes.h"
16 #include "base/message_loop.h" 16 #include "base/message_loop.h"
17 #include "base/time.h" 17 #include "base/time.h"
18 #include "base/utf_string_conversions.h" 18 #include "base/utf_string_conversions.h"
19 #include "gfx/gtk_util.h" 19 #include "gfx/gtk_util.h"
20 #include "third_party/skia/include/core/SkBitmap.h" 20 #include "third_party/skia/include/core/SkBitmap.h"
21 #include "views/accelerator.h" 21 #include "views/accelerator.h"
22 #include "views/controls/menu/menu_2.h" 22 #include "views/controls/menu/menu_2.h"
23 23
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 gboolean* push_in, 321 gboolean* push_in,
322 void* data) { 322 void* data) {
323 Position* position = reinterpret_cast<Position*>(data); 323 Position* position = reinterpret_cast<Position*>(data);
324 324
325 GtkRequisition menu_req; 325 GtkRequisition menu_req;
326 gtk_widget_size_request(GTK_WIDGET(menu), &menu_req); 326 gtk_widget_size_request(GTK_WIDGET(menu), &menu_req);
327 327
328 *x = position->point.x(); 328 *x = position->point.x();
329 *y = position->point.y(); 329 *y = position->point.y();
330 views::Menu2::Alignment alignment = position->alignment; 330 views::Menu2::Alignment alignment = position->alignment;
331 if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) { 331 if (base::i18n::IsRTL()) {
332 switch (alignment) { 332 switch (alignment) {
333 case Menu2::ALIGN_TOPRIGHT: 333 case Menu2::ALIGN_TOPRIGHT:
334 alignment = Menu2::ALIGN_TOPLEFT; 334 alignment = Menu2::ALIGN_TOPLEFT;
335 break; 335 break;
336 case Menu2::ALIGN_TOPLEFT: 336 case Menu2::ALIGN_TOPLEFT:
337 alignment = Menu2::ALIGN_TOPRIGHT; 337 alignment = Menu2::ALIGN_TOPRIGHT;
338 break; 338 break;
339 default: 339 default:
340 NOTREACHED(); 340 NOTREACHED();
341 break; 341 break;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 413
414 //////////////////////////////////////////////////////////////////////////////// 414 ////////////////////////////////////////////////////////////////////////////////
415 // MenuWrapper, public: 415 // MenuWrapper, public:
416 416
417 // static 417 // static
418 MenuWrapper* MenuWrapper::CreateWrapper(Menu2* menu) { 418 MenuWrapper* MenuWrapper::CreateWrapper(Menu2* menu) {
419 return new NativeMenuGtk(menu); 419 return new NativeMenuGtk(menu);
420 } 420 }
421 421
422 } // namespace views 422 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/menu/menu_controller.cc ('k') | views/controls/message_box_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698