| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/cocoa/bookmark_bar_folder_controller.h" | 5 #import "chrome/browser/cocoa/bookmark_bar_folder_controller.h" |
| 6 #include "base/mac_util.h" | 6 #include "base/mac_util.h" |
| 7 #include "base/nsimage_cache_mac.h" | 7 #include "base/nsimage_cache_mac.h" |
| 8 #include "base/sys_string_conversions.h" | 8 #include "base/sys_string_conversions.h" |
| 9 #include "chrome/browser/bookmarks/bookmark_model.h" | 9 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_utils.h" | 10 #include "chrome/browser/bookmarks/bookmark_utils.h" |
| 11 #import "chrome/browser/browser_theme_provider.h" | 11 #import "chrome/browser/browser_theme_provider.h" |
| 12 #import "chrome/browser/cocoa/bookmark_bar_constants.h" // namespace bookmarks | 12 #import "chrome/browser/cocoa/bookmark_bar_constants.h" // namespace bookmarks |
| 13 #import "chrome/browser/cocoa/bookmark_bar_controller.h" // namespace bookmarks | 13 #import "chrome/browser/cocoa/bookmark_bar_controller.h" // namespace bookmarks |
| 14 #import "chrome/browser/cocoa/bookmark_bar_folder_view.h" | 14 #import "chrome/browser/cocoa/bookmark_bar_folder_view.h" |
| 15 #import "chrome/browser/cocoa/bookmark_bar_folder_button_cell.h" | 15 #import "chrome/browser/cocoa/bookmark_bar_folder_button_cell.h" |
| 16 #import "chrome/browser/cocoa/bookmark_bar_folder_hover_state.h" | 16 #import "chrome/browser/cocoa/bookmark_bar_folder_hover_state.h" |
| 17 #import "chrome/browser/cocoa/bookmark_folder_target.h" | 17 #import "chrome/browser/cocoa/bookmark_folder_target.h" |
| 18 #import "chrome/browser/cocoa/browser_window_controller.h" | 18 #import "chrome/browser/cocoa/browser_window_controller.h" |
| 19 #import "chrome/browser/cocoa/event_utils.h" | 19 #import "chrome/browser/cocoa/event_utils.h" |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 // Frequency of the scrolling timer in seconds. | 23 // Frequency of the scrolling timer in seconds. |
| 24 const NSTimeInterval kBookmarkBarFolderScrollInterval = 0.2; | 24 const NSTimeInterval kBookmarkBarFolderScrollInterval = 0.1; |
| 25 | 25 |
| 26 // Amount to scroll by per timer fire. We scroll rather slowly; to | 26 // Amount to scroll by per timer fire. We scroll rather slowly; to |
| 27 // accomodate we do 2 at a time. | 27 // accomodate we do several at a time. |
| 28 const CGFloat kBookmarkBarFolderScrollAmount = | 28 const CGFloat kBookmarkBarFolderScrollAmount = |
| 29 2 * (bookmarks::kBookmarkButtonHeight + | 29 3 * (bookmarks::kBookmarkButtonHeight + |
| 30 bookmarks::kBookmarkVerticalPadding); | 30 bookmarks::kBookmarkVerticalPadding); |
| 31 | 31 |
| 32 // Amount to scroll for each scroll wheel delta. | 32 // Amount to scroll for each scroll wheel delta. |
| 33 const CGFloat kBookmarkBarFolderScrollWheelAmount = | 33 const CGFloat kBookmarkBarFolderScrollWheelAmount = |
| 34 1 * (bookmarks::kBookmarkButtonHeight + | 34 1 * (bookmarks::kBookmarkButtonHeight + |
| 35 bookmarks::kBookmarkVerticalPadding); | 35 bookmarks::kBookmarkVerticalPadding); |
| 36 | 36 |
| 37 // When constraining a scrolling bookmark bar folder window to the | 37 // When constraining a scrolling bookmark bar folder window to the |
| 38 // screen, shrink the "constrain" by this much vertically. Currently | 38 // screen, shrink the "constrain" by this much vertically. Currently |
| 39 // this is 0.0 to avoid a problem with tracking areas leaving the | 39 // this is 0.0 to avoid a problem with tracking areas leaving the |
| (...skipping 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1375 return [folderController_ controllerForNode:node]; | 1375 return [folderController_ controllerForNode:node]; |
| 1376 } | 1376 } |
| 1377 | 1377 |
| 1378 #pragma mark TestingAPI Only | 1378 #pragma mark TestingAPI Only |
| 1379 | 1379 |
| 1380 - (void)setIgnoreAnimations:(BOOL)ignore { | 1380 - (void)setIgnoreAnimations:(BOOL)ignore { |
| 1381 ignoreAnimations_ = ignore; | 1381 ignoreAnimations_ = ignore; |
| 1382 } | 1382 } |
| 1383 | 1383 |
| 1384 @end // BookmarkBarFolderController | 1384 @end // BookmarkBarFolderController |
| OLD | NEW |