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

Side by Side Diff: athena/test/base/test_windows.cc

Issue 662763002: Support modal windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: fix leaks Created 6 years, 2 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
« no previous file with comments | « athena/test/base/test_windows.h ('k') | athena/util/container_priorities.h » ('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 2014 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 "athena/test/base/test_windows.h"
6
7 #include "athena/screen/public/screen_manager.h"
8 #include "ui/aura/client/aura_constants.h"
9 #include "ui/aura/client/window_tree_client.h"
10 #include "ui/aura/window.h"
11 #include "ui/wm/core/window_util.h"
12
13 namespace athena {
14 namespace test {
15
16 scoped_ptr<aura::Window> CreateNormalWindow(aura::WindowDelegate* delegate,
17 aura::Window* parent) {
18 return CreateWindowWithType(delegate, parent, ui::wm::WINDOW_TYPE_NORMAL);
19 }
20
21 scoped_ptr<aura::Window> CreateWindowWithType(aura::WindowDelegate* delegate,
22 aura::Window* parent,
23 ui::wm::WindowType window_type) {
24 scoped_ptr<aura::Window> window(new aura::Window(delegate));
25 window->SetType(window_type);
26 window->Init(aura::WINDOW_LAYER_SOLID_COLOR);
27 if (parent) {
28 parent->AddChild(window.get());
29 } else {
30 aura::client::ParentWindowWithContext(
31 window.get(), ScreenManager::Get()->GetContext(), gfx::Rect());
32 }
33 return window.Pass();
34 }
35
36 scoped_ptr<aura::Window> CreateTransientWindow(aura::WindowDelegate* delegate,
37 aura::Window* transient_parent,
38 ui::ModalType modal_type,
39 bool top_most) {
40 scoped_ptr<aura::Window> window(new aura::Window(delegate));
41 window->SetType(ui::wm::WINDOW_TYPE_NORMAL);
42 window->Init(aura::WINDOW_LAYER_SOLID_COLOR);
43 window->SetProperty(aura::client::kModalKey, modal_type);
44 window->SetProperty(aura::client::kAlwaysOnTopKey, top_most);
45 if (transient_parent)
46 wm::AddTransientChild(transient_parent, window.get());
47 aura::client::ParentWindowWithContext(
48 window.get(), ScreenManager::Get()->GetContext(), gfx::Rect());
49 return window.Pass();
50 }
51
52 } // namespace test
53 } // namespace athena
OLDNEW
« no previous file with comments | « athena/test/base/test_windows.h ('k') | athena/util/container_priorities.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698