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

Unified Diff: ash/wm/panels/panel_frame_view.cc

Issue 2146323004: [ash-md] Improves smoothness with many windows in overview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [ash-md] Improves smoothness with many windows in overview (added flags) Created 4 years, 5 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/panels/panel_frame_view.h ('k') | chrome/app/generated_resources.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/panels/panel_frame_view.cc
diff --git a/ash/wm/panels/panel_frame_view.cc b/ash/wm/panels/panel_frame_view.cc
index 85846f490c70c82d5590915358ed587dc2da0f1f..129d9010bdeaa7a7cf6e2208b2d25415d02c3424 100644
--- a/ash/wm/panels/panel_frame_view.cc
+++ b/ash/wm/panels/panel_frame_view.cc
@@ -4,6 +4,8 @@
#include "ash/wm/panels/panel_frame_view.h"
+#include "ash/common/material_design/material_design_controller.h"
+#include "ash/common/wm_shell.h"
#include "ash/frame/caption_buttons/frame_caption_button_container_view.h"
#include "ash/frame/default_header_painter.h"
#include "ash/frame/frame_border_hit_test_controller.h"
@@ -29,9 +31,12 @@ PanelFrameView::PanelFrameView(views::Widget* frame, FrameType frame_type)
DCHECK(!frame_->widget_delegate()->CanMaximize());
if (frame_type != FRAME_NONE)
InitHeaderPainter();
+ WmShell::Get()->AddShellObserver(this);
}
-PanelFrameView::~PanelFrameView() {}
+PanelFrameView::~PanelFrameView() {
+ WmShell::Get()->RemoveShellObserver(this);
+}
void PanelFrameView::SetFrameColors(SkColor active_frame_color,
SkColor inactive_frame_color) {
@@ -105,6 +110,19 @@ void PanelFrameView::UpdateWindowTitle() {
void PanelFrameView::SizeConstraintsChanged() {}
+gfx::Rect PanelFrameView::GetBoundsForClientView() const {
+ gfx::Rect client_bounds = bounds();
+ client_bounds.Inset(0, NonClientTopBorderHeight(), 0, 0);
+ return client_bounds;
+}
+
+gfx::Rect PanelFrameView::GetWindowBoundsForClientBounds(
+ const gfx::Rect& client_bounds) const {
+ gfx::Rect window_bounds = client_bounds;
+ window_bounds.Inset(0, -NonClientTopBorderHeight(), 0, 0);
+ return window_bounds;
+}
+
int PanelFrameView::NonClientHitTest(const gfx::Point& point) {
if (!header_painter_)
return HTNOWHERE;
@@ -124,17 +142,17 @@ void PanelFrameView::OnPaint(gfx::Canvas* canvas) {
header_painter_->PaintHeader(canvas, header_mode);
}
-gfx::Rect PanelFrameView::GetBoundsForClientView() const {
- gfx::Rect client_bounds = bounds();
- client_bounds.Inset(0, NonClientTopBorderHeight(), 0, 0);
- return client_bounds;
+///////////////////////////////////////////////////////////////////////////////
+// PanelFrameView, ShellObserver overrides:
+
+void PanelFrameView::OnOverviewModeStarting() {
+ if (ash::MaterialDesignController::IsOverviewMaterial())
+ caption_button_container_->SetVisible(false);
}
-gfx::Rect PanelFrameView::GetWindowBoundsForClientBounds(
- const gfx::Rect& client_bounds) const {
- gfx::Rect window_bounds = client_bounds;
- window_bounds.Inset(0, -NonClientTopBorderHeight(), 0, 0);
- return window_bounds;
+void PanelFrameView::OnOverviewModeEnded() {
+ if (ash::MaterialDesignController::IsOverviewMaterial())
+ caption_button_container_->SetVisible(true);
}
} // namespace ash
« no previous file with comments | « ash/wm/panels/panel_frame_view.h ('k') | chrome/app/generated_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698