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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 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.
4
5 #include "ash/first_run/first_run_delegate_impl.h"
6
7 #include "ash/launcher/launcher.h"
8 #include "ash/shell.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"
14
15 namespace ash {
16
17 FirstRunDelegateImpl::FirstRunDelegateImpl() {}
18
19 void FirstRunDelegateImpl::OpenAppList() {
20 if (Shell::GetInstance()->GetAppListTargetVisibility())
21 return;
22 Shell::GetInstance()->ToggleAppList(NULL);
23 }
24
25 void FirstRunDelegateImpl::CloseAppList() {
26 if (!Shell::GetInstance()->GetAppListTargetVisibility())
27 return;
28 Shell::GetInstance()->ToggleAppList(NULL);
29 }
30
31 gfx::Rect FirstRunDelegateImpl::GetLauncherBounds() {
32 ash::Launcher* launcher = ash::Launcher::ForPrimaryDisplay();
33 return launcher->GetVisibleItemsBoundsInScreen();
34 }
35
36 gfx::Rect FirstRunDelegateImpl::GetAppListButtonBounds() {
37 ash::Launcher* launcher = ash::Launcher::ForPrimaryDisplay();
38 views::View* app_button = launcher->GetAppListButtonView();
39 return app_button->GetBoundsInScreen();
40 }
41
42 bool FirstRunDelegateImpl::GetAppListBounds(gfx::Rect* result) {
43 if (app_list::AppListView* view = Shell::GetInstance()->GetAppListView()) {
44 *result = view->GetBoundsInScreen();
45 return true;
46 }
47 return false;
48 }
49
50 } // namespace ash
51
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698