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

Side by Side Diff: ash/mus/shelf_delegate_mus.h

Issue 2007003002: mash: Preliminary support for shelf auto-hide (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shutdown
Patch Set: cleanup Created 4 years, 7 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
« no previous file with comments | « no previous file | ash/mus/shelf_delegate_mus.cc » ('j') | ash/shelf/shelf_button.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_MUS_SHELF_DELEGATE_MUS_H_ 5 #ifndef ASH_MUS_SHELF_DELEGATE_MUS_H_
6 #define ASH_MUS_SHELF_DELEGATE_MUS_H_ 6 #define ASH_MUS_SHELF_DELEGATE_MUS_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "ash/shelf/shelf_delegate.h" 10 #include "ash/shelf/shelf_delegate.h"
11 #include "ash/shelf/shelf_layout_manager_observer.h"
11 #include "mash/shelf/public/interfaces/shelf.mojom.h" 12 #include "mash/shelf/public/interfaces/shelf.mojom.h"
12 #include "mash/wm/public/interfaces/shelf_layout.mojom.h" 13 #include "mash/wm/public/interfaces/shelf_layout.mojom.h"
13 #include "mash/wm/public/interfaces/user_window_controller.mojom.h" 14 #include "mash/wm/public/interfaces/user_window_controller.mojom.h"
14 #include "mojo/public/cpp/bindings/binding.h" 15 #include "mojo/public/cpp/bindings/binding.h"
15 #include "mojo/public/cpp/bindings/interface_ptr_set.h" 16 #include "mojo/public/cpp/bindings/interface_ptr_set.h"
16 17
17 namespace ash { 18 namespace ash {
18 19
19 class ShelfModel; 20 class ShelfModel;
20 21
21 namespace sysui { 22 namespace sysui {
22 23
24 // Manages communication between the ash_sysui shelf, the window manager, and
25 // the browser.
23 class ShelfDelegateMus : public ShelfDelegate, 26 class ShelfDelegateMus : public ShelfDelegate,
27 public ShelfLayoutManagerObserver,
24 public mash::shelf::mojom::ShelfController, 28 public mash::shelf::mojom::ShelfController,
25 public mash::wm::mojom::UserWindowObserver { 29 public mash::wm::mojom::UserWindowObserver {
26 public: 30 public:
27 explicit ShelfDelegateMus(ShelfModel* model); 31 explicit ShelfDelegateMus(ShelfModel* model);
28 ~ShelfDelegateMus() override; 32 ~ShelfDelegateMus() override;
29 33
30 private: 34 private:
31 // ShelfDelegate: 35 // ShelfDelegate:
32 void OnShelfCreated(Shelf* shelf) override; 36 void OnShelfCreated(Shelf* shelf) override;
33 void OnShelfDestroyed(Shelf* shelf) override; 37 void OnShelfDestroyed(Shelf* shelf) override;
34 void OnShelfAlignmentChanged(Shelf* shelf) override; 38 void OnShelfAlignmentChanged(Shelf* shelf) override;
35 void OnShelfAutoHideBehaviorChanged(Shelf* shelf) override; 39 void OnShelfAutoHideBehaviorChanged(Shelf* shelf) override;
36 ShelfID GetShelfIDForAppID(const std::string& app_id) override; 40 ShelfID GetShelfIDForAppID(const std::string& app_id) override;
37 bool HasShelfIDToAppIDMapping(ShelfID id) const override; 41 bool HasShelfIDToAppIDMapping(ShelfID id) const override;
38 const std::string& GetAppIDForShelfID(ShelfID id) override; 42 const std::string& GetAppIDForShelfID(ShelfID id) override;
39 void PinAppWithID(const std::string& app_id) override; 43 void PinAppWithID(const std::string& app_id) override;
40 bool IsAppPinned(const std::string& app_id) override; 44 bool IsAppPinned(const std::string& app_id) override;
41 void UnpinAppWithID(const std::string& app_id) override; 45 void UnpinAppWithID(const std::string& app_id) override;
42 46
47 // ShelfLayoutManagerObserver:
msw 2016/05/24 20:46:55 I wonder if this should be done through ShelfDeleg
James Cook 2016/05/25 00:25:43 Done.
48 void DidChangeVisibilityState(ShelfLayoutManager* layout_manager,
49 ShelfVisibilityState new_state) override;
50 void OnAutoHideStateChanged(ShelfLayoutManager* layout_manager,
51 ShelfAutoHideState new_state) override;
52
43 // mash::shelf::mojom::ShelfController: 53 // mash::shelf::mojom::ShelfController:
44 void AddObserver( 54 void AddObserver(
45 mash::shelf::mojom::ShelfObserverAssociatedPtrInfo observer) override; 55 mash::shelf::mojom::ShelfObserverAssociatedPtrInfo observer) override;
46 void SetAlignment(mash::shelf::mojom::Alignment alignment) override; 56 void SetAlignment(mash::shelf::mojom::Alignment alignment) override;
47 void SetAutoHideBehavior( 57 void SetAutoHideBehavior(
48 mash::shelf::mojom::AutoHideBehavior auto_hide) override; 58 mash::shelf::mojom::AutoHideBehavior auto_hide) override;
49 void PinItem( 59 void PinItem(
50 mash::shelf::mojom::ShelfItemPtr item, 60 mash::shelf::mojom::ShelfItemPtr item,
51 mash::shelf::mojom::ShelfItemDelegateAssociatedPtrInfo delegate) override; 61 mash::shelf::mojom::ShelfItemDelegateAssociatedPtrInfo delegate) override;
52 void UnpinItem(const mojo::String& app_id) override; 62 void UnpinItem(const mojo::String& app_id) override;
(...skipping 26 matching lines...) Expand all
79 std::map<std::string, ShelfID> app_id_to_shelf_id_; 89 std::map<std::string, ShelfID> app_id_to_shelf_id_;
80 std::map<ShelfID, std::string> shelf_id_to_app_id_; 90 std::map<ShelfID, std::string> shelf_id_to_app_id_;
81 91
82 DISALLOW_COPY_AND_ASSIGN(ShelfDelegateMus); 92 DISALLOW_COPY_AND_ASSIGN(ShelfDelegateMus);
83 }; 93 };
84 94
85 } // namespace sysui 95 } // namespace sysui
86 } // namespace ash 96 } // namespace ash
87 97
88 #endif // ASH_MUS_SHELF_DELEGATE_MUS_H_ 98 #endif // ASH_MUS_SHELF_DELEGATE_MUS_H_
OLDNEW
« no previous file with comments | « no previous file | ash/mus/shelf_delegate_mus.cc » ('j') | ash/shelf/shelf_button.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698