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

Side by Side Diff: ash/shell/window_watcher.cc

Issue 1157843009: Added wm::IsWindowUserPositionable(...) method in window_util.h. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated callsites to use WindowState::IsUserPositionable(). Created 5 years, 6 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
« no previous file with comments | « ash/root_window_controller.cc ('k') | ash/wm/default_state.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) 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/window_watcher.h" 5 #include "ash/shell/window_watcher.h"
6 6
7 #include "ash/display/display_controller.h" 7 #include "ash/display/display_controller.h"
8 #include "ash/shelf/shelf.h" 8 #include "ash/shelf/shelf.h"
9 #include "ash/shelf/shelf_item_delegate_manager.h" 9 #include "ash/shelf/shelf_item_delegate_manager.h"
10 #include "ash/shelf/shelf_model.h" 10 #include "ash/shelf/shelf_model.h"
11 #include "ash/shelf/shelf_util.h" 11 #include "ash/shelf/shelf_util.h"
12 #include "ash/shelf/shelf_widget.h" 12 #include "ash/shelf/shelf_widget.h"
13 #include "ash/shell.h" 13 #include "ash/shell.h"
14 #include "ash/shell/window_watcher_shelf_item_delegate.h" 14 #include "ash/shell/window_watcher_shelf_item_delegate.h"
15 #include "ash/shell_window_ids.h" 15 #include "ash/shell_window_ids.h"
16 #include "ash/wm/window_util.h"
16 #include "ui/aura/window.h" 17 #include "ui/aura/window.h"
17 #include "ui/aura/window_event_dispatcher.h" 18 #include "ui/aura/window_event_dispatcher.h"
18 #include "ui/gfx/display.h" 19 #include "ui/gfx/display.h"
19 20
20 namespace ash { 21 namespace ash {
21 namespace shell { 22 namespace shell {
22 23
23 class WindowWatcher::WorkspaceWindowWatcher : public aura::WindowObserver { 24 class WindowWatcher::WorkspaceWindowWatcher : public aura::WindowObserver {
24 public: 25 public:
25 explicit WorkspaceWindowWatcher(WindowWatcher* watcher) : watcher_(watcher) { 26 explicit WorkspaceWindowWatcher(WindowWatcher* watcher) : watcher_(watcher) {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 84 }
84 } 85 }
85 86
86 aura::Window* WindowWatcher::GetWindowByID(ash::ShelfID id) { 87 aura::Window* WindowWatcher::GetWindowByID(ash::ShelfID id) {
87 IDToWindow::const_iterator i = id_to_window_.find(id); 88 IDToWindow::const_iterator i = id_to_window_.find(id);
88 return i != id_to_window_.end() ? i->second : NULL; 89 return i != id_to_window_.end() ? i->second : NULL;
89 } 90 }
90 91
91 // aura::WindowObserver overrides: 92 // aura::WindowObserver overrides:
92 void WindowWatcher::OnWindowAdded(aura::Window* new_window) { 93 void WindowWatcher::OnWindowAdded(aura::Window* new_window) {
93 if (new_window->type() != ui::wm::WINDOW_TYPE_NORMAL && 94 if (!wm::IsWindowUserPositionable(new_window))
94 new_window->type() != ui::wm::WINDOW_TYPE_PANEL)
95 return; 95 return;
96 96
97 static int image_count = 0; 97 static int image_count = 0;
98 ShelfModel* model = Shell::GetInstance()->shelf_model(); 98 ShelfModel* model = Shell::GetInstance()->shelf_model();
99 ShelfItem item; 99 ShelfItem item;
100 item.type = new_window->type() == ui::wm::WINDOW_TYPE_PANEL 100 item.type = new_window->type() == ui::wm::WINDOW_TYPE_PANEL
101 ? ash::TYPE_APP_PANEL 101 ? ash::TYPE_APP_PANEL
102 : ash::TYPE_PLATFORM_APP; 102 : ash::TYPE_PLATFORM_APP;
103 ash::ShelfID id = model->next_id(); 103 ash::ShelfID id = model->next_id();
104 id_to_window_[id] = new_window; 104 id_to_window_[id] = new_window;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 void WindowWatcher::OnDisplayRemoved(const gfx::Display& old_display) { 145 void WindowWatcher::OnDisplayRemoved(const gfx::Display& old_display) {
146 // All windows in the display has already been removed, so no need to 146 // All windows in the display has already been removed, so no need to
147 // remove observers. 147 // remove observers.
148 } 148 }
149 149
150 void WindowWatcher::OnDisplayMetricsChanged(const gfx::Display&, uint32_t) { 150 void WindowWatcher::OnDisplayMetricsChanged(const gfx::Display&, uint32_t) {
151 } 151 }
152 152
153 } // namespace shell 153 } // namespace shell
154 } // namespace ash 154 } // namespace ash
OLDNEW
« no previous file with comments | « ash/root_window_controller.cc ('k') | ash/wm/default_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698