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

Side by Side Diff: ash/common/wm/overview/window_selector_item.cc

Issue 2139873003: [ash-md] Hides frame headers in overview mode not using a mask (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « ash/common/wm/overview/window_grid.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/common/wm/overview/window_selector_item.h" 5 #include "ash/common/wm/overview/window_selector_item.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/common/material_design/material_design_controller.h" 10 #include "ash/common/material_design/material_design_controller.h"
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 screen_rect, target_bounds, top_view_inset, title_height); 464 screen_rect, target_bounds, top_view_inset, title_height);
465 gfx::Transform transform = ScopedTransformOverviewWindow::GetTransformForRect( 465 gfx::Transform transform = ScopedTransformOverviewWindow::GetTransformForRect(
466 screen_rect, selector_item_bounds); 466 screen_rect, selector_item_bounds);
467 ScopedTransformOverviewWindow::ScopedAnimationSettings animation_settings; 467 ScopedTransformOverviewWindow::ScopedAnimationSettings animation_settings;
468 transform_window_.BeginScopedAnimation(animation_type, &animation_settings); 468 transform_window_.BeginScopedAnimation(animation_type, &animation_settings);
469 // Rounded corners are achieved by using a mask layer on the original window 469 // Rounded corners are achieved by using a mask layer on the original window
470 // before the transform. Dividing by scale factor obtains the corner radius 470 // before the transform. Dividing by scale factor obtains the corner radius
471 // which when scaled will yield |kLabelBackgroundRadius|. 471 // which when scaled will yield |kLabelBackgroundRadius|.
472 transform_window_.SetTransform( 472 transform_window_.SetTransform(
473 root_window_, transform, 473 root_window_, transform,
474 gfx::ToFlooredInt(kLabelBackgroundRadius / 474 (kLabelBackgroundRadius / GetItemScale(target_bounds.size())));
475 GetItemScale(target_bounds.size())));
476 transform_window_.set_overview_transform(transform); 475 transform_window_.set_overview_transform(transform);
477 } 476 }
478 477
479 void WindowSelectorItem::SetOpacity(float opacity) { 478 void WindowSelectorItem::SetOpacity(float opacity) {
480 window_label_->SetOpacity(opacity); 479 window_label_->SetOpacity(opacity);
481 if (!ash::MaterialDesignController::IsOverviewMaterial()) 480 if (!ash::MaterialDesignController::IsOverviewMaterial())
482 close_button_widget_->SetOpacity(opacity); 481 close_button_widget_->SetOpacity(opacity);
483 482
484 transform_window_.SetOpacity(opacity); 483 transform_window_.SetOpacity(opacity);
485 } 484 }
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 window_label_selector_window->SetOpacity(opacity); 639 window_label_selector_window->SetOpacity(opacity);
641 } 640 }
642 641
643 void WindowSelectorItem::UpdateCloseButtonAccessibilityName() { 642 void WindowSelectorItem::UpdateCloseButtonAccessibilityName() {
644 close_button_->SetAccessibleName(l10n_util::GetStringFUTF16( 643 close_button_->SetAccessibleName(l10n_util::GetStringFUTF16(
645 IDS_ASH_OVERVIEW_CLOSE_ITEM_BUTTON_ACCESSIBLE_NAME, 644 IDS_ASH_OVERVIEW_CLOSE_ITEM_BUTTON_ACCESSIBLE_NAME,
646 GetWindow()->GetTitle())); 645 GetWindow()->GetTitle()));
647 } 646 }
648 647
649 } // namespace ash 648 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm/overview/window_grid.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698