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

Side by Side Diff: ash/shelf/shelf_widget.cc

Issue 2012063002: Only SchedulePaint on ShelfWidget if background changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/shelf/shelf_widget.h" 5 #include "ash/shelf/shelf_widget.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/focus_cycler.h" 8 #include "ash/focus_cycler.h"
9 #include "ash/root_window_controller.h" 9 #include "ash/root_window_controller.h"
10 #include "ash/session/session_state_delegate.h" 10 #include "ash/session/session_state_delegate.h"
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 opaque_background_animation->SetTransitionDuration( 621 opaque_background_animation->SetTransitionDuration(
622 base::TimeDelta::FromMilliseconds(wm::kTimeToSwitchBackgroundMs)); 622 base::TimeDelta::FromMilliseconds(wm::kTimeToSwitchBackgroundMs));
623 } 623 }
624 opaque_background->SetOpacity(target_opacity); 624 opaque_background->SetOpacity(target_opacity);
625 625
626 // TODO(mukai): use ui::Layer on both opaque_background and normal background 626 // TODO(mukai): use ui::Layer on both opaque_background and normal background
627 // retire background_animator_ at all. It would be simpler. 627 // retire background_animator_ at all. It would be simpler.
628 // See also DockedBackgroundWidget::SetPaintsBackground. 628 // See also DockedBackgroundWidget::SetPaintsBackground.
629 background_animator_.SetPaintsBackground( 629 background_animator_.SetPaintsBackground(
630 background_type != wm::SHELF_BACKGROUND_DEFAULT, change_type); 630 background_type != wm::SHELF_BACKGROUND_DEFAULT, change_type);
631 delegate_view_->SchedulePaint();
632 } 631 }
633 632
634 wm::ShelfBackgroundType ShelfWidget::GetBackgroundType() const { 633 wm::ShelfBackgroundType ShelfWidget::GetBackgroundType() const {
635 if (delegate_view_->opaque_background()->GetTargetOpacity() == 1.0f) 634 if (delegate_view_->opaque_background()->GetTargetOpacity() == 1.0f)
636 return wm::SHELF_BACKGROUND_MAXIMIZED; 635 return wm::SHELF_BACKGROUND_MAXIMIZED;
637 if (background_animator_.paints_background()) 636 if (background_animator_.paints_background())
638 return wm::SHELF_BACKGROUND_OVERLAP; 637 return wm::SHELF_BACKGROUND_OVERLAP;
639 638
640 return wm::SHELF_BACKGROUND_DEFAULT; 639 return wm::SHELF_BACKGROUND_DEFAULT;
641 } 640 }
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 DCHECK(delegate_view_); 787 DCHECK(delegate_view_);
789 return delegate_view_->disable_dimming_animations_for_test(); 788 return delegate_view_->disable_dimming_animations_for_test();
790 } 789 }
791 790
792 void ShelfWidget::WillDeleteShelf() { 791 void ShelfWidget::WillDeleteShelf() {
793 shelf_layout_manager_->RemoveObserver(this); 792 shelf_layout_manager_->RemoveObserver(this);
794 shelf_layout_manager_ = NULL; 793 shelf_layout_manager_ = NULL;
795 } 794 }
796 795
797 } // namespace ash 796 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698