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

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

Issue 9728002: Removing deprecated GTK-Views code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | « ui/views/widget/gtk_views_window.h ('k') | ui/views/widget/native_widget_gtk.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include <gtk/gtk.h>
6
7 #include "ui/views/events/event.h"
8 #include "ui/views/focus/focus_manager.h"
9 #include "ui/views/widget/gtk_views_window.h"
10 #include "ui/views/widget/widget.h"
11
12 G_BEGIN_DECLS
13
14 G_DEFINE_TYPE(GtkViewsWindow, gtk_views_window, GTK_TYPE_WINDOW)
15
16 static void gtk_views_window_move_focus(GtkWindow* window,
17 GtkDirectionType dir) {
18 views::Widget* widget = views::Widget::GetWidgetForNativeWindow(window);
19 views::FocusManager* focus_manager =
20 widget ? widget->GetFocusManager() : NULL;
21 if (focus_manager) {
22 GdkEvent* key = gtk_get_current_event();
23 if (key && key->type == GDK_KEY_PRESS) {
24 views::KeyEvent key_event(key);
25 focus_manager->OnKeyEvent(key_event);
26 }
27 } else if (GTK_WINDOW_CLASS(gtk_views_window_parent_class)->move_focus) {
28 GTK_WINDOW_CLASS(gtk_views_window_parent_class)->move_focus(window, dir);
29 }
30 }
31
32 static void gtk_views_window_class_init(
33 GtkViewsWindowClass* views_window_class) {
34 GtkWindowClass* window_class =
35 reinterpret_cast<GtkWindowClass*>(views_window_class);
36 window_class->move_focus = gtk_views_window_move_focus;
37 }
38
39 static void gtk_views_window_init(GtkViewsWindow* window) {
40 }
41
42 GtkWidget* gtk_views_window_new(GtkWindowType type) {
43 return GTK_WIDGET(g_object_new(GTK_TYPE_VIEWS_WINDOW, "type", type, NULL));
44 }
45
46 G_END_DECLS
OLDNEW
« no previous file with comments | « ui/views/widget/gtk_views_window.h ('k') | ui/views/widget/native_widget_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698