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

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

Issue 2563783002: ui + mus: Split ContextFactory into ContextFactory(Client) and ContextFactoryPrivate (Closed)
Patch Set: Restore mash Created 4 years 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/snapshot/snapshot_aura_unittest.cc ('k') | ui/views/mus/surface_context_factory.h » ('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
(...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after
1252 } 1252 }
1253 1253
1254 void BridgedNativeWidget::CreateCompositor() { 1254 void BridgedNativeWidget::CreateCompositor() {
1255 DCHECK(!compositor_); 1255 DCHECK(!compositor_);
1256 DCHECK(!compositor_widget_); 1256 DCHECK(!compositor_widget_);
1257 DCHECK(ViewsDelegate::GetInstance()); 1257 DCHECK(ViewsDelegate::GetInstance());
1258 1258
1259 ui::ContextFactory* context_factory = 1259 ui::ContextFactory* context_factory =
1260 ViewsDelegate::GetInstance()->GetContextFactory(); 1260 ViewsDelegate::GetInstance()->GetContextFactory();
1261 DCHECK(context_factory); 1261 DCHECK(context_factory);
1262 ui::ContextFactoryPrivate* context_factory_private =
1263 ViewsDelegate::GetInstance()->GetContextFactoryPrivate();
1262 1264
1263 AddCompositorSuperview(); 1265 AddCompositorSuperview();
1264 1266
1265 compositor_widget_.reset(new ui::AcceleratedWidgetMac()); 1267 compositor_widget_.reset(new ui::AcceleratedWidgetMac());
1266 compositor_.reset( 1268 compositor_.reset(new ui::Compositor(context_factory, context_factory_private,
1267 new ui::Compositor(context_factory, GetCompositorTaskRunner())); 1269 GetCompositorTaskRunner()));
1268 compositor_->SetAcceleratedWidget(compositor_widget_->accelerated_widget()); 1270 compositor_->SetAcceleratedWidget(compositor_widget_->accelerated_widget());
1269 compositor_widget_->SetNSView(this); 1271 compositor_widget_->SetNSView(this);
1270 } 1272 }
1271 1273
1272 void BridgedNativeWidget::InitCompositor() { 1274 void BridgedNativeWidget::InitCompositor() {
1273 DCHECK(layer()); 1275 DCHECK(layer());
1274 float scale_factor = GetDeviceScaleFactorFromView(compositor_superview_); 1276 float scale_factor = GetDeviceScaleFactorFromView(compositor_superview_);
1275 gfx::Size size_in_dip = GetClientAreaSize(); 1277 gfx::Size size_in_dip = GetClientAreaSize();
1276 compositor_->SetScaleAndSize(scale_factor, 1278 compositor_->SetScaleAndSize(scale_factor,
1277 ConvertSizeToPixel(scale_factor, size_in_dip)); 1279 ConvertSizeToPixel(scale_factor, size_in_dip));
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1418 [bridged_view_ setMouseDownCanMoveWindow:draggable]; 1420 [bridged_view_ setMouseDownCanMoveWindow:draggable];
1419 // AppKit will not update its cache of mouseDownCanMoveWindow unless something 1421 // AppKit will not update its cache of mouseDownCanMoveWindow unless something
1420 // changes. Previously we tried adding an NSView and removing it, but for some 1422 // changes. Previously we tried adding an NSView and removing it, but for some
1421 // reason it required reposting the mouse-down event, and didn't always work. 1423 // reason it required reposting the mouse-down event, and didn't always work.
1422 // Calling the below seems to be an effective solution. 1424 // Calling the below seems to be an effective solution.
1423 [window_ setMovableByWindowBackground:NO]; 1425 [window_ setMovableByWindowBackground:NO];
1424 [window_ setMovableByWindowBackground:YES]; 1426 [window_ setMovableByWindowBackground:YES];
1425 } 1427 }
1426 1428
1427 } // namespace views 1429 } // namespace views
OLDNEW
« no previous file with comments | « ui/snapshot/snapshot_aura_unittest.cc ('k') | ui/views/mus/surface_context_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698