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

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

Issue 10337010: Revert r123782. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 7 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 #include "chrome/browser/ui/gtk/download/download_shelf_gtk.h" 5 #include "chrome/browser/ui/gtk/download/download_shelf_gtk.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "chrome/browser/download/download_item_model.h" 10 #include "chrome/browser/download/download_item_model.h"
11 #include "chrome/browser/download/download_util.h" 11 #include "chrome/browser/download/download_util.h"
12 #include "chrome/browser/ui/browser.h" 12 #include "chrome/browser/ui/browser.h"
13 #include "chrome/browser/ui/gtk/browser_window_gtk.h" 13 #include "chrome/browser/ui/gtk/browser_window_gtk.h"
14 #include "chrome/browser/ui/gtk/custom_button.h" 14 #include "chrome/browser/ui/gtk/custom_button.h"
15 #include "chrome/browser/ui/gtk/download/download_item_gtk.h" 15 #include "chrome/browser/ui/gtk/download/download_item_gtk.h"
16 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" 16 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h"
17 #include "chrome/browser/ui/gtk/gtk_chrome_shrinkable_hbox.h" 17 #include "chrome/browser/ui/gtk/gtk_chrome_shrinkable_hbox.h"
18 #include "chrome/browser/ui/gtk/gtk_theme_service.h"
18 #include "chrome/browser/ui/gtk/gtk_util.h" 19 #include "chrome/browser/ui/gtk/gtk_util.h"
19 #include "chrome/browser/ui/gtk/theme_service_gtk.h"
20 #include "chrome/common/chrome_notification_types.h" 20 #include "chrome/common/chrome_notification_types.h"
21 #include "content/public/browser/download_item.h" 21 #include "content/public/browser/download_item.h"
22 #include "content/public/browser/notification_source.h" 22 #include "content/public/browser/notification_source.h"
23 #include "grit/generated_resources.h" 23 #include "grit/generated_resources.h"
24 #include "grit/theme_resources.h" 24 #include "grit/theme_resources.h"
25 #include "grit/theme_resources_standard.h" 25 #include "grit/theme_resources_standard.h"
26 #include "grit/ui_resources_standard.h" 26 #include "grit/ui_resources_standard.h"
27 #include "ui/base/gtk/gtk_screen_util.h" 27 #include "ui/base/gtk/gtk_screen_util.h"
28 #include "ui/base/l10n/l10n_util.h" 28 #include "ui/base/l10n/l10n_util.h"
29 #include "ui/base/resource/resource_bundle.h" 29 #include "ui/base/resource/resource_bundle.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 // The area to the top of the shelf that is considered part of its "zone". 61 // The area to the top of the shelf that is considered part of its "zone".
62 const int kShelfAuraSize = 40; 62 const int kShelfAuraSize = 40;
63 63
64 } // namespace 64 } // namespace
65 65
66 using content::DownloadItem; 66 using content::DownloadItem;
67 67
68 DownloadShelfGtk::DownloadShelfGtk(Browser* browser, GtkWidget* parent) 68 DownloadShelfGtk::DownloadShelfGtk(Browser* browser, GtkWidget* parent)
69 : browser_(browser), 69 : browser_(browser),
70 is_showing_(false), 70 is_showing_(false),
71 theme_service_(ThemeServiceGtk::GetFrom(browser->profile())), 71 theme_service_(GtkThemeService::GetFrom(browser->profile())),
72 close_on_mouse_out_(false), 72 close_on_mouse_out_(false),
73 mouse_in_shelf_(false), 73 mouse_in_shelf_(false),
74 weak_factory_(this) { 74 weak_factory_(this) {
75 // Logically, the shelf is a vbox that contains two children: a one pixel 75 // Logically, the shelf is a vbox that contains two children: a one pixel
76 // tall event box, which serves as the top border, and an hbox, which holds 76 // tall event box, which serves as the top border, and an hbox, which holds
77 // the download items and other shelf widgets (close button, show-all- 77 // the download items and other shelf widgets (close button, show-all-
78 // downloads link). 78 // downloads link).
79 // To make things pretty, we have to add a few more widgets. To get padding 79 // To make things pretty, we have to add a few more widgets. To get padding
80 // right, we stick the hbox in an alignment. We put that alignment in an 80 // right, we stick the hbox in an alignment. We put that alignment in an
81 // event box so we can color the background. 81 // event box so we can color the background.
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 387
388 MessageLoop::current()->PostDelayedTask( 388 MessageLoop::current()->PostDelayedTask(
389 FROM_HERE, 389 FROM_HERE,
390 base::Bind(&DownloadShelfGtk::Close, weak_factory_.GetWeakPtr()), 390 base::Bind(&DownloadShelfGtk::Close, weak_factory_.GetWeakPtr()),
391 base::TimeDelta::FromMilliseconds(kAutoCloseDelayMs)); 391 base::TimeDelta::FromMilliseconds(kAutoCloseDelayMs));
392 } 392 }
393 393
394 void DownloadShelfGtk::MouseEnteredShelf() { 394 void DownloadShelfGtk::MouseEnteredShelf() {
395 weak_factory_.InvalidateWeakPtrs(); 395 weak_factory_.InvalidateWeakPtrs();
396 } 396 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/download/download_shelf_gtk.h ('k') | chrome/browser/ui/gtk/extensions/bundle_installed_bubble_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698