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

Unified Diff: ash/shell/launcher_delegate_impl.cc

Issue 23606016: Refactor LauncherItemController and LauncherItemDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix for unittest.. 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 | « ash/shell/launcher_delegate_impl.h ('k') | ash/shell/window_watcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shell/launcher_delegate_impl.cc
diff --git a/ash/shell/launcher_delegate_impl.cc b/ash/shell/launcher_delegate_impl.cc
index 882431c21839fa0e330c7c5239fe08539b443ea1..4ec47ae598c21dccd7e30aeb7910ecf208509104 100644
--- a/ash/shell/launcher_delegate_impl.cc
+++ b/ash/shell/launcher_delegate_impl.cc
@@ -4,67 +4,27 @@
#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 | « ash/shell/launcher_delegate_impl.h ('k') | ash/shell/window_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698