diff options
Diffstat (limited to 'ash/shell_delegate.h')
-rw-r--r-- | ash/shell_delegate.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/ash/shell_delegate.h b/ash/shell_delegate.h new file mode 100644 index 0000000..bf73c5e --- /dev/null +++ b/ash/shell_delegate.h @@ -0,0 +1,67 @@ +// Copyright (c) 2011 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. + +#ifndef ASH_SHELL_DELEGATE_H_ +#define ASH_SHELL_DELEGATE_H_ +#pragma once + +#include "base/callback.h" +#include "ash/ash_export.h" + +namespace gfx { +class Rect; +} + +namespace views { +class Widget; +} + +namespace aura_shell { + +class AppListModel; +class AppListViewDelegate; +struct LauncherItem; + +// Delegate of the Shell. +class ASH_EXPORT ShellDelegate { + public: + // Callback to pass back a widget used by RequestAppListWidget. + typedef base::Callback<void(views::Widget*)> SetWidgetCallback; + + // The Shell owns the delegate. + virtual ~ShellDelegate() {} + + // Invoked when the user clicks on button in the launcher to create a new + // window. + virtual void CreateNewWindow() = 0; + + // Invoked to create a new status area. Can return NULL. + virtual views::Widget* CreateStatusArea() = 0; + + // Invoked to create app list widget. The Delegate calls the callback + // when the widget is ready to show. + // Deprecated. + // TODO(xiyuan): Clean this up when switching to views app list. + virtual void RequestAppListWidget( + const gfx::Rect& bounds, + const SetWidgetCallback& callback) = 0; + + // Invoked to ask the delegate to populate the |model|. + virtual void BuildAppListModel(AppListModel* model) = 0; + + // Invoked to create an AppListViewDelegate. Shell takes the ownership of + // the created delegate. + virtual AppListViewDelegate* CreateAppListViewDelegate() = 0; + + // Invoked when the user clicks on a window entry in the launcher. + virtual void LauncherItemClicked(const LauncherItem& item) = 0; + + // Invoked when a window is added. If the delegate wants the launcher to show + // an entry for |item->window| it should configure |item| appropriately and + // return true. + virtual bool ConfigureLauncherItem(LauncherItem* item) = 0; +}; +} // namespace aura_shell + +#endif // ASH_SHELL_DELEGATE_H_ |