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

Side by Side Diff: ash/common/shelf/shelf_layout_manager.cc

Issue 2480813003: Reduce views::Border creation verbosity by promoting factory functions (Closed)
Patch Set: fix bad merge Created 4 years, 1 month 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 | ash/common/shelf/shelf_view.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/common/shelf/shelf_layout_manager.h" 5 #include "ash/common/shelf/shelf_layout_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 // if keyboard is not shown. 589 // if keyboard is not shown.
590 if (!state_.is_adding_user_screen || !keyboard_bounds_.IsEmpty()) 590 if (!state_.is_adding_user_screen || !keyboard_bounds_.IsEmpty())
591 insets = target_bounds.work_area_insets; 591 insets = target_bounds.work_area_insets;
592 WmShell::Get()->SetDisplayWorkAreaInsets(shelf_window, insets); 592 WmShell::Get()->SetDisplayWorkAreaInsets(shelf_window, insets);
593 } 593 }
594 } 594 }
595 595
596 // Set an empty border to avoid the shelf view and status area overlapping. 596 // Set an empty border to avoid the shelf view and status area overlapping.
597 // TODO(msw): Avoid setting bounds of views within the shelf widget here. 597 // TODO(msw): Avoid setting bounds of views within the shelf widget here.
598 gfx::Rect shelf_bounds = gfx::Rect(target_bounds.shelf_bounds_in_root.size()); 598 gfx::Rect shelf_bounds = gfx::Rect(target_bounds.shelf_bounds_in_root.size());
599 shelf_widget_->GetContentsView()->SetBorder(views::Border::CreateEmptyBorder( 599 shelf_widget_->GetContentsView()->SetBorder(views::CreateEmptyBorder(
600 shelf_bounds.InsetsFrom(target_bounds.shelf_bounds_in_shelf))); 600 shelf_bounds.InsetsFrom(target_bounds.shelf_bounds_in_shelf)));
601 shelf_widget_->GetContentsView()->Layout(); 601 shelf_widget_->GetContentsView()->Layout();
602 602
603 // Setting visibility during an animation causes the visibility property to 603 // Setting visibility during an animation causes the visibility property to
604 // animate. Set the visibility property without an animation. 604 // animate. Set the visibility property without an animation.
605 if (target_bounds.status_opacity) 605 if (target_bounds.status_opacity)
606 shelf_widget_->status_area_widget()->Show(); 606 shelf_widget_->status_area_widget()->Show();
607 } 607 }
608 608
609 void ShelfLayoutManager::StopAnimating() { 609 void ShelfLayoutManager::StopAnimating() {
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
1102 gesture_drag_status_ = GESTURE_DRAG_NONE; 1102 gesture_drag_status_ = GESTURE_DRAG_NONE;
1103 } 1103 }
1104 1104
1105 void ShelfLayoutManager::CancelGestureDrag() { 1105 void ShelfLayoutManager::CancelGestureDrag() {
1106 gesture_drag_status_ = GESTURE_DRAG_CANCEL_IN_PROGRESS; 1106 gesture_drag_status_ = GESTURE_DRAG_CANCEL_IN_PROGRESS;
1107 UpdateVisibilityState(); 1107 UpdateVisibilityState();
1108 gesture_drag_status_ = GESTURE_DRAG_NONE; 1108 gesture_drag_status_ = GESTURE_DRAG_NONE;
1109 } 1109 }
1110 1110
1111 } // namespace ash 1111 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/common/shelf/shelf_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698