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

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

Issue 801953002: Use template specialization to generate WindowProperty code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use namespace 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
14 namespace athena { 11 namespace athena {
15 namespace { 12 namespace {
16 13
17 DEFINE_LOCAL_WINDOW_PROPERTY_KEY(bool, kAlwaysFillWindowKey, false); 14 DEFINE_LOCAL_WINDOW_PROPERTY_KEY(bool, kAlwaysFillWindowKey, false);
18 15
19 // TODO(oshima): Implement real window/layout manager. crbug.com/388362. 16 // TODO(oshima): Implement real window/layout manager. crbug.com/388362.
20 bool ShouldFill(aura::Window* window) { 17 bool ShouldFill(aura::Window* window) {
21 return window->GetProperty(kAlwaysFillWindowKey) || 18 return window->GetProperty(kAlwaysFillWindowKey) ||
22 (window->type() != ui::wm::WINDOW_TYPE_MENU && 19 (window->type() != ui::wm::WINDOW_TYPE_MENU &&
23 window->type() != ui::wm::WINDOW_TYPE_TOOLTIP && 20 window->type() != ui::wm::WINDOW_TYPE_TOOLTIP &&
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 SetChildBoundsDirect(child, gfx::Rect(container_->bounds().size())); 64 SetChildBoundsDirect(child, gfx::Rect(container_->bounds().size()));
68 } 65 }
69 66
70 void FillLayoutManager::SetChildBounds(aura::Window* child, 67 void FillLayoutManager::SetChildBounds(aura::Window* child,
71 const gfx::Rect& requested_bounds) { 68 const gfx::Rect& requested_bounds) {
72 if (!ShouldFill(child)) 69 if (!ShouldFill(child))
73 SetChildBoundsDirect(child, requested_bounds); 70 SetChildBoundsDirect(child, requested_bounds);
74 } 71 }
75 72
76 } // namespace athena 73 } // 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