1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef ASH_TEST_TEST_SHELF_DELEGATE_H_
6 #define ASH_TEST_TEST_SHELF_DELEGATE_H_
11 #include "ash/shelf/shelf_delegate.h"
12 #include "base/compiler_specific.h"
13 #include "ui/aura/window_observer.h"
21 // Test implementation of ShelfDelegate.
22 // Tests may create icons for windows by calling AddShelfItem().
23 class TestShelfDelegate
: public ShelfDelegate
, public aura::WindowObserver
{
25 explicit TestShelfDelegate(ShelfModel
* model
);
26 ~TestShelfDelegate() override
;
28 void AddShelfItem(aura::Window
* window
);
29 void AddShelfItem(aura::Window
* window
, ShelfItemStatus status
);
30 void RemoveShelfItemForWindow(aura::Window
* window
);
32 static TestShelfDelegate
* instance() { return instance_
; }
34 // WindowObserver implementation
35 void OnWindowDestroying(aura::Window
* window
) override
;
36 void OnWindowHierarchyChanging(const HierarchyChangeParams
& params
) override
;
38 // ShelfDelegate implementation.
39 void OnShelfCreated(Shelf
* shelf
) override
;
40 void OnShelfDestroyed(Shelf
* shelf
) override
;
41 ShelfID
GetShelfIDForAppID(const std::string
& app_id
) override
;
42 const std::string
& GetAppIDForShelfID(ShelfID id
) override
;
43 void PinAppWithID(const std::string
& app_id
) override
;
44 bool CanPin() const override
;
45 bool IsAppPinned(const std::string
& app_id
) override
;
46 void UnpinAppWithID(const std::string
& app_id
) override
;
49 static TestShelfDelegate
* instance_
;
53 std::set
<std::string
> pinned_apps_
;
55 DISALLOW_COPY_AND_ASSIGN(TestShelfDelegate
);
61 #endif // ASH_TEST_TEST_SHELF_DELEGATE_H_