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

Side by Side Diff: ash/shell.cc

Issue 9808026: Layout panels on top of their launcher icons (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CR feedback Created 8 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/shell.h" 5 #include "ash/shell.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/app_list/app_list.h" 9 #include "ash/app_list/app_list.h"
10 #include "ash/ash_switches.h" 10 #include "ash/ash_switches.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 SetChildWindowVisibilityChangesAnimated(default_container); 152 SetChildWindowVisibilityChangesAnimated(default_container);
153 153
154 aura::Window* always_on_top_container = CreateContainer( 154 aura::Window* always_on_top_container = CreateContainer(
155 internal::kShellWindowId_AlwaysOnTopContainer, 155 internal::kShellWindowId_AlwaysOnTopContainer,
156 "AlwaysOnTopContainer", 156 "AlwaysOnTopContainer",
157 non_lock_screen_containers); 157 non_lock_screen_containers);
158 always_on_top_container->SetEventFilter( 158 always_on_top_container->SetEventFilter(
159 new ToplevelWindowEventFilter(always_on_top_container)); 159 new ToplevelWindowEventFilter(always_on_top_container));
160 SetChildWindowVisibilityChangesAnimated(always_on_top_container); 160 SetChildWindowVisibilityChangesAnimated(always_on_top_container);
161 161
162 aura::Window* panel_container = CreateContainer( 162 CreateContainer(internal::kShellWindowId_PanelContainer,
163 internal::kShellWindowId_PanelContainer, 163 "PanelContainer",
164 "PanelContainer", 164 non_lock_screen_containers);
165 non_lock_screen_containers);
166 if (CommandLine::ForCurrentProcess()->
167 HasSwitch(switches::kAuraPanelManager)) {
168 internal::PanelLayoutManager* layout_manager =
169 new internal::PanelLayoutManager(panel_container);
170 panel_container->SetEventFilter(
171 new internal::PanelWindowEventFilter(panel_container, layout_manager));
172 panel_container->SetLayoutManager(layout_manager);
173 }
174 165
175 CreateContainer(internal::kShellWindowId_AppListContainer, 166 CreateContainer(internal::kShellWindowId_AppListContainer,
176 "AppListContainer", 167 "AppListContainer",
177 non_lock_screen_containers); 168 non_lock_screen_containers);
178 169
179 CreateContainer(internal::kShellWindowId_LauncherContainer, 170 CreateContainer(internal::kShellWindowId_LauncherContainer,
180 "LauncherContainer", 171 "LauncherContainer",
181 non_lock_screen_containers); 172 non_lock_screen_containers);
182 173
183 aura::Window* modal_container = CreateContainer( 174 aura::Window* modal_container = CreateContainer(
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
846 void Shell::CreateLauncher() { 837 void Shell::CreateLauncher() {
847 if (launcher_.get()) 838 if (launcher_.get())
848 return; 839 return;
849 840
850 aura::Window* default_container = 841 aura::Window* default_container =
851 GetContainer(internal::kShellWindowId_DefaultContainer); 842 GetContainer(internal::kShellWindowId_DefaultContainer);
852 launcher_.reset(new Launcher(default_container)); 843 launcher_.reset(new Launcher(default_container));
853 844
854 launcher_->SetFocusCycler(focus_cycler_.get()); 845 launcher_->SetFocusCycler(focus_cycler_.get());
855 shelf_->SetLauncher(launcher_.get()); 846 shelf_->SetLauncher(launcher_.get());
847 if (panel_layout_manager_ != NULL)
848 panel_layout_manager_->SetLauncher(launcher_.get());
856 849
857 launcher_->widget()->Show(); 850 launcher_->widget()->Show();
858 } 851 }
859 852
860 void Shell::AddShellObserver(ShellObserver* observer) { 853 void Shell::AddShellObserver(ShellObserver* observer) {
861 observers_.AddObserver(observer); 854 observers_.AddObserver(observer);
862 } 855 }
863 856
864 void Shell::RemoveShellObserver(ShellObserver* observer) { 857 void Shell::RemoveShellObserver(ShellObserver* observer) {
865 observers_.RemoveObserver(observer); 858 observers_.RemoveObserver(observer);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 always_on_top_container->SetLayoutManager( 906 always_on_top_container->SetLayoutManager(
914 new internal::AlwaysOnTopLayoutManager( 907 new internal::AlwaysOnTopLayoutManager(
915 always_on_top_container->GetRootWindow())); 908 always_on_top_container->GetRootWindow()));
916 909
917 // Create desktop background widget. 910 // Create desktop background widget.
918 // TODO(bshe): We should be able to use OnDesktopBackgroundChanged function 911 // TODO(bshe): We should be able to use OnDesktopBackgroundChanged function
919 // here after issue 117244 got fixed. 912 // here after issue 117244 got fixed.
920 int index = user_wallpaper_delegate_->GetUserWallpaperIndex(); 913 int index = user_wallpaper_delegate_->GetUserWallpaperIndex();
921 desktop_background_controller_->SetDesktopBackgroundImageMode( 914 desktop_background_controller_->SetDesktopBackgroundImageMode(
922 GetWallpaper(index), GetWallpaperInfo(index).layout); 915 GetWallpaper(index), GetWallpaperInfo(index).layout);
916
917 // Create Panel layout manager
918 if (CommandLine::ForCurrentProcess()->
919 HasSwitch(switches::kAuraPanelManager)) {
920 aura::Window* panel_container = GetContainer(
921 internal::kShellWindowId_PanelContainer);
922 panel_layout_manager_ =
923 new internal::PanelLayoutManager(panel_container);
924 panel_container->SetEventFilter(
925 new internal::PanelWindowEventFilter(
926 panel_container, panel_layout_manager_));
927 panel_container->SetLayoutManager(panel_layout_manager_);
928 }
923 } 929 }
924 930
925 void Shell::DisableWorkspaceGridLayout() { 931 void Shell::DisableWorkspaceGridLayout() {
926 if (workspace_controller_.get()) 932 if (workspace_controller_.get())
927 workspace_controller_->workspace_manager()->set_grid_size(0); 933 workspace_controller_->workspace_manager()->set_grid_size(0);
928 } 934 }
929 935
930 } // namespace ash 936 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698