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

Unified Diff: chrome/browser/cocoa/download_item_mac.h

Issue 93129: Initial download shelf on OS X.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: fix download_uitest Created 11 years, 6 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
« no previous file with comments | « chrome/browser/cocoa/browser_window_controller.mm ('k') | chrome/browser/cocoa/download_item_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/download_item_mac.h
===================================================================
--- chrome/browser/cocoa/download_item_mac.h (revision 12817)
+++ chrome/browser/cocoa/download_item_mac.h (working copy)
@@ -2,81 +2,46 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_GTK_DOWNLOAD_ITEM_GTK_H_
-#define CHROME_BROWSER_GTK_DOWNLOAD_ITEM_GTK_H_
+#ifndef CHROME_BROWSER_COCOA_DOWNLOAD_ITEM_MAC_H_
+#define CHROME_BROWSER_COCOA_DOWNLOAD_ITEM_MAC_H_
-#include <gtk/gtk.h>
+#import <Cocoa/Cocoa.h>
+#include "base/scoped_nsobject.h"
#include "base/scoped_ptr.h"
#include "chrome/browser/download/download_manager.h"
class BaseDownloadItemModel;
-class DownloadShelfContextMenuGtk;
-class NineBox;
+@class DownloadShelfController;
+@class DownloadShelfContextMenuBridge;
-class DownloadItemGtk : DownloadItem::Observer {
+
+// A class that bridges the visible mac download items to chromium's
+// download model.
+
+class DownloadItemMac : DownloadItem::Observer {
public:
- // DownloadItemGtk takes ownership of |download_item_model|.
- DownloadItemGtk(BaseDownloadItemModel* download_item_model,
- GtkWidget* parent_shelf, GtkWidget* bounding_widget);
+ // DownloadItemMac takes ownership of |download_item_model|.
+ DownloadItemMac(BaseDownloadItemModel* download_item_model,
+ NSRect frame,
+ DownloadShelfController* parent);
- // We put |hbox_| in |parent_shelf| and rely on |parent_shelf| recursively
- // destroying its children. Hence we do nothing in the destructor.
- ~DownloadItemGtk();
+ // Destructor.
+ ~DownloadItemMac();
// DownloadItem::Observer implementation
virtual void OnDownloadUpdated(DownloadItem* download);
+ virtual void OnDownloadOpened(DownloadItem* download) { }
private:
- static void InitNineBoxes();
-
- static gboolean OnExpose(GtkWidget* widget, GdkEventExpose* e,
- DownloadItemGtk* download_item);
-
- static gboolean OnMenuButtonPressEvent(GtkWidget* button,
- GdkEvent* event,
- DownloadItemGtk* item);
-
- static void OnShelfResized(GtkWidget *widget,
- GtkAllocation *allocation,
- DownloadItemGtk* item);
-
- // Nineboxes for the body area.
- static NineBox* body_nine_box_normal_;
- static NineBox* body_nine_box_prelight_;
- static NineBox* body_nine_box_active_;
-
- // Nineboxes for the menu button.
- static NineBox* menu_nine_box_normal_;
- static NineBox* menu_nine_box_prelight_;
- static NineBox* menu_nine_box_active_;
-
- // The widget that contains the body and menu dropdown.
- GtkWidget* hbox_;
-
- // The widget that contains the name of the download and the progress
- // animation.
- GtkWidget* body_;
-
- // The GtkLabel that holds the status text.
- GtkWidget* status_label_;
-
- // The widget that creates a dropdown menu when pressed.
- GtkWidget* menu_button_;
-
- // The menu that pops down when the user presses |menu_button_|. We do not
- // create this until the first time we actually need it.
- scoped_ptr<DownloadShelfContextMenuGtk> menu_;
-
// The download item model we represent.
scoped_ptr<BaseDownloadItemModel> download_model_;
- // The shelf we show ourselves on. We do not own this widget.
- GtkWidget* parent_shelf_;
+ // Our parent view
+ DownloadShelfController* parent_; // weak
- // This is the leftmost widget on |parent_shelf_| that is not a download item.
- // We do not want to overlap it.
- GtkWidget* bounding_widget_;
+ // Context menu
+ scoped_nsobject<DownloadShelfContextMenuBridge> menu_;
};
-#endif // CHROME_BROWSER_GTK_DOWNLOAD_ITEM_GTK_H_
+#endif // CHROME_BROWSER_COCOA_DOWNLOAD_ITEM_MAC_H_
Property changes on: chrome/browser/cocoa/download_item_mac.h
___________________________________________________________________
Added: svn:mergeinfo
Merged /branches/chrome_webkit_merge_branch/chrome/browser/gtk/download_item_gtk.h:r69-2775
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/browser/cocoa/browser_window_controller.mm ('k') | chrome/browser/cocoa/download_item_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698