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

Unified Diff: ash/launcher/launcher_item_delegate.h

Issue 22429004: Refactor LauncherDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for OpenBrowserUsingShelfOnOhterDisplay fail Created 7 years, 4 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/launcher/launcher_item_delegate.h
diff --git a/ash/launcher/launcher_delegate.h b/ash/launcher/launcher_item_delegate.h
similarity index 62%
copy from ash/launcher/launcher_delegate.h
copy to ash/launcher/launcher_item_delegate.h
index 6afbe765b97cded4f9cf833d6b17d5f9dae0686a..e1d940d509b7571a157cc83d58a06bd7b84daa45 100644
--- a/ash/launcher/launcher_delegate.h
+++ b/ash/launcher/launcher_item_delegate.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// 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.
-#ifndef ASH_LAUNCHER_LAUNCHER_DELEGATE_H_
-#define ASH_LAUNCHER_LAUNCHER_DELEGATE_H_
+#ifndef ASH_LAUNCHER_LAUNCHER_ITEM_DELEGATE_H_
+#define ASH_LAUNCHER_LAUNCHER_ITEM_DELEGATE_H_
#include "ash/ash_export.h"
#include "ash/launcher/launcher_types.h"
@@ -19,7 +19,6 @@ class Event;
}
namespace ash {
-class Launcher;
// A special menu model which keeps track of an "active" menu item.
class ASH_EXPORT LauncherMenuModel : public ui::SimpleMenuModel {
@@ -35,11 +34,11 @@ class ASH_EXPORT LauncherMenuModel : public ui::SimpleMenuModel {
DISALLOW_COPY_AND_ASSIGN(LauncherMenuModel);
};
-// Delegate for the Launcher.
-class ASH_EXPORT LauncherDelegate {
+// Delegate for the LauncherItem.
+// TODO(simon.hong81): Remove LauncherItem from abstract function parameters.
+class ASH_EXPORT LauncherItemDelegate {
public:
- // Launcher owns the delegate.
- virtual ~LauncherDelegate() {}
+ virtual ~LauncherItemDelegate() {}
// Invoked when the user clicks on a window entry in the launcher.
// |event| is the click event. The |event| is dispatched by a view
@@ -72,44 +71,13 @@ class ASH_EXPORT LauncherDelegate {
const LauncherItem& item,
int event_flags) = 0;
- // Returns the id of the item associated with the specified window, or 0 if
- // there isn't one.
- // Note: Windows of tabbed browsers will return the |LauncherID| of the
- // currently active tab or selected tab.
- virtual LauncherID GetIDByWindow(aura::Window* window) = 0;
-
// Whether the given launcher item is draggable.
virtual bool IsDraggable(const LauncherItem& item) = 0;
// Returns true if a tooltip should be shown for the item.
virtual bool ShouldShowTooltip(const LauncherItem& item) = 0;
-
- // Callback used to allow delegate to perform initialization actions that
- // depend on the Launcher being in a known state.
- virtual void OnLauncherCreated(Launcher* launcher) = 0;
-
- // Callback used to inform the delegate that a specific launcher no longer
- // exists.
- virtual void OnLauncherDestroyed(Launcher* launcher) = 0;
-
- // Get the launcher ID from an application ID.
- virtual LauncherID GetLauncherIDForAppID(const std::string& app_id) = 0;
-
- // Get the application ID for a given launcher ID.
- virtual const std::string& GetAppIDForLauncherID(LauncherID id) = 0;
-
- // Pins an app with |app_id| to launcher. A running instance will get pinned.
- // In case there is no running instance a new launcher item is created and
- // pinned.
- virtual void PinAppWithID(const std::string& app_id) = 0;
-
- // Check if the app with |app_id_| is pinned to the launcher.
- virtual bool IsAppPinned(const std::string& app_id) = 0;
-
- // Unpins app item with |app_id|.
- virtual void UnpinAppWithID(const std::string& app_id) = 0;
};
} // namespace ash
-#endif // ASH_LAUNCHER_LAUNCHER_DELEGATE_H_
+#endif // ASH_LAUNCHER_LAUNCHER_ITEM_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698