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

Unified Diff: ash/first_run/first_run_delegate_impl.cc

Issue 26277006: Created ash::FirstRunHelper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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: ash/first_run/first_run_delegate_impl.cc
diff --git a/ash/first_run/first_run_delegate_impl.cc b/ash/first_run/first_run_delegate_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ab9a2671df1809ce419604b951a71dd30c6ee11f
--- /dev/null
+++ b/ash/first_run/first_run_delegate_impl.cc
@@ -0,0 +1,52 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ash/first_run/first_run_delegate_impl.h"
+
+#include "ash/launcher/launcher.h"
+#include "ash/shell.h"
+#include "base/logging.h"
+#include "ui/app_list/views/app_list_view.h"
+#include "ui/aura/window.h"
+#include "ui/views/view.h"
+
+namespace ash {
+
+FirstRunDelegateImpl::FirstRunDelegateImpl()
+ : shell_(Shell::GetInstance())
+{}
+
+void FirstRunDelegateImpl::OpenAppList() {
+ if (shell_->GetAppListTargetVisibility())
+ return;
+ shell_->ToggleAppList(NULL);
+}
+
+void FirstRunDelegateImpl::CloseAppList() {
+ if (!shell_->GetAppListTargetVisibility())
+ return;
+ shell_->ToggleAppList(NULL);
+}
+
+gfx::Rect FirstRunDelegateImpl::GetLauncherBounds() {
+ ash::Launcher* launcher = ash::Launcher::ForPrimaryDisplay();
+ return launcher->GetVisibleItemsBoundsInScreen();
+}
+
+gfx::Rect FirstRunDelegateImpl::GetAppListButtonBounds() {
+ ash::Launcher* launcher = ash::Launcher::ForPrimaryDisplay();
+ views::View* app_button = launcher->GetAppListButtonView();
+ return app_button->GetBoundsInScreen();
+}
+
+bool FirstRunDelegateImpl::GetAppListBounds(gfx::Rect* result) {
+ if (app_list::AppListView* view = shell_->GetAppListView()) {
Mr4D (OOO till 08-26) 2013/10/10 20:02:34 Is there a particular reason why you are not using
dzhioev (left Google) 2013/10/10 20:51:11 Because AppList window is much bigger than AppList
oshima 2013/10/10 22:47:18 I didn't quite understand as there are many orange
dzhioev (left Google) 2013/10/11 18:03:52 I've marked AppList window with red (same link as
oshima 2013/10/11 18:33:31 Ok, this seems to be because bubbble window render
+ *result = view->GetBoundsInScreen();
+ return true;
+ }
+ return false;
+}
+
+} // namespace ash
+

Powered by Google App Engine
This is Rietveld 408576698