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 "ui/base/l10n/l10n_util_mac.h" | 53 #include "ui/base/l10n/l10n_util_mac.h" |
54 #include "ui/base/resource/resource_bundle.h" | 54 #include "ui/base/resource/resource_bundle.h" |
55 #include "ui/gfx/image/image.h" | 55 #include "ui/gfx/image/image.h" |
56 #include "ui/gfx/mac/nsimage_cache.h" | 56 #include "ui/gfx/mac/nsimage_cache.h" |
57 | 57 |
58 using content::OpenURLParams; | 58 using content::OpenURLParams; |
59 using content::Referrer; | 59 using content::Referrer; |
60 using content::UserMetricsAction; | 60 using content::UserMetricsAction; |
61 using content::WebContents; | 61 using content::WebContents; |
62 | 62 |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 initialWidth_ = initialWidth; | 243 initialWidth_ = initialWidth; |
244 bookmarkModel_ = browser_->profile()->GetBookmarkModel(); | 244 bookmarkModel_ = browser_->profile()->GetBookmarkModel(); |
245 buttons_.reset([[NSMutableArray alloc] init]); | 245 buttons_.reset([[NSMutableArray alloc] init]); |
246 delegate_ = delegate; | 246 delegate_ = delegate; |
247 resizeDelegate_ = resizeDelegate; | 247 resizeDelegate_ = resizeDelegate; |
248 folderTarget_.reset([[BookmarkFolderTarget alloc] initWithController:self]); | 248 folderTarget_.reset([[BookmarkFolderTarget alloc] initWithController:self]); |
249 | 249 |
250 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 250 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
251 folderImage_.reset( | 251 folderImage_.reset( |
252 [rb.GetNativeImageNamed(IDR_BOOKMARK_BAR_FOLDER) retain]); | 252 [rb.GetNativeImageNamed(IDR_BOOKMARK_BAR_FOLDER) retain]); |
253 defaultImage_.reset([gfx::GetCachedImageWithName(@"nav.pdf") retain]); | 253 defaultImage_.reset([rb.GetNativeImageNamed(IDR_DEFAULT_FAVICON) retain]); |
254 | 254 |
255 // Register for theme changes, bookmark button pulsing, ... | 255 // Register for theme changes, bookmark button pulsing, ... |
256 NSNotificationCenter* defaultCenter = [NSNotificationCenter defaultCenter]; | 256 NSNotificationCenter* defaultCenter = [NSNotificationCenter defaultCenter]; |
257 [defaultCenter addObserver:self | 257 [defaultCenter addObserver:self |
258 selector:@selector(themeDidChangeNotification:) | 258 selector:@selector(themeDidChangeNotification:) |
259 name:kBrowserThemeDidChangeNotification | 259 name:kBrowserThemeDidChangeNotification |
260 object:nil]; | 260 object:nil]; |
261 [defaultCenter addObserver:self | 261 [defaultCenter addObserver:self |
262 selector:@selector(pulseBookmarkNotification:) | 262 selector:@selector(pulseBookmarkNotification:) |
263 name:bookmark_button::kPulseBookmarkButtonNotification | 263 name:bookmark_button::kPulseBookmarkButtonNotification |
(...skipping 2528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2792 // to minimize touching the object passed in (likely a mock). | 2792 // to minimize touching the object passed in (likely a mock). |
2793 - (void)setButtonContextMenu:(id)menu { | 2793 - (void)setButtonContextMenu:(id)menu { |
2794 buttonContextMenu_ = menu; | 2794 buttonContextMenu_ = menu; |
2795 } | 2795 } |
2796 | 2796 |
2797 - (void)setIgnoreAnimations:(BOOL)ignore { | 2797 - (void)setIgnoreAnimations:(BOOL)ignore { |
2798 ignoreAnimations_ = ignore; | 2798 ignoreAnimations_ = ignore; |
2799 } | 2799 } |
2800 | 2800 |
2801 @end | 2801 @end |
OLD | NEW |