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

Unified Diff: ash/first_run/first_run_helper_impl.cc

Issue 26277006: Created ash::FirstRunHelper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. 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
« no previous file with comments | « ash/first_run/first_run_helper_impl.h ('k') | ash/shell.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/first_run/first_run_helper_impl.cc
diff --git a/ash/first_run/first_run_helper_impl.cc b/ash/first_run/first_run_helper_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7ef16a516fe9a3d22ecbe1c68a7879df3e4a18c1
--- /dev/null
+++ b/ash/first_run/first_run_helper_impl.cc
@@ -0,0 +1,49 @@
+// 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_helper_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/gfx/rect.h"
+#include "ui/views/view.h"
+
+namespace ash {
+
+FirstRunHelperImpl::FirstRunHelperImpl() {}
+
+void FirstRunHelperImpl::OpenAppList() {
+ if (Shell::GetInstance()->GetAppListTargetVisibility())
+ return;
+ Shell::GetInstance()->ToggleAppList(NULL);
+}
+
+void FirstRunHelperImpl::CloseAppList() {
+ if (!Shell::GetInstance()->GetAppListTargetVisibility())
+ return;
+ Shell::GetInstance()->ToggleAppList(NULL);
+}
+
+gfx::Rect FirstRunHelperImpl::GetLauncherBounds() {
+ ash::Launcher* launcher = ash::Launcher::ForPrimaryDisplay();
+ return launcher->GetVisibleItemsBoundsInScreen();
+}
+
+gfx::Rect FirstRunHelperImpl::GetAppListButtonBounds() {
+ ash::Launcher* launcher = ash::Launcher::ForPrimaryDisplay();
+ views::View* app_button = launcher->GetAppListButtonView();
+ return app_button->GetBoundsInScreen();
+}
+
+gfx::Rect FirstRunHelperImpl::GetAppListBounds() {
+ app_list::AppListView* view = Shell::GetInstance()->GetAppListView();
+ CHECK(view);
+ return view->GetBoundsInScreen();
+}
+
+} // namespace ash
+
« no previous file with comments | « ash/first_run/first_run_helper_impl.h ('k') | ash/shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698