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

Side by Side Diff: ui/views/cocoa/bridged_native_widget.mm

Issue 2458833003: Revert of [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/compositor/layer_unittest.cc ('k') | ui/views/view.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #import "ui/views/cocoa/bridged_native_widget.h" 5 #import "ui/views/cocoa/bridged_native_widget.h"
6 6
7 #import <objc/runtime.h> 7 #import <objc/runtime.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #import "base/mac/foundation_util.h" 12 #import "base/mac/foundation_util.h"
13 #include "base/mac/mac_util.h" 13 #include "base/mac/mac_util.h"
14 #import "base/mac/sdk_forward_declarations.h" 14 #import "base/mac/sdk_forward_declarations.h"
15 #include "base/memory/ptr_util.h"
16 #include "base/threading/thread_task_runner_handle.h" 15 #include "base/threading/thread_task_runner_handle.h"
17 #include "ui/accelerated_widget_mac/window_resize_helper_mac.h" 16 #include "ui/accelerated_widget_mac/window_resize_helper_mac.h"
18 #import "ui/base/cocoa/constrained_window/constrained_window_animation.h" 17 #import "ui/base/cocoa/constrained_window/constrained_window_animation.h"
19 #include "ui/base/hit_test.h" 18 #include "ui/base/hit_test.h"
20 #include "ui/base/ime/input_method.h" 19 #include "ui/base/ime/input_method.h"
21 #include "ui/base/ime/input_method_factory.h" 20 #include "ui/base/ime/input_method_factory.h"
22 #include "ui/display/display.h" 21 #include "ui/display/display.h"
23 #include "ui/display/screen.h" 22 #include "ui/display/screen.h"
24 #include "ui/gfx/geometry/dip_util.h" 23 #include "ui/gfx/geometry/dip_util.h"
25 #import "ui/gfx/mac/coordinate_conversion.h" 24 #import "ui/gfx/mac/coordinate_conversion.h"
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after
970 } 969 }
971 970
972 void BridgedNativeWidget::CreateLayer(ui::LayerType layer_type, 971 void BridgedNativeWidget::CreateLayer(ui::LayerType layer_type,
973 bool translucent) { 972 bool translucent) {
974 DCHECK(bridged_view_); 973 DCHECK(bridged_view_);
975 DCHECK(!layer()); 974 DCHECK(!layer());
976 975
977 CreateCompositor(); 976 CreateCompositor();
978 DCHECK(compositor_); 977 DCHECK(compositor_);
979 978
980 SetLayer(base::MakeUnique<ui::Layer>(layer_type)); 979 SetLayer(new ui::Layer(layer_type));
981 // Note, except for controls, this will set the layer to be hidden, since it 980 // Note, except for controls, this will set the layer to be hidden, since it
982 // is only called during Init(). 981 // is only called during Init().
983 layer()->SetVisible(window_visible_); 982 layer()->SetVisible(window_visible_);
984 layer()->set_delegate(this); 983 layer()->set_delegate(this);
985 984
986 InitCompositor(); 985 InitCompositor();
987 986
988 // Transparent window support. 987 // Transparent window support.
989 layer()->GetCompositor()->SetHostHasTransparentBackground(translucent); 988 layer()->GetCompositor()->SetHostHasTransparentBackground(translucent);
990 layer()->SetFillsBoundsOpaquely(!translucent); 989 layer()->SetFillsBoundsOpaquely(!translucent);
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
1393 [bridged_view_ setMouseDownCanMoveWindow:draggable]; 1392 [bridged_view_ setMouseDownCanMoveWindow:draggable];
1394 // AppKit will not update its cache of mouseDownCanMoveWindow unless something 1393 // AppKit will not update its cache of mouseDownCanMoveWindow unless something
1395 // changes. Previously we tried adding an NSView and removing it, but for some 1394 // changes. Previously we tried adding an NSView and removing it, but for some
1396 // reason it required reposting the mouse-down event, and didn't always work. 1395 // reason it required reposting the mouse-down event, and didn't always work.
1397 // Calling the below seems to be an effective solution. 1396 // Calling the below seems to be an effective solution.
1398 [window_ setMovableByWindowBackground:NO]; 1397 [window_ setMovableByWindowBackground:NO];
1399 [window_ setMovableByWindowBackground:YES]; 1398 [window_ setMovableByWindowBackground:YES];
1400 } 1399 }
1401 1400
1402 } // namespace views 1401 } // namespace views
OLDNEW
« no previous file with comments | « ui/compositor/layer_unittest.cc ('k') | ui/views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698