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

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: Comments addressed. 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..e2a5653930008154adf26f54b8d8d50683ec2912
--- /dev/null
+++ b/ash/first_run/first_run_delegate_impl.cc
@@ -0,0 +1,51 @@
+// 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/gfx/rect.h"
+#include "ui/views/view.h"
+
+namespace ash {
+
+FirstRunDelegateImpl::FirstRunDelegateImpl() {}
+
+void FirstRunDelegateImpl::OpenAppList() {
+ if (Shell::GetInstance()->GetAppListTargetVisibility())
+ return;
+ Shell::GetInstance()->ToggleAppList(NULL);
+}
+
+void FirstRunDelegateImpl::CloseAppList() {
+ if (!Shell::GetInstance()->GetAppListTargetVisibility())
+ return;
+ Shell::GetInstance()->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::GetInstance()->GetAppListView()) {
+ *result = view->GetBoundsInScreen();
+ return true;
+ }
+ return false;
+}
+
+} // namespace ash
+

Powered by Google App Engine
This is Rietveld 408576698