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

Side by Side Diff: ui/views/view.cc

Issue 2459653003: [M55] Generalize layer mirroring for phantom windows (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « ui/views/cocoa/bridged_native_widget.mm ('k') | ui/views/view_unittest_aura.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) 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 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. 5 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first.
6 6
7 #include "ui/views/view.h" 7 #include "ui/views/view.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 2065 matching lines...) Expand 10 before | Expand all | Expand 10 after
2076 } 2076 }
2077 2077
2078 // Accelerated painting -------------------------------------------------------- 2078 // Accelerated painting --------------------------------------------------------
2079 2079
2080 void View::CreateLayer() { 2080 void View::CreateLayer() {
2081 // A new layer is being created for the view. So all the layers of the 2081 // A new layer is being created for the view. So all the layers of the
2082 // sub-tree can inherit the visibility of the corresponding view. 2082 // sub-tree can inherit the visibility of the corresponding view.
2083 for (int i = 0, count = child_count(); i < count; ++i) 2083 for (int i = 0, count = child_count(); i < count; ++i)
2084 child_at(i)->UpdateChildLayerVisibility(true); 2084 child_at(i)->UpdateChildLayerVisibility(true);
2085 2085
2086 SetLayer(new ui::Layer()); 2086 SetLayer(base::MakeUnique<ui::Layer>());
2087 layer()->set_delegate(this); 2087 layer()->set_delegate(this);
2088 layer()->set_name(GetClassName()); 2088 layer()->set_name(GetClassName());
2089 2089
2090 UpdateParentLayers(); 2090 UpdateParentLayers();
2091 UpdateLayerVisibility(); 2091 UpdateLayerVisibility();
2092 2092
2093 // The new layer needs to be ordered in the layer tree according 2093 // The new layer needs to be ordered in the layer tree according
2094 // to the view tree. Children of this layer were added in order 2094 // to the view tree. Children of this layer were added in order
2095 // in UpdateParentLayers(). 2095 // in UpdateParentLayers().
2096 if (parent()) 2096 if (parent())
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
2422 // Message the RootView to do the drag and drop. That way if we're removed 2422 // Message the RootView to do the drag and drop. That way if we're removed
2423 // the RootView can detect it and avoid calling us back. 2423 // the RootView can detect it and avoid calling us back.
2424 gfx::Point widget_location(event.location()); 2424 gfx::Point widget_location(event.location());
2425 ConvertPointToWidget(this, &widget_location); 2425 ConvertPointToWidget(this, &widget_location);
2426 widget->RunShellDrag(this, data, widget_location, drag_operations, source); 2426 widget->RunShellDrag(this, data, widget_location, drag_operations, source);
2427 // WARNING: we may have been deleted. 2427 // WARNING: we may have been deleted.
2428 return true; 2428 return true;
2429 } 2429 }
2430 2430
2431 } // namespace views 2431 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/cocoa/bridged_native_widget.mm ('k') | ui/views/view_unittest_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698