Commit 30188759 authored by oshima's avatar oshima Committed by Commit bot

Cleanup: Remove unused arguments, member variable

Renamed method to reflect what it does, instead of how it's implemented.

BUG=None

Review-Url: https://codereview.chromium.org/2433233005
Cr-Commit-Position: refs/heads/master@{#427176}
parent 963669d6
...@@ -189,7 +189,6 @@ void ScopedTransformOverviewWindow::RestoreWindow() { ...@@ -189,7 +189,6 @@ void ScopedTransformOverviewWindow::RestoreWindow() {
BeginScopedAnimation(OverviewAnimationType::OVERVIEW_ANIMATION_RESTORE_WINDOW, BeginScopedAnimation(OverviewAnimationType::OVERVIEW_ANIMATION_RESTORE_WINDOW,
&animation_settings_list); &animation_settings_list);
SetTransform(window()->GetRootWindow(), original_transform_); SetTransform(window()->GetRootWindow(), original_transform_);
set_overview_transform(original_transform_);
std::unique_ptr<ScopedOverviewAnimationSettings> animation_settings = std::unique_ptr<ScopedOverviewAnimationSettings> animation_settings =
CreateScopedOverviewAnimationSettings( CreateScopedOverviewAnimationSettings(
...@@ -213,7 +212,7 @@ void ScopedTransformOverviewWindow::RestoreWindow() { ...@@ -213,7 +212,7 @@ void ScopedTransformOverviewWindow::RestoreWindow() {
} }
window_->GetWindowState()->set_ignored_by_shelf(ignored_by_shelf_); window_->GetWindowState()->set_ignored_by_shelf(ignored_by_shelf_);
SetOpacity(original_opacity_); SetOpacity(original_opacity_);
ShowHeaderAndResetShape(); ShowHeader();
} }
void ScopedTransformOverviewWindow::BeginScopedAnimation( void ScopedTransformOverviewWindow::BeginScopedAnimation(
...@@ -400,7 +399,7 @@ void ScopedTransformOverviewWindow::SetOpacity(float opacity) { ...@@ -400,7 +399,7 @@ void ScopedTransformOverviewWindow::SetOpacity(float opacity) {
} }
} }
void ScopedTransformOverviewWindow::HideHeaderAndSetShape(int radius) { void ScopedTransformOverviewWindow::HideHeader() {
gfx::Rect bounds(GetTargetBoundsInScreen().size()); gfx::Rect bounds(GetTargetBoundsInScreen().size());
const int inset = GetTopInset(); const int inset = GetTopInset();
if (inset > 0) { if (inset > 0) {
...@@ -415,7 +414,7 @@ void ScopedTransformOverviewWindow::HideHeaderAndSetShape(int radius) { ...@@ -415,7 +414,7 @@ void ScopedTransformOverviewWindow::HideHeaderAndSetShape(int radius) {
} }
} }
void ScopedTransformOverviewWindow::ShowHeaderAndResetShape() { void ScopedTransformOverviewWindow::ShowHeader() {
ui::Layer* layer = window()->GetLayer(); ui::Layer* layer = window()->GetLayer();
if (original_window_shape_) { if (original_window_shape_) {
layer->SetAlphaShape( layer->SetAlphaShape(
......
...@@ -61,12 +61,6 @@ class ASH_EXPORT ScopedTransformOverviewWindow { ...@@ -61,12 +61,6 @@ class ASH_EXPORT ScopedTransformOverviewWindow {
explicit ScopedTransformOverviewWindow(WmWindow* window); explicit ScopedTransformOverviewWindow(WmWindow* window);
~ScopedTransformOverviewWindow(); ~ScopedTransformOverviewWindow();
gfx::Transform get_overview_transform() const { return overview_transform_; }
void set_overview_transform(const gfx::Transform& transform) {
overview_transform_ = transform;
}
// Starts an animation sequence which will use animation settings specified by // Starts an animation sequence which will use animation settings specified by
// |animation_type|. The |animation_settings| container is populated with // |animation_type|. The |animation_settings| container is populated with
// scoped entities and the container should be destroyed at the end of the // scoped entities and the container should be destroyed at the end of the
...@@ -127,13 +121,12 @@ class ASH_EXPORT ScopedTransformOverviewWindow { ...@@ -127,13 +121,12 @@ class ASH_EXPORT ScopedTransformOverviewWindow {
// Set's the opacity of the managed windows. // Set's the opacity of the managed windows.
void SetOpacity(float opacity); void SetOpacity(float opacity);
// Creates a mask layer with the bottom edge using rounded corners of // Hides the window header whose size is given in |TOP_VIEW_INSET|
// |radius|. Uses SetAlphaShape to mask the header. // window property.
void HideHeaderAndSetShape(int radius); void HideHeader();
// Restores original window shape and removes the mask if installed. Safe to // Shows the window header that is hidden by HideHeader().
// call even if HideHeaderAndSetShape() has not been called. void ShowHeader();
void ShowHeaderAndResetShape();
WmWindow* window() const { return window_; } WmWindow* window() const { return window_; }
...@@ -181,10 +174,6 @@ class ASH_EXPORT ScopedTransformOverviewWindow { ...@@ -181,10 +174,6 @@ class ASH_EXPORT ScopedTransformOverviewWindow {
// The original transform of the window before entering overview mode. // The original transform of the window before entering overview mode.
gfx::Transform original_transform_; gfx::Transform original_transform_;
// Keeps track of the original transform used when |this| has been positioned
// during SelectorItem layout.
gfx::Transform overview_transform_;
// The original opacity of the window before entering overview mode. // The original opacity of the window before entering overview mode.
float original_opacity_; float original_opacity_;
......
...@@ -285,7 +285,7 @@ class WindowSelectorItem::RoundedContainerView ...@@ -285,7 +285,7 @@ class WindowSelectorItem::RoundedContainerView
if (0 != (sequence->properties() & if (0 != (sequence->properties() &
ui::LayerAnimationElement::AnimatableProperty::OPACITY)) { ui::LayerAnimationElement::AnimatableProperty::OPACITY)) {
if (item_) if (item_)
item_->HideHeaderAndSetShape(0); item_->HideHeader();
StopObservingLayerAnimations(); StopObservingLayerAnimations();
AnimateColor(gfx::Tween::EASE_IN, kSelectorColorSlideMilliseconds); AnimateColor(gfx::Tween::EASE_IN, kSelectorColorSlideMilliseconds);
} }
...@@ -512,8 +512,8 @@ void WindowSelectorItem::CloseWindow() { ...@@ -512,8 +512,8 @@ void WindowSelectorItem::CloseWindow() {
transform_window_.Close(); transform_window_.Close();
} }
void WindowSelectorItem::HideHeaderAndSetShape(int radius) { void WindowSelectorItem::HideHeader() {
transform_window_.HideHeaderAndSetShape(radius); transform_window_.HideHeader();
} }
void WindowSelectorItem::SetDimmed(bool dimmed) { void WindowSelectorItem::SetDimmed(bool dimmed) {
...@@ -576,7 +576,6 @@ void WindowSelectorItem::SetItemBounds(const gfx::Rect& target_bounds, ...@@ -576,7 +576,6 @@ void WindowSelectorItem::SetItemBounds(const gfx::Rect& target_bounds,
ScopedTransformOverviewWindow::ScopedAnimationSettings animation_settings; ScopedTransformOverviewWindow::ScopedAnimationSettings animation_settings;
transform_window_.BeginScopedAnimation(animation_type, &animation_settings); transform_window_.BeginScopedAnimation(animation_type, &animation_settings);
transform_window_.SetTransform(root_window_, transform); transform_window_.SetTransform(root_window_, transform);
transform_window_.set_overview_transform(transform);
} }
void WindowSelectorItem::SetOpacity(float opacity) { void WindowSelectorItem::SetOpacity(float opacity) {
......
...@@ -135,10 +135,8 @@ class ASH_EXPORT WindowSelectorItem : public views::ButtonListener, ...@@ -135,10 +135,8 @@ class ASH_EXPORT WindowSelectorItem : public views::ButtonListener,
// Closes |transform_window_|. // Closes |transform_window_|.
void CloseWindow(); void CloseWindow();
// Hides the original window header and sets shape or mask on a window. // Hides the original window header.
// When masks are used, rounded corner |radius| can be specified. void HideHeader();
// TODO(varkha): remove |radius|.
void HideHeaderAndSetShape(int radius);
// Sets if the item is dimmed in the overview. Changing the value will also // Sets if the item is dimmed in the overview. Changing the value will also
// change the visibility of the transform windows. // change the visibility of the transform windows.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment