OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/wm/dock/docked_window_layout_manager.h" | 5 #include "ash/wm/dock/docked_window_layout_manager.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/launcher/launcher.h" | 8 #include "ash/launcher/launcher.h" |
9 #include "ash/screen_ash.h" | 9 #include "ash/screen_ash.h" |
10 #include "ash/shelf/shelf_layout_manager.h" | 10 #include "ash/shelf/shelf_layout_manager.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 views::View* content_view = new views::View; | 75 views::View* content_view = new views::View; |
76 content_view->set_background( | 76 content_view->set_background( |
77 views::Background::CreateSolidBackground(kDockBackgroundColor)); | 77 views::Background::CreateSolidBackground(kDockBackgroundColor)); |
78 SetContentsView(content_view); | 78 SetContentsView(content_view); |
79 Hide(); | 79 Hide(); |
80 } | 80 } |
81 | 81 |
82 DISALLOW_COPY_AND_ASSIGN(DockedBackgroundWidget); | 82 DISALLOW_COPY_AND_ASSIGN(DockedBackgroundWidget); |
83 }; | 83 }; |
84 | 84 |
85 DockedWindowLayoutManager* GetDockLayoutManager(aura::Window* window, | |
86 const gfx::Point& location) { | |
87 gfx::Rect near_location(location, gfx::Size()); | |
88 aura::Window* dock = Shell::GetContainer( | |
89 wm::GetRootWindowMatching(near_location), | |
90 kShellWindowId_DockedContainer); | |
91 return static_cast<internal::DockedWindowLayoutManager*>( | |
92 dock->layout_manager()); | |
93 } | |
94 | |
95 // Returns true if a window is a popup or a transient child. | 85 // Returns true if a window is a popup or a transient child. |
96 bool IsPopupOrTransient(const aura::Window* window) { | 86 bool IsPopupOrTransient(const aura::Window* window) { |
97 return (window->type() == aura::client::WINDOW_TYPE_POPUP || | 87 return (window->type() == aura::client::WINDOW_TYPE_POPUP || |
98 window->transient_parent()); | 88 window->transient_parent()); |
99 } | 89 } |
100 | 90 |
101 // Certain windows (minimized, hidden or popups) do not matter to docking. | 91 // Certain windows (minimized, hidden or popups) do not matter to docking. |
102 bool IsUsedByLayout(const aura::Window* window) { | 92 bool IsUsedByLayout(const aura::Window* window) { |
103 return (window->IsVisible() && | 93 return (window->IsVisible() && |
104 !wm::GetWindowState(window)->IsMinimized() && | 94 !wm::GetWindowState(window)->IsMinimized() && |
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1070 void DockedWindowLayoutManager::OnKeyboardBoundsChanging( | 1060 void DockedWindowLayoutManager::OnKeyboardBoundsChanging( |
1071 const gfx::Rect& keyboard_bounds) { | 1061 const gfx::Rect& keyboard_bounds) { |
1072 // This bounds change will have caused a change to the Shelf which does not | 1062 // This bounds change will have caused a change to the Shelf which does not |
1073 // propagate automatically to this class, so manually recalculate bounds. | 1063 // propagate automatically to this class, so manually recalculate bounds. |
1074 Relayout(); | 1064 Relayout(); |
1075 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); | 1065 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); |
1076 } | 1066 } |
1077 | 1067 |
1078 } // namespace internal | 1068 } // namespace internal |
1079 } // namespace ash | 1069 } // namespace ash |
OLD | NEW |