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

Side by Side Diff: ui/aura_shell/toplevel_layout_manager.cc

Issue 8968022: Shell related switches -> aura shell switches. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 | Annotate | Revision Log
« no previous file with comments | « ui/aura_shell/tooltip_controller.cc ('k') | ui/aura_shell/toplevel_layout_manager_unittest.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ui/aura_shell/toplevel_layout_manager.h" 5 #include "ui/aura_shell/toplevel_layout_manager.h"
6 6
7 #include "ui/aura/client/aura_constants.h" 7 #include "ui/aura/client/aura_constants.h"
8 #include "ui/aura/window.h" 8 #include "ui/aura/window.h"
9 #include "ui/aura_shell/shelf_layout_manager.h" 9 #include "ui/aura_shell/shelf_layout_manager.h"
10 #include "ui/aura_shell/window_util.h" 10 #include "ui/aura_shell/window_util.h"
(...skipping 10 matching lines...) Expand all
21 for (Windows::const_iterator i = windows_.begin(); i != windows_.end(); ++i) 21 for (Windows::const_iterator i = windows_.begin(); i != windows_.end(); ++i)
22 (*i)->RemoveObserver(this); 22 (*i)->RemoveObserver(this);
23 } 23 }
24 24
25 void ToplevelLayoutManager::OnWindowResized() { 25 void ToplevelLayoutManager::OnWindowResized() {
26 } 26 }
27 27
28 void ToplevelLayoutManager::OnWindowAddedToLayout(aura::Window* child) { 28 void ToplevelLayoutManager::OnWindowAddedToLayout(aura::Window* child) {
29 windows_.insert(child); 29 windows_.insert(child);
30 child->AddObserver(this); 30 child->AddObserver(this);
31 if (child->GetProperty(aura::kShowStateKey)) { 31 if (child->GetProperty(aura::client::kShowStateKey)) {
32 UpdateBoundsFromShowState(child); 32 UpdateBoundsFromShowState(child);
33 UpdateShelfVisibility(); 33 UpdateShelfVisibility();
34 } 34 }
35 } 35 }
36 36
37 void ToplevelLayoutManager::OnWillRemoveWindowFromLayout( 37 void ToplevelLayoutManager::OnWillRemoveWindowFromLayout(
38 aura::Window* child) { 38 aura::Window* child) {
39 windows_.erase(child); 39 windows_.erase(child);
40 child->RemoveObserver(this); 40 child->RemoveObserver(this);
41 UpdateShelfVisibility(); 41 UpdateShelfVisibility();
(...skipping 12 matching lines...) Expand all
54 if (child_bounds.y() < 0) 54 if (child_bounds.y() < 0)
55 child_bounds.set_y(0); 55 child_bounds.set_y(0);
56 else if (child_bounds.y() + kTitleHeight > work_area.bottom()) 56 else if (child_bounds.y() + kTitleHeight > work_area.bottom())
57 child_bounds.set_y(work_area.bottom() - kTitleHeight); 57 child_bounds.set_y(work_area.bottom() - kTitleHeight);
58 SetChildBoundsDirect(child, child_bounds); 58 SetChildBoundsDirect(child, child_bounds);
59 } 59 }
60 60
61 void ToplevelLayoutManager::OnWindowPropertyChanged(aura::Window* window, 61 void ToplevelLayoutManager::OnWindowPropertyChanged(aura::Window* window,
62 const char* name, 62 const char* name,
63 void* old) { 63 void* old) {
64 if (name == aura::kShowStateKey) { 64 if (name == aura::client::kShowStateKey) {
65 UpdateBoundsFromShowState(window); 65 UpdateBoundsFromShowState(window);
66 UpdateShelfVisibility(); 66 UpdateShelfVisibility();
67 } 67 }
68 } 68 }
69 69
70 void ToplevelLayoutManager::UpdateShelfVisibility() { 70 void ToplevelLayoutManager::UpdateShelfVisibility() {
71 if (!shelf_) 71 if (!shelf_)
72 return; 72 return;
73 73
74 bool has_fullscreen_window = false; 74 bool has_fullscreen_window = false;
75 for (Windows::const_iterator i = windows_.begin(); i != windows_.end(); ++i) { 75 for (Windows::const_iterator i = windows_.begin(); i != windows_.end(); ++i) {
76 if ((*i)->GetIntProperty(aura::kShowStateKey) == 76 if ((*i)->GetIntProperty(aura::client::kShowStateKey) ==
77 ui::SHOW_STATE_FULLSCREEN) { 77 ui::SHOW_STATE_FULLSCREEN) {
78 has_fullscreen_window = true; 78 has_fullscreen_window = true;
79 break; 79 break;
80 } 80 }
81 } 81 }
82 shelf_->SetVisible(!has_fullscreen_window); 82 shelf_->SetVisible(!has_fullscreen_window);
83 } 83 }
84 84
85 } // namespace internal 85 } // namespace internal
86 } // namespace aura_shell 86 } // namespace aura_shell
OLDNEW
« no previous file with comments | « ui/aura_shell/tooltip_controller.cc ('k') | ui/aura_shell/toplevel_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698