| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/bookmarks/bookmark_bar_controller.h" | 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" |
| 6 | 6 |
| 7 #include "base/mac/mac_util.h" | 7 #include "base/mac/mac_util.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_editor.h" | 10 #include "chrome/browser/bookmarks/bookmark_editor.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 namespace { | 113 namespace { |
| 114 | 114 |
| 115 // Overlap (in pixels) between the toolbar and the bookmark bar (when showing in | 115 // Overlap (in pixels) between the toolbar and the bookmark bar (when showing in |
| 116 // normal mode). | 116 // normal mode). |
| 117 const CGFloat kBookmarkBarOverlap = 3.0; | 117 const CGFloat kBookmarkBarOverlap = 3.0; |
| 118 | 118 |
| 119 // Duration of the bookmark bar animations. | 119 // Duration of the bookmark bar animations. |
| 120 const NSTimeInterval kBookmarkBarAnimationDuration = 0.12; | 120 const NSTimeInterval kBookmarkBarAnimationDuration = 0.12; |
| 121 | 121 |
| 122 void RecordAppLaunch(Profile* profile, GURL url) { | 122 void RecordAppLaunch(Profile* profile, GURL url) { |
| 123 if (!profile->GetExtensionService()->IsInstalledApp(url)) | 123 // TODO: the ExtensionService should never be NULL, but in some cases it is, |
| 124 // see bug 73768. After it is resolved, the explicit test can go away. |
| 125 ExtensionService* service = profile->GetExtensionService(); |
| 126 if (!service || !service->IsInstalledApp(url)) |
| 124 return; | 127 return; |
| 125 | 128 |
| 126 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, | 129 UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, |
| 127 extension_misc::APP_LAUNCH_BOOKMARK_BAR, | 130 extension_misc::APP_LAUNCH_BOOKMARK_BAR, |
| 128 extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); | 131 extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); |
| 129 } | 132 } |
| 130 | 133 |
| 131 } // namespace | 134 } // namespace |
| 132 | 135 |
| 133 @interface BookmarkBarController(Private) | 136 @interface BookmarkBarController(Private) |
| (...skipping 2369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2503 // to minimize touching the object passed in (likely a mock). | 2506 // to minimize touching the object passed in (likely a mock). |
| 2504 - (void)setButtonContextMenu:(id)menu { | 2507 - (void)setButtonContextMenu:(id)menu { |
| 2505 buttonContextMenu_ = menu; | 2508 buttonContextMenu_ = menu; |
| 2506 } | 2509 } |
| 2507 | 2510 |
| 2508 - (void)setIgnoreAnimations:(BOOL)ignore { | 2511 - (void)setIgnoreAnimations:(BOOL)ignore { |
| 2509 ignoreAnimations_ = ignore; | 2512 ignoreAnimations_ = ignore; |
| 2510 } | 2513 } |
| 2511 | 2514 |
| 2512 @end | 2515 @end |
| OLD | NEW |