Index: chrome/browser/chromeos/ui/kiosk_external_update_notification.cc |
diff --git a/chrome/browser/chromeos/ui/kiosk_external_update_notification.cc b/chrome/browser/chromeos/ui/kiosk_external_update_notification.cc |
index 71d4fdf9c7f9482070f10a19d0b527356a722c54..4fa9cdb03ea3dd719acedf36815929fc5527ffe7 100644 |
--- a/chrome/browser/chromeos/ui/kiosk_external_update_notification.cc |
+++ b/chrome/browser/chromeos/ui/kiosk_external_update_notification.cc |
@@ -4,8 +4,6 @@ |
#include "chrome/browser/chromeos/ui/kiosk_external_update_notification.h" |
-#include "ash/shell.h" |
-#include "ash/shell_window_ids.h" |
#include "ui/aura/window.h" |
#include "ui/base/resource/resource_bundle.h" |
#include "ui/compositor/layer.h" |
@@ -17,6 +15,11 @@ |
#include "ui/views/widget/widget.h" |
#include "ui/views/widget/widget_delegate.h" |
+#if defined(USE_ASH) |
+#include "ash/shell.h" |
+#include "ash/shell_window_ids.h" |
+#endif |
+ |
namespace chromeos { |
namespace { |
@@ -120,8 +123,17 @@ void KioskExternalUpdateNotification::CreateAndShowNotificationView( |
view_ = new KioskExternalUpdateNotificationView(this); |
view_->SetMessage(message); |
+ gfx::Size rs; |
Jun Mukai
2014/10/29 01:03:27
how about CHECK(ash::Shell::HasInstance()) ?
|
+ aura::Window* parent = NULL; |
+#if defined(USE_ASH) |
aura::Window* root_window = ash::Shell::GetTargetRootWindow(); |
- gfx::Size rs = root_window->bounds().size(); |
+ rs = root_window->bounds().size(); |
+ parent = ash::Shell::GetContainer(root_window, |
+ ash::kShellWindowId_SettingBubbleContainer); |
+#else |
+ NOTREACHED(); |
+#endif |
+ |
gfx::Size ps = view_->GetPreferredSize(); |
gfx::Rect bounds((rs.width() - ps.width()) / 2, |
(rs.height() - ps.height()) / 10, |
@@ -136,8 +148,7 @@ void KioskExternalUpdateNotification::CreateAndShowNotificationView( |
params.remove_standard_frame = true; |
params.delegate = view_; |
params.bounds = bounds; |
- params.parent = ash::Shell::GetContainer( |
- root_window, ash::kShellWindowId_SettingBubbleContainer); |
+ params.parent = parent; |
views::Widget* widget = new views::Widget; |
widget->Init(params); |
widget->SetContentsView(view_); |