summaryrefslogtreecommitdiffstats
path: root/ash/shelf
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-13 00:59:19 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-13 00:59:19 +0000
commita038ebcc3d16e04fe588b5ac98d2647a020e7f5c (patch)
tree1ec500c9a86c8d79beadfcac89fa0f578c10d553 /ash/shelf
parentf7367d42b9805f66040a44c8d4c4362edaa1f63e (diff)
downloadchromium_src-a038ebcc3d16e04fe588b5ac98d2647a020e7f5c.zip
chromium_src-a038ebcc3d16e04fe588b5ac98d2647a020e7f5c.tar.gz
chromium_src-a038ebcc3d16e04fe588b5ac98d2647a020e7f5c.tar.bz2
ash: Rename LauncherModelObserver to ShelfModelObserver.
- move launcher_model_observer.h from launcher/ to shelf/ - rename to shelf_model_observer.h BUG=248353 TEST=None, no functional changes R=harrym@chromium.org,jamescook@chromium.org Review URL: https://codereview.chromium.org/68243002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234686 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shelf')
-rw-r--r--ash/shelf/shelf_model_observer.h41
-rw-r--r--ash/shelf/shelf_view.cc14
-rw-r--r--ash/shelf/shelf_view.h18
3 files changed, 57 insertions, 16 deletions
diff --git a/ash/shelf/shelf_model_observer.h b/ash/shelf/shelf_model_observer.h
new file mode 100644
index 0000000..46df44e
--- /dev/null
+++ b/ash/shelf/shelf_model_observer.h
@@ -0,0 +1,41 @@
+// 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_SHELF_SHELF_MODEL_OBSERVER_H_
+#define ASH_SHELF_SHELF_MODEL_OBSERVER_H_
+
+#include "ash/ash_export.h"
+#include "ash/launcher/launcher_types.h"
+
+namespace ash {
+
+struct LauncherItem;
+
+class ASH_EXPORT ShelfModelObserver {
+ public:
+ // Invoked after an item has been added to the model.
+ virtual void ShelfItemAdded(int index) = 0;
+
+ // Invoked after an item has been removed. |index| is the index the item was
+ // at.
+ virtual void ShelfItemRemoved(int index, LauncherID id) = 0;
+
+ // Invoked after an item has been moved. See LauncherModel::Move() for details
+ // of the arguments.
+ virtual void ShelfItemMoved(int start_index, int target_index) = 0;
+
+ // Invoked when the state of an item changes. |old_item| is the item
+ // before the change.
+ virtual void ShelfItemChanged(int index, const LauncherItem& old_item) = 0;
+
+ // Invoked when shelf status is changed.
+ virtual void ShelfStatusChanged() = 0;
+
+ protected:
+ virtual ~ShelfModelObserver() {}
+};
+
+} // namespace ash
+
+#endif // ASH_SHELF_SHELF_MODEL_OBSERVER_H_
diff --git a/ash/shelf/shelf_view.cc b/ash/shelf/shelf_view.cc
index 56b8a60..811dd71 100644
--- a/ash/shelf/shelf_view.cc
+++ b/ash/shelf/shelf_view.cc
@@ -429,7 +429,7 @@ void ShelfView::Init() {
view_model_->Add(child, static_cast<int>(i - items.begin()));
AddChildView(child);
}
- LauncherStatusChanged();
+ ShelfStatusChanged();
overflow_button_ = new OverflowButton(this);
overflow_button_->set_context_menu_controller(this);
ConfigureChildView(overflow_button_);
@@ -1416,7 +1416,7 @@ void ShelfView::OnGestureEvent(ui::GestureEvent* event) {
event->StopPropagation();
}
-void ShelfView::LauncherItemAdded(int model_index) {
+void ShelfView::ShelfItemAdded(int model_index) {
{
base::AutoReset<bool> cancelling_drag(
&cancelling_drag_model_changed_, true);
@@ -1452,7 +1452,7 @@ void ShelfView::LauncherItemAdded(int model_index) {
}
}
-void ShelfView::LauncherItemRemoved(int model_index, LauncherID id) {
+void ShelfView::ShelfItemRemoved(int model_index, LauncherID id) {
if (id == context_menu_id_)
launcher_menu_runner_.reset();
{
@@ -1492,8 +1492,8 @@ void ShelfView::LauncherItemRemoved(int model_index, LauncherID id) {
tooltip_->Close();
}
-void ShelfView::LauncherItemChanged(int model_index,
- const ash::LauncherItem& old_item) {
+void ShelfView::ShelfItemChanged(int model_index,
+ const LauncherItem& old_item) {
const LauncherItem& item(model_->items()[model_index]);
if (old_item.type != item.type) {
// Type changed, swap the views.
@@ -1537,7 +1537,7 @@ void ShelfView::LauncherItemChanged(int model_index,
}
}
-void ShelfView::LauncherItemMoved(int start_index, int target_index) {
+void ShelfView::ShelfItemMoved(int start_index, int target_index) {
view_model_->Move(start_index, target_index);
// When cancelling a drag due to a launcher item being added, the currently
// dragged item is moved back to its initial position. AnimateToIdealBounds
@@ -1547,7 +1547,7 @@ void ShelfView::LauncherItemMoved(int start_index, int target_index) {
AnimateToIdealBounds();
}
-void ShelfView::LauncherStatusChanged() {
+void ShelfView::ShelfStatusChanged() {
if (ash::switches::UseAlternateShelfLayout())
return;
AppListButton* app_list_button =
diff --git a/ash/shelf/shelf_view.h b/ash/shelf/shelf_view.h
index 9723809..250ba3b 100644
--- a/ash/shelf/shelf_view.h
+++ b/ash/shelf/shelf_view.h
@@ -8,8 +8,8 @@
#include <utility>
#include <vector>
-#include "ash/launcher/launcher_model_observer.h"
#include "ash/shelf/shelf_button_host.h"
+#include "ash/shelf/shelf_model_observer.h"
#include "ash/wm/gestures/shelf_gesture_handler.h"
#include "base/observer_list.h"
#include "ui/app_list/views/app_list_drag_and_drop_host.h"
@@ -48,7 +48,7 @@ class ShelfLayoutManager;
class ShelfTooltipManager;
class ASH_EXPORT ShelfView : public views::View,
- public LauncherModelObserver,
+ public ShelfModelObserver,
public views::ButtonListener,
public ShelfButtonHost,
public views::ContextMenuController,
@@ -247,13 +247,13 @@ class ASH_EXPORT ShelfView : public views::View,
// Overridden from ui::EventHandler:
virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE;
- // Overridden from LauncherModelObserver:
- virtual void LauncherItemAdded(int model_index) OVERRIDE;
- virtual void LauncherItemRemoved(int model_index, LauncherID id) OVERRIDE;
- virtual void LauncherItemChanged(int model_index,
- const ash::LauncherItem& old_item) OVERRIDE;
- virtual void LauncherItemMoved(int start_index, int target_index) OVERRIDE;
- virtual void LauncherStatusChanged() OVERRIDE;
+ // Overridden from ShelfModelObserver:
+ virtual void ShelfItemAdded(int model_index) OVERRIDE;
+ virtual void ShelfItemRemoved(int model_index, LauncherID id) OVERRIDE;
+ virtual void ShelfItemChanged(int model_index,
+ const LauncherItem& old_item) OVERRIDE;
+ virtual void ShelfItemMoved(int start_index, int target_index) OVERRIDE;
+ virtual void ShelfStatusChanged() OVERRIDE;
// Overridden from ShelfButtonHost:
virtual void PointerPressedOnButton(views::View* view,