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

Unified Diff: trunk/src/ash/shell/launcher_delegate_impl.cc

Issue 25716004: Revert 226547 "Refactor LauncherItemController and LauncherItemD..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « trunk/src/ash/shell/launcher_delegate_impl.h ('k') | trunk/src/ash/shell/window_watcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/ash/shell/launcher_delegate_impl.cc
===================================================================
--- trunk/src/ash/shell/launcher_delegate_impl.cc (revision 226578)
+++ trunk/src/ash/shell/launcher_delegate_impl.cc (working copy)
@@ -4,27 +4,67 @@
#include "ash/shell/launcher_delegate_impl.h"
+#include "ash/launcher/launcher_item_delegate_manager.h"
+#include "ash/shelf/shelf_util.h"
#include "ash/shell.h"
#include "ash/shell/toplevel_window.h"
#include "ash/shell/window_watcher.h"
#include "ash/wm/window_util.h"
#include "base/strings/string_util.h"
#include "grit/ash_resources.h"
+#include "ui/aura/window.h"
namespace ash {
namespace shell {
LauncherDelegateImpl::LauncherDelegateImpl(WindowWatcher* watcher)
: watcher_(watcher) {
+ ash::LauncherItemDelegateManager* manager =
+ ash::Shell::GetInstance()->launcher_item_delegate_manager();
+ manager->RegisterLauncherItemDelegate(ash::TYPE_APP_PANEL, this);
+ manager->RegisterLauncherItemDelegate(ash::TYPE_PLATFORM_APP, this);
}
LauncherDelegateImpl::~LauncherDelegateImpl() {
}
+void LauncherDelegateImpl::ItemSelected(const ash::LauncherItem& item,
+ const ui::Event& event) {
+ aura::Window* window = watcher_->GetWindowByID(item.id);
+ if (window->type() == aura::client::WINDOW_TYPE_PANEL)
+ ash::wm::MoveWindowToEventRoot(window, event);
+ window->Show();
+ ash::wm::ActivateWindow(window);
+}
+
+base::string16 LauncherDelegateImpl::GetTitle(const ash::LauncherItem& item) {
+ return watcher_->GetWindowByID(item.id)->title();
+}
+
+ui::MenuModel* LauncherDelegateImpl::CreateContextMenu(
+ const ash::LauncherItem& item,
+ aura::RootWindow* root_window) {
+ return NULL;
+}
+
+ash::LauncherMenuModel* LauncherDelegateImpl::CreateApplicationMenu(
+ const ash::LauncherItem& item,
+ int event_flags) {
+ return NULL;
+}
+
ash::LauncherID LauncherDelegateImpl::GetIDByWindow(aura::Window* window) {
return watcher_ ? watcher_->GetIDByWindow(window) : 0;
}
+bool LauncherDelegateImpl::IsDraggable(const ash::LauncherItem& item) {
+ return true;
+}
+
+bool LauncherDelegateImpl::ShouldShowTooltip(const ash::LauncherItem& item) {
+ return true;
+}
+
void LauncherDelegateImpl::OnLauncherCreated(Launcher* launcher) {
}
« no previous file with comments | « trunk/src/ash/shell/launcher_delegate_impl.h ('k') | trunk/src/ash/shell/window_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698