| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/chromeos/ui/idle_app_name_notification_view.h" | 5 #include "chrome/browser/chromeos/ui/idle_app_name_notification_view.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "ash/public/cpp/shell_window_ids.h" | 9 #include "ash/public/cpp/shell_window_ids.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 // Color of the window background. | 48 // Color of the window background. |
| 49 const SkColor kWindowBackgroundColor = SK_ColorWHITE; | 49 const SkColor kWindowBackgroundColor = SK_ColorWHITE; |
| 50 | 50 |
| 51 // Radius of the rounded corners of the window. | 51 // Radius of the rounded corners of the window. |
| 52 const int kWindowCornerRadius = 4; | 52 const int kWindowCornerRadius = 4; |
| 53 | 53 |
| 54 // Creates and shows the message widget for |view| with |animation_time_ms|. | 54 // Creates and shows the message widget for |view| with |animation_time_ms|. |
| 55 void CreateAndShowWidget(views::WidgetDelegateView* delegate, | 55 void CreateAndShowWidget(views::WidgetDelegateView* delegate, |
| 56 int animation_time_ms) { | 56 int animation_time_ms) { |
| 57 aura::Window* root_window = ash::Shell::GetTargetRootWindow(); | 57 aura::Window* root_window = ash::Shell::GetRootWindowForNewWindows(); |
| 58 gfx::Size rs = root_window->bounds().size(); | 58 gfx::Size rs = root_window->bounds().size(); |
| 59 gfx::Size ps = delegate->GetPreferredSize(); | 59 gfx::Size ps = delegate->GetPreferredSize(); |
| 60 gfx::Rect bounds((rs.width() - ps.width()) / 2, | 60 gfx::Rect bounds((rs.width() - ps.width()) / 2, |
| 61 -ps.height(), | 61 -ps.height(), |
| 62 ps.width(), | 62 ps.width(), |
| 63 ps.height()); | 63 ps.height()); |
| 64 views::Widget::InitParams params; | 64 views::Widget::InitParams params; |
| 65 params.type = views::Widget::InitParams::TYPE_POPUP; | 65 params.type = views::Widget::InitParams::TYPE_POPUP; |
| 66 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 66 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
| 67 params.ownership = views::Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET; | 67 params.ownership = views::Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET; |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 | 262 |
| 263 view_ = new IdleAppNameNotificationDelegateView( | 263 view_ = new IdleAppNameNotificationDelegateView( |
| 264 this, | 264 this, |
| 265 app_name, | 265 app_name, |
| 266 error, | 266 error, |
| 267 message_visibility_time_in_ms + animation_time_ms); | 267 message_visibility_time_in_ms + animation_time_ms); |
| 268 CreateAndShowWidget(view_, animation_time_ms); | 268 CreateAndShowWidget(view_, animation_time_ms); |
| 269 } | 269 } |
| 270 | 270 |
| 271 } // namespace chromeos | 271 } // namespace chromeos |
| OLD | NEW |