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

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

Issue 6976048: views: Add OnEnabledChanged() method to View class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 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) 2011 The Chromium Authors. All rights reserved. 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 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 "ui/base/accessibility/accessibility_types.h" 10 #include "ui/base/accessibility/accessibility_types.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 } 144 }
145 145
146 NativeControlGtk::~NativeControlGtk() { 146 NativeControlGtk::~NativeControlGtk() {
147 if (native_view()) 147 if (native_view())
148 gtk_widget_destroy(native_view()); 148 gtk_widget_destroy(native_view());
149 } 149 }
150 150
151 //////////////////////////////////////////////////////////////////////////////// 151 ////////////////////////////////////////////////////////////////////////////////
152 // NativeControlGtk, View overrides: 152 // NativeControlGtk, View overrides:
153 153
154 void NativeControlGtk::SetEnabled(bool enabled) { 154 void NativeControlGtk::OnEnabledChanged(bool enabled) {
155 if (IsEnabled() != enabled) { 155 if (IsEnabled() != enabled) {
156 View::SetEnabled(enabled); 156 View::SetEnabled(enabled);
Ben Goodger (Google) 2011/05/27 16:01:21 Infinite recursion.
tfarina 2011/05/27 16:25:04 Done.
157 if (native_view()) 157 if (native_view())
158 gtk_widget_set_sensitive(native_view(), IsEnabled()); 158 gtk_widget_set_sensitive(native_view(), IsEnabled());
159 } 159 }
160 } 160 }
161 161
162 void NativeControlGtk::ViewHierarchyChanged(bool is_add, View* parent, 162 void NativeControlGtk::ViewHierarchyChanged(bool is_add, View* parent,
163 View* child) { 163 View* child) {
164 // Call the base class to hide the view if we're being removed. 164 // Call the base class to hide the view if we're being removed.
165 NativeViewHost::ViewHierarchyChanged(is_add, parent, child); 165 NativeViewHost::ViewHierarchyChanged(is_add, parent, child);
166 166
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 // options page is only based on views. 244 // options page is only based on views.
245 // NOTREACHED(); 245 // NOTREACHED();
246 NOTIMPLEMENTED(); 246 NOTIMPLEMENTED();
247 return false; 247 return false;
248 } 248 }
249 focus_manager->SetFocusedView(control->focus_view()); 249 focus_manager->SetFocusedView(control->focus_view());
250 return false; 250 return false;
251 } 251 }
252 252
253 } // namespace views 253 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698