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

Side by Side Diff: chrome/browser/ui/libgtk2ui/gtk2_ui.cc

Issue 213283004: linux_aura: Port GtkKeybindingsHandler to Aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
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 "chrome/browser/ui/libgtk2ui/gtk2_ui.h" 5 #include "chrome/browser/ui/libgtk2ui/gtk2_ui.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/leak_annotations.h" 10 #include "base/debug/leak_annotations.h"
11 #include "base/environment.h" 11 #include "base/environment.h"
12 #include "base/i18n/rtl.h" 12 #include "base/i18n/rtl.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/nix/mime_util_xdg.h" 14 #include "base/nix/mime_util_xdg.h"
15 #include "base/stl_util.h" 15 #include "base/stl_util.h"
16 #include "base/strings/stringprintf.h" 16 #include "base/strings/stringprintf.h"
17 #include "chrome/browser/themes/theme_properties.h" 17 #include "chrome/browser/themes/theme_properties.h"
18 #include "chrome/browser/ui/libgtk2ui/app_indicator_icon.h" 18 #include "chrome/browser/ui/libgtk2ui/app_indicator_icon.h"
19 #include "chrome/browser/ui/libgtk2ui/chrome_gtk_frame.h" 19 #include "chrome/browser/ui/libgtk2ui/chrome_gtk_frame.h"
20 #include "chrome/browser/ui/libgtk2ui/gtk2_border.h" 20 #include "chrome/browser/ui/libgtk2ui/gtk2_border.h"
21 #include "chrome/browser/ui/libgtk2ui/gtk2_key_bindings_handler.h"
21 #include "chrome/browser/ui/libgtk2ui/gtk2_signal_registrar.h" 22 #include "chrome/browser/ui/libgtk2ui/gtk2_signal_registrar.h"
22 #include "chrome/browser/ui/libgtk2ui/gtk2_util.h" 23 #include "chrome/browser/ui/libgtk2ui/gtk2_util.h"
23 #include "chrome/browser/ui/libgtk2ui/native_theme_gtk2.h" 24 #include "chrome/browser/ui/libgtk2ui/native_theme_gtk2.h"
24 #include "chrome/browser/ui/libgtk2ui/print_dialog_gtk2.h" 25 #include "chrome/browser/ui/libgtk2ui/print_dialog_gtk2.h"
25 #include "chrome/browser/ui/libgtk2ui/printing_gtk2_util.h" 26 #include "chrome/browser/ui/libgtk2ui/printing_gtk2_util.h"
26 #include "chrome/browser/ui/libgtk2ui/select_file_dialog_impl.h" 27 #include "chrome/browser/ui/libgtk2ui/select_file_dialog_impl.h"
27 #include "chrome/browser/ui/libgtk2ui/skia_utils_gtk2.h" 28 #include "chrome/browser/ui/libgtk2ui/skia_utils_gtk2.h"
28 #include "chrome/browser/ui/libgtk2ui/unity_service.h" 29 #include "chrome/browser/ui/libgtk2ui/unity_service.h"
29 #include "chrome/browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2.h" 30 #include "chrome/browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2.h"
30 #include "grit/theme_resources.h" 31 #include "grit/theme_resources.h"
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 G_CALLBACK(&OnStyleSetThunk), this); 337 G_CALLBACK(&OnStyleSetThunk), this);
337 338
338 LoadGtkValues(); 339 LoadGtkValues();
339 SetXDGIconTheme(); 340 SetXDGIconTheme();
340 341
341 printing::PrintingContextLinux::SetCreatePrintDialogFunction( 342 printing::PrintingContextLinux::SetCreatePrintDialogFunction(
342 &PrintDialogGtk2::CreatePrintDialog); 343 &PrintDialogGtk2::CreatePrintDialog);
343 printing::PrintingContextLinux::SetPdfPaperSizeFunction( 344 printing::PrintingContextLinux::SetPdfPaperSizeFunction(
344 &GetPdfPaperSizeDeviceUnitsGtk); 345 &GetPdfPaperSizeDeviceUnitsGtk);
345 346
347 content::KeybindingHandlerFactoryAuraX11::SetFactory(this);
348
346 #if defined(USE_GCONF) 349 #if defined(USE_GCONF)
347 // We must build this after GTK gets initialized. 350 // We must build this after GTK gets initialized.
348 titlebar_listener_.reset(new GConfTitlebarListener(this)); 351 titlebar_listener_.reset(new GConfTitlebarListener(this));
349 #endif // defined(USE_GCONF) 352 #endif // defined(USE_GCONF)
350 353
351 indicators_count = 0; 354 indicators_count = 0;
352 } 355 }
353 356
354 Gtk2UI::~Gtk2UI() { 357 Gtk2UI::~Gtk2UI() {
355 gtk_widget_destroy(fake_window_); 358 gtk_widget_destroy(fake_window_);
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 bool Gtk2UI::UnityIsRunning() { 661 bool Gtk2UI::UnityIsRunning() {
659 return unity::IsRunning(); 662 return unity::IsRunning();
660 } 663 }
661 664
662 void Gtk2UI::NotifyWindowManagerStartupComplete() { 665 void Gtk2UI::NotifyWindowManagerStartupComplete() {
663 // TODO(port) Implement this using _NET_STARTUP_INFO_BEGIN/_NET_STARTUP_INFO 666 // TODO(port) Implement this using _NET_STARTUP_INFO_BEGIN/_NET_STARTUP_INFO
664 // from http://standards.freedesktop.org/startup-notification-spec/ instead. 667 // from http://standards.freedesktop.org/startup-notification-spec/ instead.
665 gdk_notify_startup_complete(); 668 gdk_notify_startup_complete();
666 } 669 }
667 670
671 content::KeybindingHandlerAuraX11* Gtk2UI::Create() {
672 return new Gtk2KeyBindingsHandler;
673 }
674
668 void Gtk2UI::GetScrollbarColors(GdkColor* thumb_active_color, 675 void Gtk2UI::GetScrollbarColors(GdkColor* thumb_active_color,
669 GdkColor* thumb_inactive_color, 676 GdkColor* thumb_inactive_color,
670 GdkColor* track_color) { 677 GdkColor* track_color) {
671 GdkColor* theme_thumb_active = NULL; 678 GdkColor* theme_thumb_active = NULL;
672 GdkColor* theme_thumb_inactive = NULL; 679 GdkColor* theme_thumb_inactive = NULL;
673 GdkColor* theme_trough_color = NULL; 680 GdkColor* theme_trough_color = NULL;
674 gtk_widget_style_get(GTK_WIDGET(fake_frame_), 681 gtk_widget_style_get(GTK_WIDGET(fake_frame_),
675 "scrollbar-slider-prelight-color", &theme_thumb_active, 682 "scrollbar-slider-prelight-color", &theme_thumb_active,
676 "scrollbar-slider-normal-color", &theme_thumb_inactive, 683 "scrollbar-slider-normal-color", &theme_thumb_inactive,
677 "scrollbar-trough-color", &theme_trough_color, 684 "scrollbar-trough-color", &theme_trough_color,
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
1357 1364
1358 FOR_EACH_OBSERVER(views::NativeThemeChangeObserver, theme_change_observers_, 1365 FOR_EACH_OBSERVER(views::NativeThemeChangeObserver, theme_change_observers_,
1359 OnNativeThemeChanged()); 1366 OnNativeThemeChanged());
1360 } 1367 }
1361 1368
1362 } // namespace libgtk2ui 1369 } // namespace libgtk2ui
1363 1370
1364 views::LinuxUI* BuildGtk2UI() { 1371 views::LinuxUI* BuildGtk2UI() {
1365 return new libgtk2ui::Gtk2UI; 1372 return new libgtk2ui::Gtk2UI;
1366 } 1373 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698