1 // Copyright 2014 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. 4 5 #ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_MEDIA_GALLERY_LIST_ENTRY_VIEW_H_ 6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_MEDIA_GALLERY_LIST_ENTRY_VIEW_H_ 7 8 #import <Cocoa/Cocoa.h> 9 10 #import "base/mac/scoped_nsobject.h" 11 #include "chrome/browser/media_galleries/media_galleries_preferences.h" 12 #import "ui/base/models/menu_model.h" 13 14 @class MediaGalleryButton; 15 16 class MediaGalleryListEntryController { 17 public: 18 virtual void OnCheckboxToggled(MediaGalleryPrefId pref_id, bool checked) {} 19 virtual void OnFolderViewerClicked(MediaGalleryPrefId pref_id) {} 20 virtual ui::MenuModel* GetContextMenu(MediaGalleryPrefId pref_id); 21 22 protected: 23 virtual ~MediaGalleryListEntryController() {} 24 }; 25 26 @interface MediaGalleryListEntry : NSView { 27 @private 28 MediaGalleryListEntryController* controller_; // |controller_| owns |this|. 29 MediaGalleryPrefId prefId_; 30 31 base::scoped_nsobject<MediaGalleryButton> checkbox_; 32 base::scoped_nsobject<MediaGalleryButton> folderViewer_; 33 base::scoped_nsobject<NSTextField> details_; 34 } 35 36 // Does size to fit if frameRect is empty. 37 - (id)initWithFrame:(NSRect)frameRect 38 controller:(MediaGalleryListEntryController*)controller_ 39 prefInfo:(const MediaGalleryPrefInfo&)prefInfo 40 showFolderViewer:(bool)showFolderViewer; 41 42 - (void)setState:(bool)selected; 43 44 @end 45 46 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_MEDIA_GALLERY_LIST_ENTRY_VIEW_H_ 47