Commit eb900a1e authored by vmpstr's avatar vmpstr Committed by Commit bot

ash: Change auto to not deduce raw pointers.

This patch updates the code to prevent auto deducing to a raw pointer.

R=sky, danakj, dcheng
BUG=554600

Review-Url: https://codereview.chromium.org/2110643002
Cr-Commit-Position: refs/heads/master@{#402668}
parent 5d162a60
...@@ -184,7 +184,7 @@ void ShowDeprecatedAcceleratorNotification(const char* const notification_id, ...@@ -184,7 +184,7 @@ void ShowDeprecatedAcceleratorNotification(const char* const notification_id,
void RecordUmaHistogram(const char* histogram_name, void RecordUmaHistogram(const char* histogram_name,
DeprecatedAcceleratorUsage sample) { DeprecatedAcceleratorUsage sample) {
auto histogram = base::LinearHistogram::FactoryGet( auto* histogram = base::LinearHistogram::FactoryGet(
histogram_name, 1, DEPRECATED_USAGE_COUNT, DEPRECATED_USAGE_COUNT + 1, histogram_name, 1, DEPRECATED_USAGE_COUNT, DEPRECATED_USAGE_COUNT + 1,
base::HistogramBase::kUmaTargetedHistogramFlag); base::HistogramBase::kUmaTargetedHistogramFlag);
histogram->Add(sample); histogram->Add(sample);
......
...@@ -284,14 +284,14 @@ void ScopedTransformOverviewWindow::RestoreWindow() { ...@@ -284,14 +284,14 @@ void ScopedTransformOverviewWindow::RestoreWindow() {
void ScopedTransformOverviewWindow::BeginScopedAnimation( void ScopedTransformOverviewWindow::BeginScopedAnimation(
OverviewAnimationType animation_type, OverviewAnimationType animation_type,
ScopedAnimationSettings* animation_settings) { ScopedAnimationSettings* animation_settings) {
for (const auto& window : GetTransientTreeIterator(window_)) { for (auto* window : GetTransientTreeIterator(window_)) {
animation_settings->push_back( animation_settings->push_back(
CreateScopedOverviewAnimationSettings(animation_type, window)); CreateScopedOverviewAnimationSettings(animation_type, window));
} }
} }
bool ScopedTransformOverviewWindow::Contains(const WmWindow* target) const { bool ScopedTransformOverviewWindow::Contains(const WmWindow* target) const {
for (const auto& window : GetTransientTreeIterator(window_)) { for (auto* window : GetTransientTreeIterator(window_)) {
if (window->Contains(target)) if (window->Contains(target))
return true; return true;
} }
...@@ -300,7 +300,7 @@ bool ScopedTransformOverviewWindow::Contains(const WmWindow* target) const { ...@@ -300,7 +300,7 @@ bool ScopedTransformOverviewWindow::Contains(const WmWindow* target) const {
gfx::Rect ScopedTransformOverviewWindow::GetTargetBoundsInScreen() const { gfx::Rect ScopedTransformOverviewWindow::GetTargetBoundsInScreen() const {
gfx::Rect bounds; gfx::Rect bounds;
for (const auto& window : GetTransientTreeIterator(window_)) { for (auto* window : GetTransientTreeIterator(window_)) {
// Ignore other window types when computing bounding box of window // Ignore other window types when computing bounding box of window
// selector target item. // selector target item.
if (window != window_ && window->GetType() != ui::wm::WINDOW_TYPE_NORMAL && if (window != window_ && window->GetType() != ui::wm::WINDOW_TYPE_NORMAL &&
...@@ -397,7 +397,7 @@ void ScopedTransformOverviewWindow::SetTransform( ...@@ -397,7 +397,7 @@ void ScopedTransformOverviewWindow::SetTransform(
gfx::Point target_origin(GetTargetBoundsInScreen().origin()); gfx::Point target_origin(GetTargetBoundsInScreen().origin());
for (const auto& window : GetTransientTreeIterator(window_)) { for (auto* window : GetTransientTreeIterator(window_)) {
WmWindow* parent_window = window->GetParent(); WmWindow* parent_window = window->GetParent();
gfx::Point original_origin = gfx::Point original_origin =
parent_window->ConvertRectToScreen(window->GetTargetBounds()).origin(); parent_window->ConvertRectToScreen(window->GetTargetBounds()).origin();
...@@ -410,7 +410,7 @@ void ScopedTransformOverviewWindow::SetTransform( ...@@ -410,7 +410,7 @@ void ScopedTransformOverviewWindow::SetTransform(
} }
void ScopedTransformOverviewWindow::SetOpacity(float opacity) { void ScopedTransformOverviewWindow::SetOpacity(float opacity) {
for (const auto& window : GetTransientTreeIterator(window_)) { for (auto* window : GetTransientTreeIterator(window_)) {
window->SetOpacity(opacity); window->SetOpacity(opacity);
} }
} }
......
...@@ -411,7 +411,7 @@ WindowGrid::WindowGrid(WmWindow* root_window, ...@@ -411,7 +411,7 @@ WindowGrid::WindowGrid(WmWindow* root_window,
selected_index_(0), selected_index_(0),
num_columns_(0) { num_columns_(0) {
std::vector<WmWindow*> windows_in_root; std::vector<WmWindow*> windows_in_root;
for (auto window : windows) { for (auto* window : windows) {
if (window->GetRootWindow() == root_window) if (window->GetRootWindow() == root_window)
windows_in_root.push_back(window); windows_in_root.push_back(window);
} }
...@@ -424,7 +424,7 @@ WindowGrid::WindowGrid(WmWindow* root_window, ...@@ -424,7 +424,7 @@ WindowGrid::WindowGrid(WmWindow* root_window,
ReorderItemsGreedyLeastMovement(&windows_in_root, root_window_, ReorderItemsGreedyLeastMovement(&windows_in_root, root_window_,
window_selector_->text_filter_bottom()); window_selector_->text_filter_bottom());
} }
for (auto window : windows_in_root) { for (auto* window : windows_in_root) {
window->AddObserver(this); window->AddObserver(this);
observed_windows_.insert(window); observed_windows_.insert(window);
window_list_.push_back(new WindowSelectorItem(window, window_selector_)); window_list_.push_back(new WindowSelectorItem(window, window_selector_));
...@@ -907,7 +907,7 @@ bool WindowGrid::FitWindowRectsInBounds(const gfx::Rect& bounds, ...@@ -907,7 +907,7 @@ bool WindowGrid::FitWindowRectsInBounds(const gfx::Rect& bounds,
// necessary to determine each item's scale. // necessary to determine each item's scale.
const gfx::Size item_size(0, height); const gfx::Size item_size(0, height);
size_t i = 0; size_t i = 0;
for (auto window : window_list_) { for (auto* window : window_list_) {
const gfx::Rect target_bounds = window->GetWindow()->GetTargetBounds(); const gfx::Rect target_bounds = window->GetWindow()->GetTargetBounds();
const int width = const int width =
std::max(1, gfx::ToFlooredInt(target_bounds.width() * std::max(1, gfx::ToFlooredInt(target_bounds.width() *
......
...@@ -358,7 +358,7 @@ void WorkspaceLayoutManager::UpdateAlwaysOnTop(WmWindow* window_on_top) { ...@@ -358,7 +358,7 @@ void WorkspaceLayoutManager::UpdateAlwaysOnTop(WmWindow* window_on_top) {
// always_on_top containers' layouts are managed by this class all the // always_on_top containers' layouts are managed by this class all the
// appropriate windows will be included in the iteration. // appropriate windows will be included in the iteration.
WindowSet windows(windows_); WindowSet windows(windows_);
for (auto window : windows) { for (auto* window : windows) {
wm::WindowState* window_state = window->GetWindowState(); wm::WindowState* window_state = window->GetWindowState();
if (window_on_top) if (window_on_top)
window_state->DisableAlwaysOnTop(window_on_top); window_state->DisableAlwaysOnTop(window_on_top);
......
...@@ -465,7 +465,7 @@ void ShowDisplayErrorNotification(int message_id) { ...@@ -465,7 +465,7 @@ void ShowDisplayErrorNotification(int message_id) {
base::string16 GetDisplayErrorNotificationMessageForTest() { base::string16 GetDisplayErrorNotificationMessageForTest() {
message_center::NotificationList::Notifications notifications = message_center::NotificationList::Notifications notifications =
message_center::MessageCenter::Get()->GetVisibleNotifications(); message_center::MessageCenter::Get()->GetVisibleNotifications();
for (auto const notification : notifications) { for (auto* const notification : notifications) {
if (notification->id() == kDisplayErrorNotificationId) if (notification->id() == kDisplayErrorNotificationId)
return notification->message(); return notification->message();
} }
......
...@@ -63,7 +63,7 @@ AshWindowTreeHostUnified::~AshWindowTreeHostUnified() { ...@@ -63,7 +63,7 @@ AshWindowTreeHostUnified::~AshWindowTreeHostUnified() {
void AshWindowTreeHostUnified::PrepareForShutdown() { void AshWindowTreeHostUnified::PrepareForShutdown() {
AshWindowTreeHostPlatform::PrepareForShutdown(); AshWindowTreeHostPlatform::PrepareForShutdown();
for (auto host : mirroring_hosts_) for (auto* host : mirroring_hosts_)
host->PrepareForShutdown(); host->PrepareForShutdown();
} }
...@@ -84,12 +84,12 @@ void AshWindowTreeHostUnified::SetBounds(const gfx::Rect& bounds) { ...@@ -84,12 +84,12 @@ void AshWindowTreeHostUnified::SetBounds(const gfx::Rect& bounds) {
} }
void AshWindowTreeHostUnified::SetCursorNative(gfx::NativeCursor cursor) { void AshWindowTreeHostUnified::SetCursorNative(gfx::NativeCursor cursor) {
for (auto host : mirroring_hosts_) for (auto* host : mirroring_hosts_)
host->AsWindowTreeHost()->SetCursor(cursor); host->AsWindowTreeHost()->SetCursor(cursor);
} }
void AshWindowTreeHostUnified::OnCursorVisibilityChangedNative(bool show) { void AshWindowTreeHostUnified::OnCursorVisibilityChangedNative(bool show) {
for (auto host : mirroring_hosts_) for (auto* host : mirroring_hosts_)
host->AsWindowTreeHost()->OnCursorVisibilityChanged(show); host->AsWindowTreeHost()->OnCursorVisibilityChanged(show);
} }
......
...@@ -26,7 +26,7 @@ void LayoutManager::Uninstall() { ...@@ -26,7 +26,7 @@ void LayoutManager::Uninstall() {
if (!owner_) if (!owner_)
return; return;
owner_->RemoveObserver(this); owner_->RemoveObserver(this);
for (auto child : owner_->children()) for (auto* child : owner_->children())
child->RemoveObserver(this); child->RemoveObserver(this);
owner_ = nullptr; owner_ = nullptr;
} }
...@@ -58,7 +58,7 @@ void LayoutManager::OnWindowBoundsChanged(::mus::Window* window, ...@@ -58,7 +58,7 @@ void LayoutManager::OnWindowBoundsChanged(::mus::Window* window,
return; return;
// Changes to the container's bounds require all windows to be laid out. // Changes to the container's bounds require all windows to be laid out.
for (auto child : window->children()) for (auto* child : window->children())
LayoutWindow(child); LayoutWindow(child);
} }
......
...@@ -125,7 +125,7 @@ void UserWindowControllerImpl::AssignIdIfNecessary(::mus::Window* window) { ...@@ -125,7 +125,7 @@ void UserWindowControllerImpl::AssignIdIfNecessary(::mus::Window* window) {
void UserWindowControllerImpl::RemoveObservers(::mus::Window* user_container) { void UserWindowControllerImpl::RemoveObservers(::mus::Window* user_container) {
user_container->RemoveObserver(this); user_container->RemoveObserver(this);
user_container->window_tree()->RemoveObserver(this); user_container->window_tree()->RemoveObserver(this);
for (auto iter : user_container->children()) for (auto* iter : user_container->children())
iter->RemoveObserver(window_property_observer_.get()); iter->RemoveObserver(window_property_observer_.get());
} }
......
...@@ -220,7 +220,7 @@ bool WindowManager::OnWmSetProperty( ...@@ -220,7 +220,7 @@ bool WindowManager::OnWmSetProperty(
void WindowManager::OnWmClientJankinessChanged( void WindowManager::OnWmClientJankinessChanged(
const std::set<::mus::Window*>& client_windows, const std::set<::mus::Window*>& client_windows,
bool janky) { bool janky) {
for (auto window : client_windows) for (auto* window : client_windows)
SetWindowIsJanky(window, janky); SetWindowIsJanky(window, janky);
} }
......
...@@ -1154,7 +1154,7 @@ TEST_F(ShelfLayoutManagerTest, DimmingBehaviorDualDisplay) { ...@@ -1154,7 +1154,7 @@ TEST_F(ShelfLayoutManagerTest, DimmingBehaviorDualDisplay) {
EXPECT_EQ(root_windows.size(), 2U); EXPECT_EQ(root_windows.size(), 2U);
std::vector<ShelfWidget*> shelf_widgets; std::vector<ShelfWidget*> shelf_widgets;
for (auto& root_window : root_windows) { for (auto* root_window : root_windows) {
ShelfLayoutManager* shelf = ShelfLayoutManager* shelf =
GetRootWindowController(root_window)->GetShelfLayoutManager(); GetRootWindowController(root_window)->GetShelfLayoutManager();
shelf_widgets.push_back(shelf->shelf_widget()); shelf_widgets.push_back(shelf->shelf_widget());
......
...@@ -173,7 +173,7 @@ ToastOverlayView::ToastOverlayView(ToastOverlay* overlay, ...@@ -173,7 +173,7 @@ ToastOverlayView::ToastOverlayView(ToastOverlay* overlay,
AddChildView(button_); AddChildView(button_);
auto layout = new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0); auto* layout = new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0);
SetLayoutManager(layout); SetLayoutManager(layout);
layout->SetFlexForView(label, 1); layout->SetFlexForView(label, 1);
layout->SetFlexForView(button_, 0); layout->SetFlexForView(button_, 0);
......
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