Add LauncherItem for TaskManager Dialog

R=sky@chromium.org
BUG=121242
TEST=visual test

Review URL: https://codereview.chromium.org/132543003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245604 0039d316-1c4b-4281-b951-d872f2087c98
parent 08d0761f
......@@ -1235,8 +1235,9 @@ void ShelfView::FinalizeRipOffDrag(bool cancel) {
ShelfView::RemovableState ShelfView::RemovableByRipOff(int index) {
DCHECK(index >= 0 && index < model_->item_count());
LauncherItemType type = model_->items()[index].type;
if (type == TYPE_APP_LIST || !delegate_->CanPin())
if (type == TYPE_APP_LIST || type == TYPE_DIALOG || !delegate_->CanPin())
return NOT_REMOVABLE;
std::string app_id =
delegate_->GetAppIDForLauncherID(model_->items()[index].id);
// Note: Only pinned app shortcuts can be removed!
......
// Copyright 2014 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.
#include "ash/launcher/launcher_types.h"
#include "ash/shelf/shelf_item_types.h"
#include "ash/shelf/shelf_util.h"
void CreateShelfItemForDialog(int image_resource_id,
aura::Window* window) {
ash::ShelfItemDetails item_details;
item_details.type = ash::TYPE_DIALOG;
item_details.image_resource_id = image_resource_id;
item_details.title = window->title();
ash::SetShelfItemDetailsForWindow(window, item_details);
}
// Copyright 2014 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 CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_ITEM_UTIL_H_
#define CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_ITEM_UTIL_H_
#include "base/strings/string16.h"
namespace aura {
class Window;
}
// Creates an item on the shelf for |window|. The item is destroyed when the
// window is destroyed.
// TODO(simonhong): Move this function to NativeWidgetAura.
void CreateShelfItemForDialog(int image_resource_id,
aura::Window* window);
#endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_ITEM_UTIL_H_
......@@ -45,6 +45,8 @@
#if defined(USE_ASH)
#include "ash/wm/window_util.h"
#include "chrome/browser/ui/ash/launcher/launcher_item_util.h"
#include "grit/ash_resources.h"
#endif
#if defined(OS_WIN)
......@@ -524,6 +526,11 @@ void TaskManagerView::Show(Browser* browser) {
views::FocusManager* focus_manager = instance_->GetFocusManager();
if (focus_manager)
focus_manager->SetFocusedView(instance_->tab_table_);
#if defined(USE_ASH)
CreateShelfItemForDialog(IDR_AURA_LAUNCHER_ICON_TASK_MANAGER,
instance_->GetWidget()->GetNativeWindow());
#endif
}
// ButtonListener implementation.
......
......@@ -303,6 +303,8 @@
'browser/ui/ash/launcher/chrome_launcher_controller.h',
'browser/ui/ash/launcher/chrome_launcher_controller_chromeos.cc',
'browser/ui/ash/launcher/chrome_launcher_controller_win.cc',
'browser/ui/ash/launcher/launcher_application_menu_item_model.cc',
'browser/ui/ash/launcher/launcher_application_menu_item_model.h',
'browser/ui/ash/launcher/launcher_app_tab_helper.cc',
'browser/ui/ash/launcher/launcher_app_tab_helper.h',
'browser/ui/ash/launcher/launcher_context_menu.cc',
......@@ -311,8 +313,8 @@
'browser/ui/ash/launcher/launcher_favicon_loader.h',
'browser/ui/ash/launcher/launcher_item_controller.cc',
'browser/ui/ash/launcher/launcher_item_controller.h',
'browser/ui/ash/launcher/launcher_application_menu_item_model.cc',
'browser/ui/ash/launcher/launcher_application_menu_item_model.h',
'browser/ui/ash/launcher/launcher_item_util.cc',
'browser/ui/ash/launcher/launcher_item_util.h',
'browser/ui/ash/launcher/multi_profile_browser_status_monitor.cc',
'browser/ui/ash/launcher/multi_profile_browser_status_monitor.h',
'browser/ui/ash/launcher/multi_profile_shell_window_launcher_controller.cc',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment