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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc

Issue 273073002: Changes code using Compositor to pass in ContextFactory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tooltip on chromeos Created 6 years, 7 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) 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 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_win.h" 5 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_win.h"
6 6
7 #include "base/win/metro.h" 7 #include "base/win/metro.h"
8 #include "third_party/skia/include/core/SkPath.h" 8 #include "third_party/skia/include/core/SkPath.h"
9 #include "third_party/skia/include/core/SkRegion.h" 9 #include "third_party/skia/include/core/SkRegion.h"
10 #include "ui/aura/client/aura_constants.h" 10 #include "ui/aura/client/aura_constants.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 return ui::NativeThemeWin::instance(); 111 return ui::NativeThemeWin::instance();
112 } 112 }
113 } 113 }
114 return ui::NativeThemeAura::instance(); 114 return ui::NativeThemeAura::instance();
115 } 115 }
116 116
117 //////////////////////////////////////////////////////////////////////////////// 117 ////////////////////////////////////////////////////////////////////////////////
118 // DesktopWindowTreeHostWin, DesktopWindowTreeHost implementation: 118 // DesktopWindowTreeHostWin, DesktopWindowTreeHost implementation:
119 119
120 void DesktopWindowTreeHostWin::Init(aura::Window* content_window, 120 void DesktopWindowTreeHostWin::Init(aura::Window* content_window,
121 const Widget::InitParams& params) { 121 const Widget::InitParams& params,
122 ui::ContextFactory* context_factory) {
122 // TODO(beng): SetInitParams(). 123 // TODO(beng): SetInitParams().
123 content_window_ = content_window; 124 content_window_ = content_window;
124 125
125 aura::client::SetAnimationHost(content_window_, this); 126 aura::client::SetAnimationHost(content_window_, this);
126 127
127 ConfigureWindowStyles(message_handler_.get(), params, 128 ConfigureWindowStyles(message_handler_.get(), params,
128 GetWidget()->widget_delegate(), 129 GetWidget()->widget_delegate(),
129 native_widget_delegate_); 130 native_widget_delegate_);
130 131
131 HWND parent_hwnd = NULL; 132 HWND parent_hwnd = NULL;
132 if (params.parent && params.parent->GetHost()) 133 if (params.parent && params.parent->GetHost())
133 parent_hwnd = params.parent->GetHost()->GetAcceleratedWidget(); 134 parent_hwnd = params.parent->GetHost()->GetAcceleratedWidget();
134 135
135 message_handler_->set_remove_standard_frame(params.remove_standard_frame); 136 message_handler_->set_remove_standard_frame(params.remove_standard_frame);
136 137
137 has_non_client_view_ = Widget::RequiresNonClientView(params.type); 138 has_non_client_view_ = Widget::RequiresNonClientView(params.type);
138 139
139 gfx::Rect pixel_bounds = gfx::win::DIPToScreenRect(params.bounds); 140 gfx::Rect pixel_bounds = gfx::win::DIPToScreenRect(params.bounds);
140 message_handler_->Init(parent_hwnd, pixel_bounds); 141 message_handler_->Init(parent_hwnd, pixel_bounds);
141 if (params.type == Widget::InitParams::TYPE_MENU) { 142 if (params.type == Widget::InitParams::TYPE_MENU) {
142 ::SetProp(GetAcceleratedWidget(), 143 ::SetProp(GetAcceleratedWidget(),
143 kForceSoftwareCompositor, 144 kForceSoftwareCompositor,
144 reinterpret_cast<HANDLE>(true)); 145 reinterpret_cast<HANDLE>(true));
145 } 146 }
146 CreateCompositor(GetAcceleratedWidget()); 147 CreateCompositor(GetAcceleratedWidget(), context_factory);
147 } 148 }
148 149
149 void DesktopWindowTreeHostWin::OnNativeWidgetCreated( 150 void DesktopWindowTreeHostWin::OnNativeWidgetCreated(
150 const Widget::InitParams& params) { 151 const Widget::InitParams& params) {
151 // The cursor is not necessarily visible when the root window is created. 152 // The cursor is not necessarily visible when the root window is created.
152 aura::client::CursorClient* cursor_client = 153 aura::client::CursorClient* cursor_client =
153 aura::client::GetCursorClient(window()); 154 aura::client::GetCursorClient(window());
154 if (cursor_client) 155 if (cursor_client)
155 is_cursor_visible_ = cursor_client->IsCursorVisible(); 156 is_cursor_visible_ = cursor_client->IsCursorVisible();
156 157
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
952 953
953 // static 954 // static
954 DesktopWindowTreeHost* DesktopWindowTreeHost::Create( 955 DesktopWindowTreeHost* DesktopWindowTreeHost::Create(
955 internal::NativeWidgetDelegate* native_widget_delegate, 956 internal::NativeWidgetDelegate* native_widget_delegate,
956 DesktopNativeWidgetAura* desktop_native_widget_aura) { 957 DesktopNativeWidgetAura* desktop_native_widget_aura) {
957 return new DesktopWindowTreeHostWin(native_widget_delegate, 958 return new DesktopWindowTreeHostWin(native_widget_delegate,
958 desktop_native_widget_aura); 959 desktop_native_widget_aura);
959 } 960 }
960 961
961 } // namespace views 962 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698