1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ash/first_run/first_run_helper_impl.h"
7 #include "ash/launcher/launcher.h"
9 #include "base/logging.h"
10 #include "ui/app_list/views/app_list_view.h"
11 #include "ui/aura/window.h"
12 #include "ui/gfx/rect.h"
13 #include "ui/views/view.h"
17 FirstRunHelperImpl::FirstRunHelperImpl() {}
19 void FirstRunHelperImpl::OpenAppList() {
20 if (Shell::GetInstance()->GetAppListTargetVisibility())
22 Shell::GetInstance()->ToggleAppList(NULL);
25 void FirstRunHelperImpl::CloseAppList() {
26 if (!Shell::GetInstance()->GetAppListTargetVisibility())
28 Shell::GetInstance()->ToggleAppList(NULL);
31 gfx::Rect FirstRunHelperImpl::GetLauncherBounds() {
32 ash::Launcher* launcher = ash::Launcher::ForPrimaryDisplay();
33 return launcher->GetVisibleItemsBoundsInScreen();
36 gfx::Rect FirstRunHelperImpl::GetAppListButtonBounds() {
37 ash::Launcher* launcher = ash::Launcher::ForPrimaryDisplay();
38 views::View* app_button = launcher->GetAppListButtonView();
39 return app_button->GetBoundsInScreen();
42 gfx::Rect FirstRunHelperImpl::GetAppListBounds() {
43 app_list::AppListView* view = Shell::GetInstance()->GetAppListView();
45 return view->GetBoundsInScreen();