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/bookmarks/bookmark_bar_controller.h" | 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_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/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #import "chrome/browser/ui/cocoa/view_id_util.h" | 42 #import "chrome/browser/ui/cocoa/view_id_util.h" |
43 #import "chrome/browser/ui/cocoa/view_resizer.h" | 43 #import "chrome/browser/ui/cocoa/view_resizer.h" |
44 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" | 44 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" |
45 #include "chrome/common/extensions/extension_constants.h" | 45 #include "chrome/common/extensions/extension_constants.h" |
46 #include "chrome/common/pref_names.h" | 46 #include "chrome/common/pref_names.h" |
47 #include "content/public/browser/user_metrics.h" | 47 #include "content/public/browser/user_metrics.h" |
48 #include "content/public/browser/web_contents.h" | 48 #include "content/public/browser/web_contents.h" |
49 #include "content/public/browser/web_contents_view.h" | 49 #include "content/public/browser/web_contents_view.h" |
50 #include "grit/generated_resources.h" | 50 #include "grit/generated_resources.h" |
51 #include "grit/theme_resources_standard.h" | 51 #include "grit/theme_resources_standard.h" |
52 #include "grit/ui_resources.h" | 52 #include "grit/ui_resources_standard.h" |
53 #include "skia/ext/skia_utils_mac.h" | 53 #include "skia/ext/skia_utils_mac.h" |
54 #include "ui/base/l10n/l10n_util_mac.h" | 54 #include "ui/base/l10n/l10n_util_mac.h" |
55 #include "ui/base/resource/resource_bundle.h" | 55 #include "ui/base/resource/resource_bundle.h" |
56 #include "ui/gfx/image/image.h" | 56 #include "ui/gfx/image/image.h" |
57 #include "ui/gfx/mac/nsimage_cache.h" | 57 #include "ui/gfx/mac/nsimage_cache.h" |
58 | 58 |
59 using content::OpenURLParams; | 59 using content::OpenURLParams; |
60 using content::Referrer; | 60 using content::Referrer; |
61 using content::UserMetricsAction; | 61 using content::UserMetricsAction; |
62 using content::WebContents; | 62 using content::WebContents; |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 initialWidth_ = initialWidth; | 244 initialWidth_ = initialWidth; |
245 bookmarkModel_ = browser_->profile()->GetBookmarkModel(); | 245 bookmarkModel_ = browser_->profile()->GetBookmarkModel(); |
246 buttons_.reset([[NSMutableArray alloc] init]); | 246 buttons_.reset([[NSMutableArray alloc] init]); |
247 delegate_ = delegate; | 247 delegate_ = delegate; |
248 resizeDelegate_ = resizeDelegate; | 248 resizeDelegate_ = resizeDelegate; |
249 folderTarget_.reset([[BookmarkFolderTarget alloc] initWithController:self]); | 249 folderTarget_.reset([[BookmarkFolderTarget alloc] initWithController:self]); |
250 | 250 |
251 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 251 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
252 folderImage_.reset( | 252 folderImage_.reset( |
253 [rb.GetNativeImageNamed(IDR_BOOKMARK_BAR_FOLDER) retain]); | 253 [rb.GetNativeImageNamed(IDR_BOOKMARK_BAR_FOLDER) retain]); |
254 defaultImage_.reset([gfx::GetCachedImageWithName(@"nav.pdf") retain]); | 254 defaultImage_.reset([rb.GetNativeImageNamed(IDR_DEFAULT_FAVICON) retain]); |
255 | 255 |
256 // Register for theme changes, bookmark button pulsing, ... | 256 // Register for theme changes, bookmark button pulsing, ... |
257 NSNotificationCenter* defaultCenter = [NSNotificationCenter defaultCenter]; | 257 NSNotificationCenter* defaultCenter = [NSNotificationCenter defaultCenter]; |
258 [defaultCenter addObserver:self | 258 [defaultCenter addObserver:self |
259 selector:@selector(themeDidChangeNotification:) | 259 selector:@selector(themeDidChangeNotification:) |
260 name:kBrowserThemeDidChangeNotification | 260 name:kBrowserThemeDidChangeNotification |
261 object:nil]; | 261 object:nil]; |
262 [defaultCenter addObserver:self | 262 [defaultCenter addObserver:self |
263 selector:@selector(pulseBookmarkNotification:) | 263 selector:@selector(pulseBookmarkNotification:) |
264 name:bookmark_button::kPulseBookmarkButtonNotification | 264 name:bookmark_button::kPulseBookmarkButtonNotification |
(...skipping 2528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2793 // to minimize touching the object passed in (likely a mock). | 2793 // to minimize touching the object passed in (likely a mock). |
2794 - (void)setButtonContextMenu:(id)menu { | 2794 - (void)setButtonContextMenu:(id)menu { |
2795 buttonContextMenu_ = menu; | 2795 buttonContextMenu_ = menu; |
2796 } | 2796 } |
2797 | 2797 |
2798 - (void)setIgnoreAnimations:(BOOL)ignore { | 2798 - (void)setIgnoreAnimations:(BOOL)ignore { |
2799 ignoreAnimations_ = ignore; | 2799 ignoreAnimations_ = ignore; |
2800 } | 2800 } |
2801 | 2801 |
2802 @end | 2802 @end |
OLD | NEW |