app_list_controller_delegate_views.cc revision f8ee788a64d60abd8f2d742a5fdedde054ecd910
1// Copyright 2014 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 "chrome/browser/ui/app_list/app_list_controller_delegate_views.h"
6
7#include "chrome/browser/ui/app_list/app_list_service_views.h"
8#include "ui/app_list/views/app_list_view.h"
9
10AppListControllerDelegateViews::AppListControllerDelegateViews(
11    AppListServiceViews* service)
12    : AppListControllerDelegateImpl(service),
13      service_(service) {
14}
15
16AppListControllerDelegateViews::~AppListControllerDelegateViews() {}
17
18gfx::Rect AppListControllerDelegateViews::GetAppListBounds() {
19  // We use the bounds of the app list view here because the bounds of the app
20  // list window include the shadow behind it (and the shadow size varies across
21  // platforms).
22  app_list::AppListView* app_list_view = service_->shower().app_list();
23  if (app_list_view)
24    return app_list_view->GetBoundsInScreen();
25  return gfx::Rect();
26}
27
28void AppListControllerDelegateViews::ViewClosing() {
29  service_->OnViewBeingDestroyed();
30}
31
32void AppListControllerDelegateViews::OnShowChildDialog() {
33  service_->set_can_dismiss(false);
34}
35
36void AppListControllerDelegateViews::OnCloseChildDialog() {
37  service_->set_can_dismiss(true);
38}
39
40bool AppListControllerDelegateViews::CanDoCreateShortcutsFlow() {
41  return true;
42}
43