Home | History | Annotate | Download | only in app_list
      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 
     10 AppListControllerDelegateViews::AppListControllerDelegateViews(
     11     AppListServiceViews* service)
     12     : AppListControllerDelegateImpl(service),
     13       service_(service) {
     14 }
     15 
     16 AppListControllerDelegateViews::~AppListControllerDelegateViews() {}
     17 
     18 gfx::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 
     28 void AppListControllerDelegateViews::ViewClosing() {
     29   service_->OnViewBeingDestroyed();
     30 }
     31 
     32 void AppListControllerDelegateViews::OnShowChildDialog() {
     33   service_->set_can_dismiss(false);
     34 }
     35 
     36 void AppListControllerDelegateViews::OnCloseChildDialog() {
     37   service_->set_can_dismiss(true);
     38 }
     39 
     40 bool AppListControllerDelegateViews::CanDoCreateShortcutsFlow() {
     41   return true;
     42 }
     43