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 |
+ |