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

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

Issue 512663002: Cleanup: Remove misc unneeded grit includes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/shelf/shelf.cc ('k') | ash/shelf/shelf_view_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_view.h" 5 #include "ash/shelf/shelf_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/ash_constants.h" 9 #include "ash/ash_constants.h"
10 #include "ash/ash_switches.h" 10 #include "ash/ash_switches.h"
(...skipping 14 matching lines...) Expand all
25 #include "ash/shelf/shelf_layout_manager.h" 25 #include "ash/shelf/shelf_layout_manager.h"
26 #include "ash/shelf/shelf_menu_model.h" 26 #include "ash/shelf/shelf_menu_model.h"
27 #include "ash/shelf/shelf_model.h" 27 #include "ash/shelf/shelf_model.h"
28 #include "ash/shelf/shelf_tooltip_manager.h" 28 #include "ash/shelf/shelf_tooltip_manager.h"
29 #include "ash/shelf/shelf_widget.h" 29 #include "ash/shelf/shelf_widget.h"
30 #include "ash/shell.h" 30 #include "ash/shell.h"
31 #include "ash/wm/coordinate_conversion.h" 31 #include "ash/wm/coordinate_conversion.h"
32 #include "base/auto_reset.h" 32 #include "base/auto_reset.h"
33 #include "base/memory/scoped_ptr.h" 33 #include "base/memory/scoped_ptr.h"
34 #include "base/metrics/histogram.h" 34 #include "base/metrics/histogram.h"
35 #include "grit/ash_resources.h"
36 #include "grit/ash_strings.h" 35 #include "grit/ash_strings.h"
37 #include "ui/accessibility/ax_view_state.h" 36 #include "ui/accessibility/ax_view_state.h"
38 #include "ui/aura/client/screen_position_client.h" 37 #include "ui/aura/client/screen_position_client.h"
39 #include "ui/aura/window.h" 38 #include "ui/aura/window.h"
40 #include "ui/aura/window_event_dispatcher.h" 39 #include "ui/aura/window_event_dispatcher.h"
41 #include "ui/base/l10n/l10n_util.h" 40 #include "ui/base/l10n/l10n_util.h"
42 #include "ui/base/models/simple_menu_model.h" 41 #include "ui/base/models/simple_menu_model.h"
43 #include "ui/base/resource/resource_bundle.h" 42 #include "ui/base/resource/resource_bundle.h"
44 #include "ui/compositor/layer.h" 43 #include "ui/compositor/layer.h"
45 #include "ui/compositor/layer_animator.h" 44 #include "ui/compositor/layer_animator.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 const float kDragAndDropProxyScale = 1.5f; 108 const float kDragAndDropProxyScale = 1.5f;
110 109
111 // The opacity represents that this partially disappeared item will get removed. 110 // The opacity represents that this partially disappeared item will get removed.
112 const float kDraggedImageOpacity = 0.5f; 111 const float kDraggedImageOpacity = 0.5f;
113 112
114 namespace { 113 namespace {
115 114
116 // A class to temporarily disable a given bounds animator. 115 // A class to temporarily disable a given bounds animator.
117 class BoundsAnimatorDisabler { 116 class BoundsAnimatorDisabler {
118 public: 117 public:
119 BoundsAnimatorDisabler(views::BoundsAnimator* bounds_animator) 118 explicit BoundsAnimatorDisabler(views::BoundsAnimator* bounds_animator)
120 : old_duration_(bounds_animator->GetAnimationDuration()), 119 : old_duration_(bounds_animator->GetAnimationDuration()),
121 bounds_animator_(bounds_animator) { 120 bounds_animator_(bounds_animator) {
122 bounds_animator_->SetAnimationDuration(1); 121 bounds_animator_->SetAnimationDuration(1);
123 } 122 }
124 123
125 ~BoundsAnimatorDisabler() { 124 ~BoundsAnimatorDisabler() {
126 bounds_animator_->SetAnimationDuration(old_duration_); 125 bounds_animator_->SetAnimationDuration(old_duration_);
127 } 126 }
128 127
129 private: 128 private:
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 overflow_button_->set_context_menu_controller(this); 423 overflow_button_->set_context_menu_controller(this);
425 ConfigureChildView(overflow_button_); 424 ConfigureChildView(overflow_button_);
426 AddChildView(overflow_button_); 425 AddChildView(overflow_button_);
427 426
428 // We'll layout when our bounds change. 427 // We'll layout when our bounds change.
429 } 428 }
430 429
431 void ShelfView::OnShelfAlignmentChanged() { 430 void ShelfView::OnShelfAlignmentChanged() {
432 overflow_button_->OnShelfAlignmentChanged(); 431 overflow_button_->OnShelfAlignmentChanged();
433 LayoutToIdealBounds(); 432 LayoutToIdealBounds();
434 for (int i=0; i < view_model_->view_size(); ++i) { 433 for (int i = 0; i < view_model_->view_size(); ++i) {
435 if (i >= first_visible_index_ && i <= last_visible_index_) 434 if (i >= first_visible_index_ && i <= last_visible_index_)
436 view_model_->view_at(i)->Layout(); 435 view_model_->view_at(i)->Layout();
437 } 436 }
438 tooltip_->Close(); 437 tooltip_->Close();
439 if (overflow_bubble_) 438 if (overflow_bubble_)
440 overflow_bubble_->Hide(); 439 overflow_bubble_->Hide();
441 } 440 }
442 441
443 void ShelfView::SchedulePaintForAllButtons() { 442 void ShelfView::SchedulePaintForAllButtons() {
444 for (int i = 0; i < view_model_->view_size(); ++i) { 443 for (int i = 0; i < view_model_->view_size(); ++i) {
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 void ShelfView::EndDrag(bool cancel) { 651 void ShelfView::EndDrag(bool cancel) {
653 if (!drag_and_drop_shelf_id_) 652 if (!drag_and_drop_shelf_id_)
654 return; 653 return;
655 654
656 views::View* drag_and_drop_view = view_model_->view_at( 655 views::View* drag_and_drop_view = view_model_->view_at(
657 model_->ItemIndexByID(drag_and_drop_shelf_id_)); 656 model_->ItemIndexByID(drag_and_drop_shelf_id_));
658 PointerReleasedOnButton( 657 PointerReleasedOnButton(
659 drag_and_drop_view, ShelfButtonHost::DRAG_AND_DROP, cancel); 658 drag_and_drop_view, ShelfButtonHost::DRAG_AND_DROP, cancel);
660 659
661 // Either destroy the temporarily created item - or - make the item visible. 660 // Either destroy the temporarily created item - or - make the item visible.
662 if (drag_and_drop_item_pinned_ && cancel) 661 if (drag_and_drop_item_pinned_ && cancel) {
663 delegate_->UnpinAppWithID(drag_and_drop_app_id_); 662 delegate_->UnpinAppWithID(drag_and_drop_app_id_);
664 else if (drag_and_drop_view) { 663 } else if (drag_and_drop_view) {
665 if (cancel) { 664 if (cancel) {
666 // When a hosted drag gets canceled, the item can remain in the same slot 665 // When a hosted drag gets canceled, the item can remain in the same slot
667 // and it might have moved within the bounds. In that case the item need 666 // and it might have moved within the bounds. In that case the item need
668 // to animate back to its correct location. 667 // to animate back to its correct location.
669 AnimateToIdealBounds(); 668 AnimateToIdealBounds();
670 } else { 669 } else {
671 drag_and_drop_view->SetSize(pre_drag_and_drop_size_); 670 drag_and_drop_view->SetSize(pre_drag_and_drop_size_);
672 } 671 }
673 } 672 }
674 673
(...skipping 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after
1925 distance = bounds.x() - coordinate.x(); 1924 distance = bounds.x() - coordinate.x();
1926 break; 1925 break;
1927 case SHELF_ALIGNMENT_TOP: 1926 case SHELF_ALIGNMENT_TOP:
1928 distance = coordinate.y() - bounds.bottom(); 1927 distance = coordinate.y() - bounds.bottom();
1929 break; 1928 break;
1930 } 1929 }
1931 return distance > 0 ? distance : 0; 1930 return distance > 0 ? distance : 0;
1932 } 1931 }
1933 1932
1934 } // namespace ash 1933 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/shelf.cc ('k') | ash/shelf/shelf_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698