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

Side by Side Diff: athena/util/fill_layout_manager.cc

Issue 814313002: Revert of Use template specialization to generate WindowProperty code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | « athena/screen/screen_manager_impl.cc ('k') | athena/wm/window_list_provider_impl.cc » ('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 2014 The Chromium Authors. All rights reserved. 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 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 "athena/util/fill_layout_manager.h" 5 #include "athena/util/fill_layout_manager.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/aura/window.h" 8 #include "ui/aura/window.h"
9 #include "ui/aura/window_property.h" 9 #include "ui/aura/window_property.h"
10 10
11 // This is to avoid creating type definitoin for kAlwaysFillWindowKey.
12 DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(ATHENA_EXPORT, bool);
13
11 namespace athena { 14 namespace athena {
12 namespace { 15 namespace {
13 16
14 DEFINE_LOCAL_WINDOW_PROPERTY_KEY(bool, kAlwaysFillWindowKey, false); 17 DEFINE_LOCAL_WINDOW_PROPERTY_KEY(bool, kAlwaysFillWindowKey, false);
15 18
16 // TODO(oshima): Implement real window/layout manager. crbug.com/388362. 19 // TODO(oshima): Implement real window/layout manager. crbug.com/388362.
17 bool ShouldFill(aura::Window* window) { 20 bool ShouldFill(aura::Window* window) {
18 return window->GetProperty(kAlwaysFillWindowKey) || 21 return window->GetProperty(kAlwaysFillWindowKey) ||
19 (window->type() != ui::wm::WINDOW_TYPE_MENU && 22 (window->type() != ui::wm::WINDOW_TYPE_MENU &&
20 window->type() != ui::wm::WINDOW_TYPE_TOOLTIP && 23 window->type() != ui::wm::WINDOW_TYPE_TOOLTIP &&
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 SetChildBoundsDirect(child, gfx::Rect(container_->bounds().size())); 67 SetChildBoundsDirect(child, gfx::Rect(container_->bounds().size()));
65 } 68 }
66 69
67 void FillLayoutManager::SetChildBounds(aura::Window* child, 70 void FillLayoutManager::SetChildBounds(aura::Window* child,
68 const gfx::Rect& requested_bounds) { 71 const gfx::Rect& requested_bounds) {
69 if (!ShouldFill(child)) 72 if (!ShouldFill(child))
70 SetChildBoundsDirect(child, requested_bounds); 73 SetChildBoundsDirect(child, requested_bounds);
71 } 74 }
72 75
73 } // namespace athena 76 } // namespace athena
OLDNEW
« no previous file with comments | « athena/screen/screen_manager_impl.cc ('k') | athena/wm/window_list_provider_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698