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

Side by Side Diff: ash/mus/root_window_controller.cc

Issue 2632543003: Refactor and push window properties up to class properties. (Closed)
Patch Set: Created 3 years, 11 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 "ash/mus/root_window_controller.h" 5 #include "ash/mus/root_window_controller.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
(...skipping 23 matching lines...) Expand all
34 #include "mojo/public/cpp/bindings/type_converter.h" 34 #include "mojo/public/cpp/bindings/type_converter.h"
35 #include "services/service_manager/public/cpp/connector.h" 35 #include "services/service_manager/public/cpp/connector.h"
36 #include "services/ui/common/switches.h" 36 #include "services/ui/common/switches.h"
37 #include "services/ui/common/util.h" 37 #include "services/ui/common/util.h"
38 #include "ui/aura/client/aura_constants.h" 38 #include "ui/aura/client/aura_constants.h"
39 #include "ui/aura/mus/property_converter.h" 39 #include "ui/aura/mus/property_converter.h"
40 #include "ui/aura/mus/property_utils.h" 40 #include "ui/aura/mus/property_utils.h"
41 #include "ui/aura/mus/window_tree_client.h" 41 #include "ui/aura/mus/window_tree_client.h"
42 #include "ui/aura/mus/window_tree_host_mus.h" 42 #include "ui/aura/mus/window_tree_host_mus.h"
43 #include "ui/aura/window.h" 43 #include "ui/aura/window.h"
44 #include "ui/aura/window_property.h" 44 #include "ui/base/class_property.h"
45 #include "ui/base/ui_base_types.h" 45 #include "ui/base/ui_base_types.h"
46 #include "ui/display/display_list.h" 46 #include "ui/display/display_list.h"
47 47
48 DECLARE_WINDOW_PROPERTY_TYPE(ash::mus::RootWindowController*); 48 DECLARE_CLASS_PROPERTY_TYPE(ash::mus::RootWindowController*);
49 49
50 namespace ash { 50 namespace ash {
51 namespace mus { 51 namespace mus {
52 namespace { 52 namespace {
53 53
54 DEFINE_LOCAL_WINDOW_PROPERTY_KEY(ash::mus::RootWindowController*, 54 DEFINE_LOCAL_CLASS_PROPERTY_KEY(ash::mus::RootWindowController*,
55 kRootWindowControllerKey, 55 kRootWindowControllerKey,
56 nullptr); 56 nullptr);
57 57
58 bool IsFullscreen(aura::PropertyConverter* property_converter, 58 bool IsFullscreen(aura::PropertyConverter* property_converter,
59 const std::vector<uint8_t>& transport_data) { 59 const std::vector<uint8_t>& transport_data) {
60 using ui::mojom::WindowManager; 60 using ui::mojom::WindowManager;
61 aura::PropertyConverter::PrimitiveType show_state = 0; 61 aura::PropertyConverter::PrimitiveType show_state = 0;
62 return property_converter->GetPropertyValueFromTransportValue( 62 return property_converter->GetPropertyValueFromTransportValue(
63 WindowManager::kShowState_Property, transport_data, &show_state) && 63 WindowManager::kShowState_Property, transport_data, &show_state) &&
64 (static_cast<ui::WindowShowState>(show_state) == 64 (static_cast<ui::WindowShowState>(show_state) ==
65 ui::SHOW_STATE_FULLSCREEN); 65 ui::SHOW_STATE_FULLSCREEN);
66 } 66 }
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 } else { 234 } else {
235 width = root()->bounds().width() - 240; 235 width = root()->bounds().width() - 240;
236 height = root()->bounds().height() - 240; 236 height = root()->bounds().height() - 240;
237 } 237 }
238 return gfx::Rect(40 + (window_count_ % 4) * 40, 40 + (window_count_ % 4) * 40, 238 return gfx::Rect(40 + (window_count_ % 4) * 40, 40 + (window_count_ % 4) * 40,
239 width, height); 239 width, height);
240 } 240 }
241 241
242 } // namespace mus 242 } // namespace mus
243 } // namespace ash 243 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/non_client_frame_controller.cc ('k') | ash/mus/shadow.cc » ('j') | ui/aura/window.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698