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

Side by Side Diff: mash/wm/property_util.cc

Issue 1492323003: Updates shadow when active window changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 5 years 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 | « mash/wm/property_util.h ('k') | mash/wm/shadow_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "mash/wm/property_util.h" 5 #include "mash/wm/property_util.h"
6 6
7 #include "components/mus/public/cpp/property_type_converters.h" 7 #include "components/mus/public/cpp/property_type_converters.h"
8 #include "components/mus/public/cpp/window.h" 8 #include "components/mus/public/cpp/window.h"
9 #include "components/mus/public/cpp/window_property.h" 9 #include "components/mus/public/cpp/window_property.h"
10 #include "mash/wm/shadow.h"
10 #include "ui/gfx/geometry/rect.h" 11 #include "ui/gfx/geometry/rect.h"
11 #include "ui/gfx/geometry/size.h" 12 #include "ui/gfx/geometry/size.h"
12 13
13 namespace mash { 14 namespace mash {
14 namespace wm { 15 namespace wm {
16 namespace {
17
18 DEFINE_LOCAL_WINDOW_PROPERTY_KEY(Shadow*, kLocalShadowProperty, nullptr);
19
20 } // namespace
15 21
16 mus::mojom::ShowState GetWindowShowState(const mus::Window* window) { 22 mus::mojom::ShowState GetWindowShowState(const mus::Window* window) {
17 if (window->HasSharedProperty( 23 if (window->HasSharedProperty(
18 mus::mojom::WindowManager::kShowState_Property)) { 24 mus::mojom::WindowManager::kShowState_Property)) {
19 return static_cast<mus::mojom::ShowState>( 25 return static_cast<mus::mojom::ShowState>(
20 window->GetSharedProperty<int32_t>( 26 window->GetSharedProperty<int32_t>(
21 mus::mojom::WindowManager::kShowState_Property)); 27 mus::mojom::WindowManager::kShowState_Property));
22 } 28 }
23 return mus::mojom::SHOW_STATE_RESTORED; 29 return mus::mojom::SHOW_STATE_RESTORED;
24 } 30 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 87
82 gfx::Rect GetRestoreBounds(const mus::Window* window) { 88 gfx::Rect GetRestoreBounds(const mus::Window* window) {
83 if (window->HasSharedProperty( 89 if (window->HasSharedProperty(
84 mus::mojom::WindowManager::kRestoreBounds_Property)) { 90 mus::mojom::WindowManager::kRestoreBounds_Property)) {
85 return window->GetSharedProperty<gfx::Rect>( 91 return window->GetSharedProperty<gfx::Rect>(
86 mus::mojom::WindowManager::kRestoreBounds_Property); 92 mus::mojom::WindowManager::kRestoreBounds_Property);
87 } 93 }
88 return gfx::Rect(); 94 return gfx::Rect();
89 } 95 }
90 96
97 void SetShadow(mus::Window* window, Shadow* shadow) {
98 window->SetLocalProperty(kLocalShadowProperty, shadow);
99 }
100
101 Shadow* GetShadow(mus::Window* window) {
102 return window->GetLocalProperty(kLocalShadowProperty);
103 }
104
91 } // namespace wm 105 } // namespace wm
92 } // namespace mash 106 } // namespace mash
OLDNEW
« no previous file with comments | « mash/wm/property_util.h ('k') | mash/wm/shadow_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698