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

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

Issue 2726823003: Remove WmLookup. (Closed)
Patch Set: Clean up and rebase. Created 3 years, 9 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
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/common/system/toast/toast_overlay.h" 5 #include "ash/common/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/wm_lookup.h" 8 #include "ash/common/strings/grit/ash_strings.h"
sky 2017/03/02 23:49:57 Did you mean to add this include?
thanhph1 2017/03/03 16:29:53 I thought this was the result of the merge. I remo
9 #include "ash/common/wm_shell.h" 9 #include "ash/common/wm_shell.h"
10 #include "ash/common/wm_window.h" 10 #include "ash/common/wm_window.h"
11 #include "ash/public/cpp/shell_window_ids.h" 11 #include "ash/public/cpp/shell_window_ids.h"
12 #include "ash/root_window_controller.h" 12 #include "ash/root_window_controller.h"
13 #include "ash/strings/grit/ash_strings.h" 13 #include "ash/strings/grit/ash_strings.h"
14 #include "base/strings/string_util.h" 14 #include "base/strings/string_util.h"
15 #include "base/strings/utf_string_conversions.h" 15 #include "base/strings/utf_string_conversions.h"
16 #include "base/threading/thread_task_runner_handle.h" 16 #include "base/threading/thread_task_runner_handle.h"
17 #include "third_party/skia/include/core/SkColor.h" 17 #include "third_party/skia/include/core/SkColor.h"
18 #include "ui/base/l10n/l10n_util.h" 18 #include "ui/base/l10n/l10n_util.h"
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 WmShell::Get() 230 WmShell::Get()
231 ->GetRootWindowForNewWindows() 231 ->GetRootWindowForNewWindows()
232 ->GetRootWindowController() 232 ->GetRootWindowController()
233 ->ConfigureWidgetInitParamsForContainer( 233 ->ConfigureWidgetInitParamsForContainer(
234 overlay_widget_.get(), kShellWindowId_SystemModalContainer, &params); 234 overlay_widget_.get(), kShellWindowId_SystemModalContainer, &params);
235 overlay_widget_->Init(params); 235 overlay_widget_->Init(params);
236 overlay_widget_->SetVisibilityChangedAnimationsEnabled(true); 236 overlay_widget_->SetVisibilityChangedAnimationsEnabled(true);
237 overlay_widget_->SetContentsView(overlay_view_.get()); 237 overlay_widget_->SetContentsView(overlay_view_.get());
238 overlay_widget_->SetBounds(CalculateOverlayBounds()); 238 overlay_widget_->SetBounds(CalculateOverlayBounds());
239 239
240 WmWindow* overlay_window = 240 WmWindow* overlay_window = WmWindow::Get(overlay_widget_->GetNativeWindow());
241 WmLookup::Get()->GetWindowForWidget(overlay_widget_.get());
242 overlay_window->SetVisibilityAnimationType( 241 overlay_window->SetVisibilityAnimationType(
243 ::wm::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL); 242 ::wm::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL);
244 overlay_window->SetVisibilityAnimationDuration( 243 overlay_window->SetVisibilityAnimationDuration(
245 base::TimeDelta::FromMilliseconds(kSlideAnimationDurationMs)); 244 base::TimeDelta::FromMilliseconds(kSlideAnimationDurationMs));
246 } 245 }
247 246
248 ToastOverlay::~ToastOverlay() { 247 ToastOverlay::~ToastOverlay() {
249 overlay_widget_->Close(); 248 overlay_widget_->Close();
250 } 249 }
251 250
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 ToastOverlayButton* ToastOverlay::dismiss_button_for_testing() { 302 ToastOverlayButton* ToastOverlay::dismiss_button_for_testing() {
304 return overlay_view_->button(); 303 return overlay_view_->button();
305 } 304 }
306 305
307 void ToastOverlay::ClickDismissButtonForTesting(const ui::Event& event) { 306 void ToastOverlay::ClickDismissButtonForTesting(const ui::Event& event) {
308 DCHECK(overlay_view_->button()); 307 DCHECK(overlay_view_->button());
309 overlay_view_->button()->NotifyClick(event); 308 overlay_view_->button()->NotifyClick(event);
310 } 309 }
311 310
312 } // namespace ash 311 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698