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

Unified Diff: ash/common/shelf/shelf_window_watcher_item_delegate.cc

Issue 2736573002: chromeos: Move files in //ash/common to //ash, part 2 (Closed)
Patch Set: Created 3 years, 9 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
Index: ash/common/shelf/shelf_window_watcher_item_delegate.cc
diff --git a/ash/common/shelf/shelf_window_watcher_item_delegate.cc b/ash/common/shelf/shelf_window_watcher_item_delegate.cc
deleted file mode 100644
index 01f4bd469afc7363230af6b68b7c9a0be0ef21e6..0000000000000000000000000000000000000000
--- a/ash/common/shelf/shelf_window_watcher_item_delegate.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright 2013 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/common/shelf/shelf_window_watcher_item_delegate.h"
-
-#include "ash/common/shelf/shelf_controller.h"
-#include "ash/common/shelf/shelf_model.h"
-#include "ash/common/wm/window_state.h"
-#include "ash/common/wm_shell.h"
-#include "ash/common/wm_window.h"
-#include "ash/public/cpp/window_properties.h"
-#include "ash/wm/window_util.h"
-#include "ui/aura/window.h"
-#include "ui/events/event_constants.h"
-
-namespace ash {
-
-namespace {
-
-ShelfItemType GetShelfItemType(ShelfID id) {
- ShelfModel* model = WmShell::Get()->shelf_controller()->model();
- ShelfItems::const_iterator item = model->ItemByID(id);
- return item == model->items().end() ? TYPE_UNDEFINED : item->type;
-}
-
-} // namespace
-
-ShelfWindowWatcherItemDelegate::ShelfWindowWatcherItemDelegate(ShelfID id,
- WmWindow* window)
- : id_(id), window_(window) {
- DCHECK_NE(kInvalidShelfID, id_);
- DCHECK(window_);
-}
-
-ShelfWindowWatcherItemDelegate::~ShelfWindowWatcherItemDelegate() {}
-
-ShelfAction ShelfWindowWatcherItemDelegate::ItemSelected(
- ui::EventType event_type,
- int event_flags,
- int64_t display_id,
- ShelfLaunchSource source) {
- // Move panels attached on another display to the current display.
- if (GetShelfItemType(id_) == TYPE_APP_PANEL &&
- window_->aura_window()->GetProperty(kPanelAttachedKey) &&
- wm::MoveWindowToDisplay(window_->aura_window(), display_id)) {
- window_->Activate();
- return SHELF_ACTION_WINDOW_ACTIVATED;
- }
-
- if (window_->IsActive()) {
- if (event_type == ui::ET_KEY_RELEASED) {
- window_->Animate(::wm::WINDOW_ANIMATION_TYPE_BOUNCE);
- return SHELF_ACTION_NONE;
- }
- window_->Minimize();
- return SHELF_ACTION_WINDOW_MINIMIZED;
- }
- window_->Activate();
- return SHELF_ACTION_WINDOW_ACTIVATED;
-}
-
-ShelfAppMenuItemList ShelfWindowWatcherItemDelegate::GetAppMenuItems(
- int event_flags) {
- // Return an empty item list to avoid showing an application menu.
- return ShelfAppMenuItemList();
-}
-
-void ShelfWindowWatcherItemDelegate::ExecuteCommand(uint32_t command_id,
- int event_flags) {
- // This delegate does not support showing an application menu.
- NOTIMPLEMENTED();
-}
-
-void ShelfWindowWatcherItemDelegate::Close() {
- window_->CloseWidget();
-}
-
-} // namespace ash
« no previous file with comments | « ash/common/shelf/shelf_window_watcher_item_delegate.h ('k') | ash/common/shelf/shelf_window_watcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698