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

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: Rebase and add proper use_wm flag support Created 7 years, 10 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
(Empty)
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
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* window)
19 : window_(window) {
20 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
21 params.delegate = window->CreateWidgetDelegate();
22 params.context = ash::Shell::GetAllRootWindows()[0];
danakj 2013/02/21 01:33:15 this is going to break on dual-head isn't it? shal
reveman 2013/02/22 01:26:44 Yes, last time I touched this code ash::Shell::Get
23 Init(params);
24 set_focus_on_creation(false);
25 GetNativeView()->SetName("ForeignWindowWidget");
26 SetPersistsAcrossAllWorkspaces(
danakj 2013/02/21 01:33:15 curious, what happens if we don't set persists acr
reveman 2013/02/22 01:26:44 you probably get parts of the screen where input d
27 GetNativeView(),
28 ash::WINDOW_PERSISTS_ACROSS_ALL_WORKSPACES_VALUE_YES);
29 }
30
31 ForeignWindowWidget::~ForeignWindowWidget() {
32 }
33
34 void ForeignWindowWidget::Close() {
35 // Call base class Close() when native window has been destroyed.
36 if (window_->HasBeenDestroyed()) {
37 views::Widget::Close();
38 return;
39 }
40
41 window_->Close();
42 }
43
44 // static
45 views::Widget* ForeignWindowWidget::CreateWindow(ForeignWindow* window) {
46 return new ForeignWindowWidget(window);
47 }
48
49 } // namespace wm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698