OLD | NEW |
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 #import "chrome/browser/ui/cocoa/download/download_shelf_controller.h" | 5 #import "chrome/browser/ui/cocoa/download/download_shelf_controller.h" |
6 | 6 |
7 #include "base/mac/bundle_locations.h" | 7 #include "base/mac/bundle_locations.h" |
8 #include "base/mac/mac_util.h" | 8 #include "base/mac/mac_util.h" |
9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
10 #include "chrome/browser/download/download_stats.h" | 10 #include "chrome/browser/download/download_stats.h" |
11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
12 #include "chrome/browser/themes/theme_service.h" | 12 #include "chrome/browser/themes/theme_service.h" |
13 #include "chrome/browser/themes/theme_service_factory.h" | 13 #include "chrome/browser/themes/theme_service_factory.h" |
14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
15 #include "chrome/browser/ui/chrome_pages.h" | 15 #include "chrome/browser/ui/chrome_pages.h" |
16 #import "chrome/browser/ui/cocoa/animatable_view.h" | 16 #import "chrome/browser/ui/cocoa/animatable_view.h" |
17 #include "chrome/browser/ui/cocoa/browser_window_cocoa.h" | 17 #include "chrome/browser/ui/cocoa/browser_window_cocoa.h" |
18 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 18 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
19 #include "chrome/browser/ui/cocoa/download/download_item_controller.h" | 19 #include "chrome/browser/ui/cocoa/download/download_item_controller.h" |
20 #include "chrome/browser/ui/cocoa/download/download_shelf_mac.h" | 20 #include "chrome/browser/ui/cocoa/download/download_shelf_mac.h" |
21 #import "chrome/browser/ui/cocoa/download/download_shelf_view.h" | 21 #import "chrome/browser/ui/cocoa/download/download_shelf_view.h" |
22 #import "chrome/browser/ui/cocoa/presentation_mode_controller.h" | 22 #import "chrome/browser/ui/cocoa/presentation_mode_controller.h" |
23 #include "content/public/browser/download_item.h" | 23 #include "content/public/browser/download_item.h" |
24 #include "content/public/browser/download_manager.h" | 24 #include "content/public/browser/download_manager.h" |
25 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSAnimation+Duration.h
" | 25 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSAnimation+Duration.h
" |
26 #import "ui/base/cocoa/hover_button.h" | 26 #import "ui/base/cocoa/hover_button.h" |
27 #include "ui/base/l10n/l10n_util.h" | |
28 | 27 |
29 using content::DownloadItem; | 28 using content::DownloadItem; |
30 | 29 |
31 // Download shelf autoclose behavior: | 30 // Download shelf autoclose behavior: |
32 // | 31 // |
33 // The download shelf autocloses if all of this is true: | 32 // The download shelf autocloses if all of this is true: |
34 // 1) An item on the shelf has just been opened or removed. | 33 // 1) An item on the shelf has just been opened or removed. |
35 // 2) All remaining items on the shelf have been opened in the past. | 34 // 2) All remaining items on the shelf have been opened in the past. |
36 // 3) The mouse leaves the shelf and remains off the shelf for 5 seconds. | 35 // 3) The mouse leaves the shelf and remains off the shelf for 5 seconds. |
37 // | 36 // |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 } | 501 } |
503 | 502 |
504 // Set the tracking off to create a new tracking area for the control. | 503 // Set the tracking off to create a new tracking area for the control. |
505 // When changing the bounds/frame on a HoverButton, the tracking isn't updated | 504 // When changing the bounds/frame on a HoverButton, the tracking isn't updated |
506 // correctly, it needs to be turned off and back on. | 505 // correctly, it needs to be turned off and back on. |
507 [hoverCloseButton_ setTrackingEnabled:NO]; | 506 [hoverCloseButton_ setTrackingEnabled:NO]; |
508 [hoverCloseButton_ setFrame:bounds]; | 507 [hoverCloseButton_ setFrame:bounds]; |
509 [hoverCloseButton_ setTrackingEnabled:YES]; | 508 [hoverCloseButton_ setTrackingEnabled:YES]; |
510 } | 509 } |
511 @end | 510 @end |
OLD | NEW |