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

Side by Side Diff: ash/shelf/shelf_delegate.h

Issue 1835403002: Support additional mash shelf alignments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ASH_SHELF_SHELF_DELEGATE_H_ 5 #ifndef ASH_SHELF_SHELF_DELEGATE_H_
6 #define ASH_SHELF_SHELF_DELEGATE_H_ 6 #define ASH_SHELF_SHELF_DELEGATE_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "ash/shelf/shelf_item_types.h" 9 #include "ash/shelf/shelf_item_types.h"
10 #include "ash/shelf/shelf_types.h"
10 11
11 namespace ash { 12 namespace ash {
12 class Shelf; 13 class Shelf;
13 14
14 // Delegate for the Shelf. 15 // Delegate for the Shelf.
15 class ASH_EXPORT ShelfDelegate { 16 class ASH_EXPORT ShelfDelegate {
16 public: 17 public:
17 // Shelf owns the delegate. 18 // Shelf owns the delegate.
18 virtual ~ShelfDelegate() {} 19 virtual ~ShelfDelegate() {}
19 20
20 // Callback used to allow delegate to perform initialization actions that 21 // Callback used to allow delegate to perform initialization actions that
21 // depend on the Shelf being in a known state. 22 // depend on the Shelf being in a known state.
22 virtual void OnShelfCreated(Shelf* shelf) = 0; 23 virtual void OnShelfCreated(Shelf* shelf) = 0;
23 24
24 // Callback used to inform the delegate that a specific shelf no longer 25 // Callback used to inform the delegate that a specific shelf was destroyed.
25 // exists.
26 virtual void OnShelfDestroyed(Shelf* shelf) = 0; 26 virtual void OnShelfDestroyed(Shelf* shelf) = 0;
27 27
28 // Callback used to inform the delegate of alignment changes.
29 virtual void OnAlignmentChanged(ShelfAlignment alignment) = 0;
30
31 // Callback used to inform the delegate of auto-hide behavior changes.
32 virtual void OnAutoHideBehaviorChanged(ShelfAutoHideBehavior auto_hide) = 0;
33
28 // Get the shelf ID from an application ID. 34 // Get the shelf ID from an application ID.
29 virtual ShelfID GetShelfIDForAppID(const std::string& app_id) = 0; 35 virtual ShelfID GetShelfIDForAppID(const std::string& app_id) = 0;
30 36
31 // Checks whether a mapping exists from the ShelfID |id| to an app id. 37 // Checks whether a mapping exists from the ShelfID |id| to an app id.
32 virtual bool HasShelfIDToAppIDMapping(ShelfID id) const = 0; 38 virtual bool HasShelfIDToAppIDMapping(ShelfID id) const = 0;
33 39
34 // Get the application ID for a given shelf ID. 40 // Get the application ID for a given shelf ID.
35 // |HasShelfIDToAppIDMapping(ShelfID)| should be called first to ensure the 41 // |HasShelfIDToAppIDMapping(ShelfID)| should be called first to ensure the
36 // ShelfID can be successfully mapped to an app id. 42 // ShelfID can be successfully mapped to an app id.
37 virtual const std::string& GetAppIDForShelfID(ShelfID id) = 0; 43 virtual const std::string& GetAppIDForShelfID(ShelfID id) = 0;
38 44
39 // Pins an app with |app_id| to shelf. A running instance will get pinned. 45 // Pins an app with |app_id| to shelf. A running instance will get pinned.
40 // In case there is no running instance a new shelf item is created and 46 // In case there is no running instance a new shelf item is created and
41 // pinned. 47 // pinned.
42 virtual void PinAppWithID(const std::string& app_id) = 0; 48 virtual void PinAppWithID(const std::string& app_id) = 0;
43 49
44 // Check if the app with |app_id_| is pinned to the shelf. 50 // Check if the app with |app_id_| is pinned to the shelf.
45 virtual bool IsAppPinned(const std::string& app_id) = 0; 51 virtual bool IsAppPinned(const std::string& app_id) = 0;
46 52
47 // Unpins app item with |app_id|. 53 // Unpins app item with |app_id|.
48 virtual void UnpinAppWithID(const std::string& app_id) = 0; 54 virtual void UnpinAppWithID(const std::string& app_id) = 0;
49 }; 55 };
50 56
51 } // namespace ash 57 } // namespace ash
52 58
53 #endif // ASH_SHELF_SHELF_DELEGATE_H_ 59 #endif // ASH_SHELF_SHELF_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698