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

Unified Diff: ash/wm/frame_painter.cc

Issue 23625007: Replace kIgnoreSoloWindowFramePointerPolicy with global flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: ash/wm/frame_painter.cc
diff --git a/ash/wm/frame_painter.cc b/ash/wm/frame_painter.cc
index 631c05874cff981413726b8d6b75e41aadfda188..ef1a5af03e57948c05873d2a608e7d8a74027d45 100644
--- a/ash/wm/frame_painter.cc
+++ b/ash/wm/frame_painter.cc
@@ -76,6 +76,9 @@ const int kActivationCrossfadeDurationMs = 200;
// Alpha/opacity value for fully-opaque headers.
const int kFullyOpaque = 255;
+// A flag to enable/disable solo window header.
+bool solo_window_header_enabled = true;
+
// Tiles an image into an area, rounding the top corners. Samples |image|
// starting |image_inset_x| pixels from the left of the image.
void TileRoundRect(gfx::Canvas* canvas,
@@ -276,6 +279,11 @@ void FramePainter::Init(
}
// static
+void FramePainter::SetSoloWindowHeaderEnabled(bool enabled) {
+ solo_window_header_enabled = enabled;
+}
+
+// static
void FramePainter::UpdateSoloWindowHeader(RootWindow* root_window) {
// Use a separate function here so callers outside of FramePainter don't need
// to know about "ignorable_window".
@@ -748,12 +756,12 @@ int FramePainter::GetHeaderOpacity(
}
bool FramePainter::UseSoloWindowHeader() const {
+ if (!solo_window_header_enabled)
James Cook 2013/09/04 18:25:21 Good catch that this can be done before IsSoloWind
+ return false;
// Don't use transparent headers for panels, pop-ups, etc.
if (!IsSoloWindowHeaderCandidate(window_))
return false;
aura::RootWindow* root = window_->GetRootWindow();
- if (!root || root->GetProperty(internal::kIgnoreSoloWindowFramePainterPolicy))
- return false;
// Don't recompute every time, as it would require many window property
// lookups.
return internal::GetRootWindowSettings(root)->solo_window_header;
« ash/wm/frame_painter.h ('K') | « ash/wm/frame_painter.h ('k') | ash/wm/window_properties.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698