Chromium Code Reviews| 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/toolbar/toolbar_controller.h" | 5 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/mac/bundle_locations.h" | 9 #include "base/mac/bundle_locations.h" |
| 10 #include "base/mac/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
| 11 #include "base/mac/mac_util.h" | 11 #include "base/mac/mac_util.h" |
| 12 #include "base/memory/singleton.h" | 12 #include "base/memory/singleton.h" |
| 13 #include "base/prefs/pref_service.h" | 13 #include "base/prefs/pref_service.h" |
| 14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
| 15 #include "base/strings/sys_string_conversions.h" | 15 #include "base/strings/sys_string_conversions.h" |
| 16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| 17 #include "chrome/app/chrome_command_ids.h" | 17 #include "chrome/app/chrome_command_ids.h" |
| 18 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" | 18 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" |
| 19 #include "chrome/browser/chrome_notification_types.h" | 19 #include "chrome/browser/chrome_notification_types.h" |
| 20 #include "chrome/browser/command_observer.h" | 20 #include "chrome/browser/command_observer.h" |
| 21 #include "chrome/browser/command_updater.h" | 21 #include "chrome/browser/command_updater.h" |
| 22 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
| 23 #include "chrome/browser/search/search.h" | 23 #include "chrome/browser/search/search.h" |
| 24 #include "chrome/browser/sync/sync_global_error_factory.h" | |
| 24 #include "chrome/browser/themes/theme_service.h" | 25 #include "chrome/browser/themes/theme_service.h" |
| 25 #include "chrome/browser/ui/browser.h" | 26 #include "chrome/browser/ui/browser.h" |
| 26 #include "chrome/browser/ui/browser_commands.h" | 27 #include "chrome/browser/ui/browser_commands.h" |
| 27 #include "chrome/browser/ui/browser_window.h" | 28 #include "chrome/browser/ui/browser_window.h" |
| 28 #import "chrome/browser/ui/cocoa/background_gradient_view.h" | 29 #import "chrome/browser/ui/cocoa/background_gradient_view.h" |
| 29 #include "chrome/browser/ui/cocoa/drag_util.h" | 30 #include "chrome/browser/ui/cocoa/drag_util.h" |
| 30 #import "chrome/browser/ui/cocoa/extensions/browser_action_button.h" | 31 #import "chrome/browser/ui/cocoa/extensions/browser_action_button.h" |
| 31 #import "chrome/browser/ui/cocoa/extensions/browser_actions_container_view.h" | 32 #import "chrome/browser/ui/cocoa/extensions/browser_actions_container_view.h" |
| 32 #import "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h" | 33 #import "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h" |
| 33 #import "chrome/browser/ui/cocoa/gradient_button_cell.h" | 34 #import "chrome/browser/ui/cocoa/gradient_button_cell.h" |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 239 return self; | 240 return self; |
| 240 } | 241 } |
| 241 | 242 |
| 242 - (id)initWithCommands:(CommandUpdater*)commands | 243 - (id)initWithCommands:(CommandUpdater*)commands |
| 243 profile:(Profile*)profile | 244 profile:(Profile*)profile |
| 244 browser:(Browser*)browser { | 245 browser:(Browser*)browser { |
| 245 if ((self = [self initWithCommands:commands | 246 if ((self = [self initWithCommands:commands |
| 246 profile:profile | 247 profile:profile |
| 247 browser:browser | 248 browser:browser |
| 248 nibFileNamed:@"Toolbar"])) { | 249 nibFileNamed:@"Toolbar"])) { |
| 250 // Start global error services now so we badge the menu correctly. | |
| 251 SyncGlobalErrorFactory::GetForProfile(profile); | |
|
Evan Stade
2015/09/03 00:47:12
groby, please review changes to this file. This is
groby-ooo-7-16
2015/09/03 17:19:39
Question: Would it be better to hoist that up to t
Evan Stade
2015/09/03 17:51:28
In theory, yes, but on Views we apparently only do
| |
| 249 } | 252 } |
| 250 return self; | 253 return self; |
| 251 } | 254 } |
| 252 | 255 |
| 253 // Called after the view is done loading and the outlets have been hooked up. | 256 // Called after the view is done loading and the outlets have been hooked up. |
| 254 // Now we can hook up bridges that rely on UI objects such as the location bar | 257 // Now we can hook up bridges that rely on UI objects such as the location bar |
| 255 // and button state. -viewDidLoad is the recommended way to do this in 10.10 | 258 // and button state. -viewDidLoad is the recommended way to do this in 10.10 |
| 256 // SDK. When running on 10.10 or above -awakeFromNib still works but for some | 259 // SDK. When running on 10.10 or above -awakeFromNib still works but for some |
| 257 // reason is not guaranteed to be called (http://crbug.com/526276), so implement | 260 // reason is not guaranteed to be called (http://crbug.com/526276), so implement |
| 258 // both. | 261 // both. |
| (...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 967 - (void)hideDropURLsIndicatorInView:(NSView*)view { | 970 - (void)hideDropURLsIndicatorInView:(NSView*)view { |
| 968 // Do nothing. | 971 // Do nothing. |
| 969 } | 972 } |
| 970 | 973 |
| 971 // (URLDropTargetController protocol) | 974 // (URLDropTargetController protocol) |
| 972 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { | 975 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { |
| 973 return drag_util::IsUnsupportedDropData(profile_, info); | 976 return drag_util::IsUnsupportedDropData(profile_, info); |
| 974 } | 977 } |
| 975 | 978 |
| 976 @end | 979 @end |
| OLD | NEW |