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

Side by Side Diff: wm/foreign_window_widget.cc

Issue 11485006: Add window manager component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Push gfx::AcceleratedWidget usage into platform specific code. Created 7 years, 9 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 | « wm/foreign_window_widget.h ('k') | wm/gpu/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "wm/foreign_window_widget.h"
6
7 #include "ash/shell.h"
8 #include "ash/wm/property_util.h"
9 #include "ui/aura/root_window.h"
10 #include "ui/aura/window.h"
11 #include "ui/gfx/canvas.h"
12 #include "ui/views/widget/widget.h"
13 #include "ui/views/widget/widget_delegate.h"
14 #include "wm/foreign_window.h"
15
16 namespace wm {
17
18 ForeignWindowWidget::ForeignWindowWidget(ForeignWindow* foreign_window)
19 : foreign_window_(foreign_window) {
20 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
21 params.delegate = foreign_window->CreateWidgetDelegate();
22 // TODO(reveman): Add support for multiple root windows.
23 params.context = ash::Shell::GetAllRootWindows()[0];
24 Init(params);
25 set_focus_on_creation(false);
26 GetNativeView()->SetName("ForeignWindowWidget");
27 SetPersistsAcrossAllWorkspaces(
28 GetNativeView(),
29 ash::WINDOW_PERSISTS_ACROSS_ALL_WORKSPACES_VALUE_YES);
30 }
31
32 ForeignWindowWidget::~ForeignWindowWidget() {
33 }
34
35 void ForeignWindowWidget::Close() {
36 // Call base class Close() when native window has been destroyed.
37 if (foreign_window_->HasBeenDestroyed()) {
38 views::Widget::Close();
39 return;
40 }
41
42 foreign_window_->Close();
43 }
44
45 // static
46 views::Widget* ForeignWindowWidget::CreateWindow(
47 ForeignWindow* foreign_window) {
48 return new ForeignWindowWidget(foreign_window);
49 }
50
51 } // namespace wm
OLDNEW
« no previous file with comments | « wm/foreign_window_widget.h ('k') | wm/gpu/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698