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

Unified Diff: chrome/browser/chromeos/ui/kiosk_external_update_notification.cc

Issue 682183003: Make the kiosk code not depend on Ash in Athena (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@athena_do_not_use_ash42_accessibility
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
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_);

Powered by Google App Engine
This is Rietveld 408576698