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

Side by Side Diff: ash/wm/overview/window_selector_panels.cc

Issue 196723009: Not submitted - Fixing invalid visibility states with layers which showed up in unittests ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/wm/overview/window_selector_panels.h" 5 #include "ash/wm/overview/window_selector_panels.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell_window_ids.h" 8 #include "ash/shell_window_ids.h"
9 #include "ash/wm/overview/scoped_transform_overview_window.h" 9 #include "ash/wm/overview/scoped_transform_overview_window.h"
10 #include "ash/wm/panels/panel_layout_manager.h" 10 #include "ash/wm/panels/panel_layout_manager.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 } 51 }
52 52
53 ScopedTransformPanelWindow::~ScopedTransformPanelWindow() { 53 ScopedTransformPanelWindow::~ScopedTransformPanelWindow() {
54 // window() will be NULL if the window was destroyed. 54 // window() will be NULL if the window was destroyed.
55 if (window()) 55 if (window())
56 RestoreCallout(); 56 RestoreCallout();
57 } 57 }
58 58
59 void ScopedTransformPanelWindow::PrepareForOverview() { 59 void ScopedTransformPanelWindow::PrepareForOverview() {
60 ScopedTransformOverviewWindow::PrepareForOverview(); 60 ScopedTransformOverviewWindow::PrepareForOverview();
61 GetCalloutWidget()->GetLayer()->SetOpacity(0.0f); 61 // The window is logically visible and we cannot make the layer fade to
62 // alpha=0. We therefore provide a float value which will result in a
63 // byte value of 0 but gets detected as not 0.
64 GetCalloutWidget()->GetLayer()->SetOpacity(0.001f);
62 } 65 }
63 66
64 views::Widget* ScopedTransformPanelWindow::GetCalloutWidget() { 67 views::Widget* ScopedTransformPanelWindow::GetCalloutWidget() {
65 DCHECK(window()->parent()->id() == internal::kShellWindowId_PanelContainer); 68 DCHECK(window()->parent()->id() == internal::kShellWindowId_PanelContainer);
66 internal::PanelLayoutManager* panel_layout_manager = 69 internal::PanelLayoutManager* panel_layout_manager =
67 static_cast<internal::PanelLayoutManager*>( 70 static_cast<internal::PanelLayoutManager*>(
68 window()->parent()->layout_manager()); 71 window()->parent()->layout_manager());
69 return panel_layout_manager->GetCalloutWidgetForPanel(window()); 72 return panel_layout_manager->GetCalloutWidgetForPanel(window());
70 } 73 }
71 74
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 transform.Translate(bounding_rect.x() - bounds.x(), 175 transform.Translate(bounding_rect.x() - bounds.x(),
173 bounding_rect.y() - bounds.y()); 176 bounding_rect.y() - bounds.y());
174 transform.PreconcatTransform(bounding_transform); 177 transform.PreconcatTransform(bounding_transform);
175 transform.Translate(bounds.x() - bounding_rect.x(), 178 transform.Translate(bounds.x() - bounding_rect.x(),
176 bounds.y() - bounding_rect.y()); 179 bounds.y() - bounding_rect.y());
177 (*iter)->SetTransform(root_window, transform, animate); 180 (*iter)->SetTransform(root_window, transform, animate);
178 } 181 }
179 } 182 }
180 183
181 } // namespace ash 184 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698