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

Unified Diff: chrome/browser/ui/cocoa/extensions/media_gallery_list_entry_view.h

Issue 231873003: Refactor media galleries dialogs on cocoa to extract common code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Layout in place Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/extensions/media_gallery_list_entry_view.h
diff --git a/chrome/browser/ui/cocoa/extensions/media_gallery_list_entry_view.h b/chrome/browser/ui/cocoa/extensions/media_gallery_list_entry_view.h
new file mode 100644
index 0000000000000000000000000000000000000000..dc55c3e243c77e9c1078b4cd125731e27deac7d4
--- /dev/null
+++ b/chrome/browser/ui/cocoa/extensions/media_gallery_list_entry_view.h
@@ -0,0 +1,49 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_MEDIA_GALLERY_LIST_ENTRY_VIEW_H_
+#define CHROME_BROWSER_UI_COCOA_EXTENSIONS_MEDIA_GALLERY_LIST_ENTRY_VIEW_H_
+
+#import <Cocoa/Cocoa.h>
+
+#import "base/mac/scoped_nsobject.h"
+#include "chrome/browser/media_galleries/media_galleries_preferences.h"
+#import "ui/base/models/menu_model.h"
+
+@class MediaGalleryButton;
+
+class MediaGalleryListEntryController {
+ public:
+ virtual void OnCheckboxToggled(MediaGalleryPrefId pref_id, bool checked) {}
+ virtual void OnFolderViewerClicked(MediaGalleryPrefId pref_id) {}
+ virtual ui::MenuModel* GetContextMenu(MediaGalleryPrefId pref_id);
+
+ protected:
+ virtual ~MediaGalleryListEntryController() {}
+};
+
+@interface MediaGalleryListEntry : NSView {
+ @private
+ MediaGalleryListEntryController* controller_; // |controller_| owns |this|.
+ MediaGalleryPrefId prefId_;
+
+ base::scoped_nsobject<MediaGalleryButton> checkbox_;
+ base::scoped_nsobject<MediaGalleryButton> folderViewer_;
+ base::scoped_nsobject<NSTextField> details_;
+}
+
+// Does size to fit if frameRect is empty.
+- (id)initWithFrame:(NSRect)frameRect
+ controller:(MediaGalleryListEntryController*)controller_
+ prefId:(MediaGalleryPrefId)prefId
+ galleryName:(base::string16)galleryName
+ subscript:(base::string16)subscript
+ tooltip:(base::string16)tooltip
+ showFolderViewer:(bool)showFolderViewer;
+
+- (void)setState:(bool)selected;
+
+@end
+
+#endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_MEDIA_GALLERY_LIST_ENTRY_VIEW_H_

Powered by Google App Engine
This is Rietveld 408576698