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

Side by Side Diff: ash/system/toast/toast_overlay.cc

Issue 2110643002: ash: Change auto to not deduce raw pointers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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/shelf/shelf_layout_manager_unittest.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/system/toast/toast_overlay.h" 5 #include "ash/system/toast/toast_overlay.h"
6 6
7 #include "ash/common/shelf/wm_shelf.h" 7 #include "ash/common/shelf/wm_shelf.h"
8 #include "ash/common/shell_window_ids.h" 8 #include "ash/common/shell_window_ids.h"
9 #include "ash/common/wm_root_window_controller.h" 9 #include "ash/common/wm_root_window_controller.h"
10 #include "ash/common/wm_shell.h" 10 #include "ash/common/wm_shell.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 ? l10n_util::GetStringUTF16(IDS_ASH_TOAST_DISMISS_BUTTON) 166 ? l10n_util::GetStringUTF16(IDS_ASH_TOAST_DISMISS_BUTTON)
167 : base::UTF8ToUTF16(dismiss_text))) { 167 : base::UTF8ToUTF16(dismiss_text))) {
168 ToastOverlayLabel* label = new ToastOverlayLabel(text); 168 ToastOverlayLabel* label = new ToastOverlayLabel(text);
169 label->SetMaximumWidth( 169 label->SetMaximumWidth(
170 GetMaximumSize().width() - button_->GetPreferredSize().width() - 170 GetMaximumSize().width() - button_->GetPreferredSize().width() -
171 kToastHorizontalSpacing * 2 - kToastHorizontalSpacing * 2); 171 kToastHorizontalSpacing * 2 - kToastHorizontalSpacing * 2);
172 AddChildView(label); 172 AddChildView(label);
173 173
174 AddChildView(button_); 174 AddChildView(button_);
175 175
176 auto layout = new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0); 176 auto* layout = new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0);
177 SetLayoutManager(layout); 177 SetLayoutManager(layout);
178 layout->SetFlexForView(label, 1); 178 layout->SetFlexForView(label, 1);
179 layout->SetFlexForView(button_, 0); 179 layout->SetFlexForView(button_, 0);
180 } 180 }
181 181
182 ToastOverlayView::~ToastOverlayView() {} 182 ToastOverlayView::~ToastOverlayView() {}
183 183
184 void ToastOverlayView::OnPaint(gfx::Canvas* canvas) { 184 void ToastOverlayView::OnPaint(gfx::Canvas* canvas) {
185 SkPaint paint; 185 SkPaint paint;
186 paint.setStyle(SkPaint::kFill_Style); 186 paint.setStyle(SkPaint::kFill_Style);
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 287
288 views::Widget* ToastOverlay::widget_for_testing() { 288 views::Widget* ToastOverlay::widget_for_testing() {
289 return overlay_widget_.get(); 289 return overlay_widget_.get();
290 } 290 }
291 291
292 void ToastOverlay::ClickDismissButtonForTesting(const ui::Event& event) { 292 void ToastOverlay::ClickDismissButtonForTesting(const ui::Event& event) {
293 overlay_view_->button()->NotifyClick(event); 293 overlay_view_->button()->NotifyClick(event);
294 } 294 }
295 295
296 } // namespace ash 296 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/shelf_layout_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698