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

Side by Side Diff: views/controls/native_control_gtk.cc

Issue 3056045: Improvements to accessibility extension api support for "views":... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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 | « chrome/browser/views/chrome_views_delegate.cc ('k') | views/controls/native_control_win.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/native_control_gtk.h" 5 #include "views/controls/native_control_gtk.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "views/focus/focus_manager.h" 10 #include "views/focus/focus_manager.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 } else { 59 } else {
60 // The view becomes visible after native control is created. 60 // The view becomes visible after native control is created.
61 // Layout now. 61 // Layout now.
62 Layout(); 62 Layout();
63 } 63 }
64 } 64 }
65 65
66 void NativeControlGtk::Focus() { 66 void NativeControlGtk::Focus() {
67 DCHECK(native_view()); 67 DCHECK(native_view());
68 gtk_widget_grab_focus(native_view()); 68 gtk_widget_grab_focus(native_view());
69
70 GetParent()->NotifyAccessibilityEvent(AccessibilityTypes::EVENT_FOCUS);
69 } 71 }
70 72
71 void NativeControlGtk::NativeControlCreated(GtkWidget* native_control) { 73 void NativeControlGtk::NativeControlCreated(GtkWidget* native_control) {
72 Attach(native_control); 74 Attach(native_control);
73 75
74 // Update the newly created GtkWdigetwith any resident enabled state. 76 // Update the newly created GtkWdigetwith any resident enabled state.
75 gtk_widget_set_sensitive(native_view(), IsEnabled()); 77 gtk_widget_set_sensitive(native_view(), IsEnabled());
76 78
77 // Listen for focus change event to update the FocusManager focused view. 79 // Listen for focus change event to update the FocusManager focused view.
78 g_signal_connect(native_control, "focus-in-event", 80 g_signal_connect(native_control, "focus-in-event",
(...skipping 11 matching lines...) Expand all
90 // options page is only based on views. 92 // options page is only based on views.
91 // NOTREACHED(); 93 // NOTREACHED();
92 NOTIMPLEMENTED(); 94 NOTIMPLEMENTED();
93 return false; 95 return false;
94 } 96 }
95 focus_manager->SetFocusedView(control->focus_view()); 97 focus_manager->SetFocusedView(control->focus_view());
96 return false; 98 return false;
97 } 99 }
98 100
99 } // namespace views 101 } // namespace views
OLDNEW
« no previous file with comments | « chrome/browser/views/chrome_views_delegate.cc ('k') | views/controls/native_control_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698