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

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

Issue 403493006: Visual improvements to text filtering in Ash overview mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: change to screen dimensions in test Created 6 years, 4 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 | « no previous file | 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_grid.cc
diff --git a/ash/wm/overview/window_grid.cc b/ash/wm/overview/window_grid.cc
index d9f136fa54e949043d6759d717953636ef7bb0fe..e8751b8b097769f7cfa3db9c6135c666e985b28d 100644
--- a/ash/wm/overview/window_grid.cc
+++ b/ash/wm/overview/window_grid.cc
@@ -4,6 +4,7 @@
#include "ash/wm/overview/window_grid.h"
+#include "ash/ash_switches.h"
#include "ash/screen_util.h"
#include "ash/shell.h"
#include "ash/shell_window_ids.h"
@@ -13,6 +14,7 @@
#include "ash/wm/overview/window_selector_panels.h"
#include "ash/wm/overview/window_selector_window.h"
#include "ash/wm/window_state.h"
+#include "base/command_line.h"
#include "base/i18n/string_search.h"
#include "base/memory/scoped_vector.h"
#include "third_party/skia/include/core/SkColor.h"
@@ -102,6 +104,10 @@ const int kOverviewSelectorTransitionMilliseconds = 100;
const SkColor kWindowOverviewSelectionColor = SK_ColorBLACK;
const unsigned char kWindowOverviewSelectorOpacity = 128;
+// The minimum amount of spacing between the bottom of the text filtering
+// text field and the top of the selection widget on the first row of items.
+const int kTextFilterBottomMargin = 5;
+
// Returns the vector for the fade in animation.
gfx::Vector2d GetSlideVectorForFadeIn(WindowSelector::Direction direction,
const gfx::Rect& bounds) {
@@ -178,6 +184,17 @@ void WindowGrid::PositionWindows(bool animate) {
ScreenUtil::GetDisplayWorkAreaBoundsInParent(
Shell::GetContainer(root_window_, kShellWindowId_DefaultContainer)));
+ // If the text filtering feature is enabled, reserve space at the top for the
+ // text filtering textbox to appear.
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kAshDisableTextFilteringInOverviewMode)) {
+ total_bounds.Inset(
+ 0,
+ WindowSelector::kTextFilterBottomEdge + kTextFilterBottomMargin,
+ 0,
+ 0);
+ }
+
// Find the minimum number of windows per row that will fit all of the
// windows on screen.
num_columns_ = std::max(
« no previous file with comments | « no previous file | ash/wm/overview/window_selector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698