| 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 #include "chrome/browser/ui/cocoa/download/download_shelf_mac.h" | 5 #include "chrome/browser/ui/cocoa/download/download_shelf_mac.h" |
| 6 | 6 |
| 7 #include "chrome/browser/download/download_item_model.h" | 7 #include "chrome/browser/download/download_item_model.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/cocoa/download/download_item_mac.h" | 9 #include "chrome/browser/ui/cocoa/download/download_item_mac.h" |
| 10 #import "chrome/browser/ui/cocoa/download/download_shelf_controller.h" | 10 #import "chrome/browser/ui/cocoa/download/download_shelf_controller.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 bool DownloadShelfMac::IsShowing() const { | 22 bool DownloadShelfMac::IsShowing() const { |
| 23 return [shelf_controller_ isVisible] == YES; | 23 return [shelf_controller_ isVisible] == YES; |
| 24 } | 24 } |
| 25 | 25 |
| 26 bool DownloadShelfMac::IsClosing() const { | 26 bool DownloadShelfMac::IsClosing() const { |
| 27 // TODO(estade): This is never called. For now just return false. | 27 // TODO(estade): This is never called. For now just return false. |
| 28 return false; | 28 return false; |
| 29 } | 29 } |
| 30 | 30 |
| 31 void DownloadShelfMac::DoShow() { | 31 void DownloadShelfMac::DoOpen() { |
| 32 [shelf_controller_ showDownloadShelf:YES | 32 [shelf_controller_ showDownloadShelf:YES isUserAction:NO animate:YES]; |
| 33 isUserAction:NO]; | |
| 34 browser_->UpdateDownloadShelfVisibility(true); | 33 browser_->UpdateDownloadShelfVisibility(true); |
| 35 } | 34 } |
| 36 | 35 |
| 37 void DownloadShelfMac::DoClose(CloseReason reason) { | 36 void DownloadShelfMac::DoClose(CloseReason reason) { |
| 38 [shelf_controller_ showDownloadShelf:NO | 37 [shelf_controller_ showDownloadShelf:NO |
| 39 isUserAction:reason == USER_ACTION]; | 38 isUserAction:reason == USER_ACTION |
| 39 animate:YES]; |
| 40 browser_->UpdateDownloadShelfVisibility(false); | 40 browser_->UpdateDownloadShelfVisibility(false); |
| 41 } | 41 } |
| 42 | 42 |
| 43 void DownloadShelfMac::DoHide() { |
| 44 [shelf_controller_ showDownloadShelf:NO isUserAction:NO animate:NO]; |
| 45 browser_->UpdateDownloadShelfVisibility(false); |
| 46 } |
| 47 |
| 48 void DownloadShelfMac::DoUnhide() { |
| 49 [shelf_controller_ showDownloadShelf:YES isUserAction:NO animate:NO]; |
| 50 browser_->UpdateDownloadShelfVisibility(true); |
| 51 } |
| 52 |
| 43 Browser* DownloadShelfMac::browser() const { | 53 Browser* DownloadShelfMac::browser() const { |
| 44 return browser_; | 54 return browser_; |
| 45 } | 55 } |
| OLD | NEW |