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

Unified Diff: ash/wm/overview/window_overview.cc

Issue 23654037: Add panels as a single group of windows per display for overview window cycling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix restored panel relayout when some panels minimized. Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/overview/window_overview.h ('k') | ash/wm/overview/window_selector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/overview/window_overview.cc
diff --git a/ash/wm/overview/window_overview.cc b/ash/wm/overview/window_overview.cc
index ea139a2b48dadcaaf0da63c1ab7f4c2a185349e4..3411c76c18c1e8f14f284148ae7417e077e6a38f 100644
--- a/ash/wm/overview/window_overview.cc
+++ b/ash/wm/overview/window_overview.cc
@@ -10,7 +10,7 @@
#include "ash/shell.h"
#include "ash/shell_window_ids.h"
#include "ash/wm/overview/window_selector.h"
-#include "ash/wm/overview/window_selector_window.h"
+#include "ash/wm/overview/window_selector_item.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
@@ -31,14 +31,14 @@ const float kWindowOverviewSelectionOpacity = 0.5f;
const int kWindowOverviewSelectionPadding = 15;
// A comparator for locating a given target window.
-struct WindowSelectorWindowComparator
- : public std::unary_function<WindowSelectorWindow*, bool> {
- explicit WindowSelectorWindowComparator(const aura::Window* target_window)
+struct WindowSelectorItemComparator
+ : public std::unary_function<WindowSelectorItem*, bool> {
+ explicit WindowSelectorItemComparator(const aura::Window* target_window)
: target(target_window) {
}
- bool operator()(const WindowSelectorWindow* window) const {
- return target == window->window();
+ bool operator()(const WindowSelectorItem* window) const {
+ return window->TargetedWindow(target) != NULL;
}
const aura::Window* target;
@@ -47,7 +47,7 @@ struct WindowSelectorWindowComparator
} // namespace
WindowOverview::WindowOverview(WindowSelector* window_selector,
- WindowSelectorWindowList* windows,
+ WindowSelectorItemList* windows,
aura::RootWindow* single_root_window)
: window_selector_(window_selector),
windows_(windows),
@@ -89,9 +89,9 @@ void WindowOverview::OnEvent(ui::Event* event) {
// If the event is targetted at any of the windows in the overview, then
// prevent it from propagating.
aura::Window* target = static_cast<aura::Window*>(event->target());
- for (WindowSelectorWindowList::iterator iter = windows_->begin();
+ for (WindowSelectorItemList::iterator iter = windows_->begin();
iter != windows_->end(); ++iter) {
- if ((*iter)->Contains(target)) {
+ if ((*iter)->TargetedWindow(target)) {
// TODO(flackr): StopPropogation prevents generation of gesture events.
// We should find a better way to prevent events from being delivered to
// the window, perhaps a transparent window in front of the target window
@@ -116,24 +116,24 @@ void WindowOverview::OnKeyEvent(ui::KeyEvent* event) {
void WindowOverview::OnMouseEvent(ui::MouseEvent* event) {
if (event->type() != ui::ET_MOUSE_RELEASED)
return;
- WindowSelectorWindow* target = GetEventTarget(event);
+ aura::Window* target = GetEventTarget(event);
if (!target)
return;
- window_selector_->SelectWindow(target->window());
+ window_selector_->SelectWindow(target);
}
void WindowOverview::OnTouchEvent(ui::TouchEvent* event) {
if (event->type() != ui::ET_TOUCH_PRESSED)
return;
- WindowSelectorWindow* target = GetEventTarget(event);
+ aura::Window* target = GetEventTarget(event);
if (!target)
return;
- window_selector_->SelectWindow(target->window());
+ window_selector_->SelectWindow(target);
}
-WindowSelectorWindow* WindowOverview::GetEventTarget(ui::LocatedEvent* event) {
+aura::Window* WindowOverview::GetEventTarget(ui::LocatedEvent* event) {
aura::Window* target = static_cast<aura::Window*>(event->target());
// If the target window doesn't actually contain the event location (i.e.
// mouse down over the window and mouse up elsewhere) then do not select the
@@ -141,18 +141,19 @@ WindowSelectorWindow* WindowOverview::GetEventTarget(ui::LocatedEvent* event) {
if (!target->HitTest(event->location()))
return NULL;
- for (WindowSelectorWindowList::iterator iter = windows_->begin();
+ for (WindowSelectorItemList::iterator iter = windows_->begin();
iter != windows_->end(); ++iter) {
- if ((*iter)->Contains(target))
- return *iter;
+ aura::Window* selected = (*iter)->TargetedWindow(target);
+ if (selected)
+ return selected;
}
return NULL;
}
void WindowOverview::PositionWindows() {
if (single_root_window_) {
- std::vector<WindowSelectorWindow*> windows;
- for (WindowSelectorWindowList::iterator iter = windows_->begin();
+ std::vector<WindowSelectorItem*> windows;
+ for (WindowSelectorItemList::iterator iter = windows_->begin();
iter != windows_->end(); ++iter) {
windows.push_back(*iter);
}
@@ -165,10 +166,10 @@ void WindowOverview::PositionWindows() {
}
void WindowOverview::PositionWindowsFromRoot(aura::RootWindow* root_window) {
- std::vector<WindowSelectorWindow*> windows;
- for (WindowSelectorWindowList::iterator iter = windows_->begin();
+ std::vector<WindowSelectorItem*> windows;
+ for (WindowSelectorItemList::iterator iter = windows_->begin();
iter != windows_->end(); ++iter) {
- if ((*iter)->window()->GetRootWindow() == root_window)
+ if ((*iter)->GetRootWindow() == root_window)
windows.push_back(*iter);
}
PositionWindowsOnRoot(root_window, windows);
@@ -176,7 +177,7 @@ void WindowOverview::PositionWindowsFromRoot(aura::RootWindow* root_window) {
void WindowOverview::PositionWindowsOnRoot(
aura::RootWindow* root_window,
- const std::vector<WindowSelectorWindow*>& windows) {
+ const std::vector<WindowSelectorItem*>& windows) {
if (windows.empty())
return;
@@ -213,7 +214,7 @@ void WindowOverview::PositionWindowsOnRoot(
window_size.width(),
window_size.height());
target_bounds.Inset(kWindowMargin, kWindowMargin);
- windows[i]->TransformToFitBounds(root_window, target_bounds);
+ windows[i]->SetBounds(root_window, target_bounds);
}
}
« no previous file with comments | « ash/wm/overview/window_overview.h ('k') | ash/wm/overview/window_selector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698