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

Side by Side Diff: ash/common/shelf/shelf_item_delegate.h

Issue 2608013002: mash: Replace ShelfItemDelegate::CanPin with ShelfItem::pinned_by_policy. (Closed)
Patch Set: Created 3 years, 11 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_COMMON_SHELF_SHELF_ITEM_DELEGATE_H_ 5 #ifndef ASH_COMMON_SHELF_SHELF_ITEM_DELEGATE_H_
6 #define ASH_COMMON_SHELF_SHELF_ITEM_DELEGATE_H_ 6 #define ASH_COMMON_SHELF_SHELF_ITEM_DELEGATE_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 10
(...skipping 29 matching lines...) Expand all
40 // and has an instance of |views::View| as the event target 40 // and has an instance of |views::View| as the event target
41 // but not |aura::Window|. If the |event| is of type KeyEvent, it is assumed 41 // but not |aura::Window|. If the |event| is of type KeyEvent, it is assumed
42 // that this was triggered by keyboard action (Alt+<number>) and special 42 // that this was triggered by keyboard action (Alt+<number>) and special
43 // handling might happen. 43 // handling might happen.
44 // Returns the action performed by selecting the item. 44 // Returns the action performed by selecting the item.
45 virtual PerformedAction ItemSelected(const ui::Event& event) = 0; 45 virtual PerformedAction ItemSelected(const ui::Event& event) = 0;
46 46
47 // Returns the title to display. 47 // Returns the title to display.
48 virtual base::string16 GetTitle() = 0; 48 virtual base::string16 GetTitle() = 0;
49 49
50 // Returns whether the user can change the pin status of this item.
51 // Pinning may be disallowed by policy if this app is pinned by pre-defined
52 // pinned app list.
53 virtual bool CanPin() const = 0;
James Cook 2017/01/04 17:32:17 Wow, the old code was confusing. This should have
msw 2017/01/04 22:23:04 Acknowledged.
54
55 // Returns the application menu model for the specified item. There are three 50 // Returns the application menu model for the specified item. There are three
56 // possible return values: 51 // possible return values:
57 // - A return of NULL indicates that no menu is wanted for this item. 52 // - A return of NULL indicates that no menu is wanted for this item.
58 // - A return of a menu with one item means that only the name of the 53 // - A return of a menu with one item means that only the name of the
59 // application/item was added and there are no active applications. 54 // application/item was added and there are no active applications.
60 // Note: This is useful for hover menus which also show context help. 55 // Note: This is useful for hover menus which also show context help.
61 // - A list containing the title and the active list of items. 56 // - A list containing the title and the active list of items.
62 // The caller takes ownership of the returned model. 57 // The caller takes ownership of the returned model.
63 // |event_flags| specifies the flags of the event which triggered this menu. 58 // |event_flags| specifies the flags of the event which triggered this menu.
64 virtual ShelfMenuModel* CreateApplicationMenu(int event_flags) = 0; 59 virtual ShelfMenuModel* CreateApplicationMenu(int event_flags) = 0;
65 60
66 // Closes all windows associated with this item. 61 // Closes all windows associated with this item.
67 virtual void Close() = 0; 62 virtual void Close() = 0;
68 }; 63 };
69 64
70 } // namespace ash 65 } // namespace ash
71 66
72 #endif // ASH_COMMON_SHELF_SHELF_ITEM_DELEGATE_H_ 67 #endif // ASH_COMMON_SHELF_SHELF_ITEM_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698