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

Side by Side Diff: chrome/browser/ui/gtk/download/download_shelf_gtk.h

Issue 11673004: No need to pass DownloadItemModel ownership. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DownloadShelfContextMenu class cleanup and require GetMenuModel() to return non-NULL Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_SHELF_GTK_H_ 5 #ifndef CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_SHELF_GTK_H_
6 #define CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_SHELF_GTK_H_ 6 #define CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_SHELF_GTK_H_
7 7
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 9
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/message_loop.h" 15 #include "base/message_loop.h"
16 #include "chrome/browser/download/download_shelf.h" 16 #include "chrome/browser/download/download_shelf.h"
17 #include "chrome/browser/ui/gtk/slide_animator_gtk.h" 17 #include "chrome/browser/ui/gtk/slide_animator_gtk.h"
18 #include "content/public/browser/notification_observer.h" 18 #include "content/public/browser/notification_observer.h"
19 #include "content/public/browser/notification_registrar.h" 19 #include "content/public/browser/notification_registrar.h"
20 #include "ui/base/gtk/gtk_signal.h" 20 #include "ui/base/gtk/gtk_signal.h"
21 #include "ui/base/gtk/owned_widget_gtk.h" 21 #include "ui/base/gtk/owned_widget_gtk.h"
22 #include "ui/gfx/native_widget_types.h" 22 #include "ui/gfx/native_widget_types.h"
23 23
24 class Browser; 24 class Browser;
25 class CustomDrawButton; 25 class CustomDrawButton;
26 class DownloadItemGtk; 26 class DownloadItemGtk;
27 class DownloadItemModel;
28 class GtkThemeService; 27 class GtkThemeService;
29 28
30 namespace content { 29 namespace content {
31 class PageNavigator; 30 class PageNavigator;
32 } 31 }
33 32
34 namespace gfx { 33 namespace gfx {
35 class Point; 34 class Point;
36 } 35 }
37 36
(...skipping 24 matching lines...) Expand all
62 61
63 // Returns the current height of the shelf. 62 // Returns the current height of the shelf.
64 int GetHeight() const; 63 int GetHeight() const;
65 64
66 // MessageLoop::Observer implementation: 65 // MessageLoop::Observer implementation:
67 virtual void WillProcessEvent(GdkEvent* event) OVERRIDE; 66 virtual void WillProcessEvent(GdkEvent* event) OVERRIDE;
68 virtual void DidProcessEvent(GdkEvent* event) OVERRIDE; 67 virtual void DidProcessEvent(GdkEvent* event) OVERRIDE;
69 68
70 protected: 69 protected:
71 // DownloadShelf implementation. 70 // DownloadShelf implementation.
72 virtual void DoAddDownload(DownloadItemModel* download_model) OVERRIDE; 71 virtual void DoAddDownload(content::DownloadItem* download) OVERRIDE;
73 virtual void DoShow() OVERRIDE; 72 virtual void DoShow() OVERRIDE;
74 virtual void DoClose() OVERRIDE; 73 virtual void DoClose() OVERRIDE;
75 74
76 private: 75 private:
77 // Remove |download_item| from the download shelf and delete it. 76 // Remove |download_item| from the download shelf and delete it.
78 void RemoveDownloadItem(DownloadItemGtk* download_item); 77 void RemoveDownloadItem(DownloadItemGtk* download_item);
79 78
80 // Get the hbox download items ought to pack themselves into. 79 // Get the hbox download items ought to pack themselves into.
81 GtkWidget* GetHBox() const; 80 GtkWidget* GetHBox() const;
82 81
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 // True if the mouse is within the shelf's bounds, as of the last mouse event 151 // True if the mouse is within the shelf's bounds, as of the last mouse event
153 // we received. 152 // we received.
154 bool mouse_in_shelf_; 153 bool mouse_in_shelf_;
155 154
156 base::WeakPtrFactory<DownloadShelfGtk> weak_factory_; 155 base::WeakPtrFactory<DownloadShelfGtk> weak_factory_;
157 156
158 friend class DownloadItemGtk; 157 friend class DownloadItemGtk;
159 }; 158 };
160 159
161 #endif // CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_SHELF_GTK_H_ 160 #endif // CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_SHELF_GTK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698