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

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

Issue 8202026: views: Some more layer change, and add/update some tests for layers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 2 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 | « no previous file | views/view_unittest.cc » ('j') | views/widget/widget.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 if (!is_add && child == this && native_view()) { 165 if (!is_add && child == this && native_view()) {
166 Detach(); 166 Detach();
167 } else if (is_add && GetWidget() && !native_view()) { 167 } else if (is_add && GetWidget() && !native_view()) {
168 // Create the widget when we're added to a valid Widget. Many 168 // Create the widget when we're added to a valid Widget. Many
169 // controls need a parent widget to function properly. 169 // controls need a parent widget to function properly.
170 CreateNativeControl(); 170 CreateNativeControl();
171 } 171 }
172 } 172 }
173 173
174 void NativeControlGtk::VisibilityChanged(View* starting_from, bool is_visible) { 174 void NativeControlGtk::VisibilityChanged(View* starting_from, bool is_visible) {
175 if (starting_from != this)
176 return;
sadrul 2011/10/08 23:21:08 This change is to make sure chromium-os:20545 rema
175 if (!is_visible) { 177 if (!is_visible) {
176 if (native_view()) { 178 if (native_view()) {
177 // We destroy the child widget when we become invisible because of the 179 // We destroy the child widget when we become invisible because of the
178 // performance cost of maintaining widgets that aren't currently needed. 180 // performance cost of maintaining widgets that aren't currently needed.
179 Detach(); 181 Detach();
180 // Make sure that Detach destroyed the widget. 182 // Make sure that Detach destroyed the widget.
181 DCHECK(!native_view()); 183 DCHECK(!native_view());
182 } 184 }
183 } else if (!native_view()) { 185 } else if (!native_view()) {
184 if (GetWidget()) 186 if (GetWidget())
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 // options page is only based on views. 244 // options page is only based on views.
243 // NOTREACHED(); 245 // NOTREACHED();
244 NOTIMPLEMENTED(); 246 NOTIMPLEMENTED();
245 return false; 247 return false;
246 } 248 }
247 focus_manager->SetFocusedView(control->focus_view()); 249 focus_manager->SetFocusedView(control->focus_view());
248 return false; 250 return false;
249 } 251 }
250 252
251 } // namespace views 253 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | views/view_unittest.cc » ('j') | views/widget/widget.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698