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

Side by Side Diff: ash/wm/aura/wm_root_window_controller_aura.cc

Issue 1890713002: Adds WmWindow and converts WindowState to use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge again Created 4 years, 8 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 | « ash/wm/aura/wm_root_window_controller_aura.h ('k') | ash/wm/aura/wm_window_aura.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 2016 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 "ash/wm/aura/wm_root_window_controller_aura.h"
6
7 #include "ash/root_window_controller.h"
8 #include "ui/aura/window.h"
9 #include "ui/aura/window_property.h"
10
11 DECLARE_WINDOW_PROPERTY_TYPE(ash::wm::WmRootWindowControllerAura*);
12
13 namespace ash {
14 namespace wm {
15
16 // TODO(sky): it likely makes more sense to hang this off RootWindowSettings.
17 DEFINE_OWNED_WINDOW_PROPERTY_KEY(ash::wm::WmRootWindowControllerAura,
18 kWmRootWindowControllerKey,
19 nullptr);
20
21 WmRootWindowControllerAura::WmRootWindowControllerAura(
22 RootWindowController* root_window_controller)
23 : root_window_controller_(root_window_controller) {
24 root_window_controller_->GetRootWindow()->SetProperty(
25 kWmRootWindowControllerKey, this);
26 }
27
28 WmRootWindowControllerAura::~WmRootWindowControllerAura() {}
29
30 // static
31 const WmRootWindowControllerAura* WmRootWindowControllerAura::Get(
32 const aura::Window* window) {
33 if (!window)
34 return nullptr;
35
36 RootWindowController* root_window_controller =
37 GetRootWindowController(window);
38 if (!root_window_controller)
39 return nullptr;
40
41 WmRootWindowControllerAura* wm_root_window_controller =
42 root_window_controller->GetRootWindow()->GetProperty(
43 kWmRootWindowControllerKey);
44 if (wm_root_window_controller)
45 return wm_root_window_controller;
46
47 // WmRootWindowControllerAura is owned by the RootWindowController's window.
48 return new WmRootWindowControllerAura(root_window_controller);
49 }
50
51 bool WmRootWindowControllerAura::HasShelf() {
52 return root_window_controller_->shelf() != nullptr;
53 }
54
55 } // namespace wm
56 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/aura/wm_root_window_controller_aura.h ('k') | ash/wm/aura/wm_window_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698