| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #import "base/mac/bundle_locations.h" | 9 #import "base/mac/bundle_locations.h" |
| 10 #import "base/mac/foundation_util.h" | 10 #import "base/mac/foundation_util.h" |
| 11 #include "base/mac/mac_util.h" |
| 11 #import "base/mac/sdk_forward_declarations.h" | 12 #import "base/mac/sdk_forward_declarations.h" |
| 12 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
| 13 #include "base/strings/sys_string_conversions.h" | 14 #include "base/strings/sys_string_conversions.h" |
| 14 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 15 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 15 #include "chrome/browser/bookmarks/bookmark_stats.h" | 16 #include "chrome/browser/bookmarks/bookmark_stats.h" |
| 16 #include "chrome/browser/bookmarks/managed_bookmark_service_factory.h" | 17 #include "chrome/browser/bookmarks/managed_bookmark_service_factory.h" |
| 17 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 18 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 18 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
| 19 #include "chrome/browser/themes/theme_properties.h" | 20 #include "chrome/browser/themes/theme_properties.h" |
| 20 #include "chrome/browser/themes/theme_service.h" | 21 #include "chrome/browser/themes/theme_service.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 34 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" | 35 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" |
| 35 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h" | 36 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h" |
| 36 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_context_menu_cocoa_controlle
r.h" | 37 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_context_menu_cocoa_controlle
r.h" |
| 37 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.h" | 38 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.h" |
| 38 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_folder_target.h" | 39 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_folder_target.h" |
| 39 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.h" | 40 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.h" |
| 40 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_model_observer_for_cocoa.h" | 41 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_model_observer_for_cocoa.h" |
| 41 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.h" | 42 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.h" |
| 42 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 43 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 43 #import "chrome/browser/ui/cocoa/menu_button.h" | 44 #import "chrome/browser/ui/cocoa/menu_button.h" |
| 44 #import "chrome/browser/ui/cocoa/presentation_mode_controller.h" | |
| 45 #import "chrome/browser/ui/cocoa/themed_window.h" | 45 #import "chrome/browser/ui/cocoa/themed_window.h" |
| 46 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" | 46 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" |
| 47 #import "chrome/browser/ui/cocoa/view_id_util.h" | 47 #import "chrome/browser/ui/cocoa/view_id_util.h" |
| 48 #import "chrome/browser/ui/cocoa/view_resizer.h" | 48 #import "chrome/browser/ui/cocoa/view_resizer.h" |
| 49 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 49 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 50 #include "chrome/common/extensions/extension_constants.h" | 50 #include "chrome/common/extensions/extension_constants.h" |
| 51 #include "chrome/common/extensions/extension_metrics.h" | 51 #include "chrome/common/extensions/extension_metrics.h" |
| 52 #include "chrome/common/url_constants.h" | 52 #include "chrome/common/url_constants.h" |
| 53 #include "chrome/grit/generated_resources.h" | 53 #include "chrome/grit/generated_resources.h" |
| 54 #include "components/bookmarks/browser/bookmark_model.h" | 54 #include "components/bookmarks/browser/bookmark_model.h" |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 // no longer visible), or add/remove the "off the side" menu. | 529 // no longer visible), or add/remove the "off the side" menu. |
| 530 [[self view] setPostsFrameChangedNotifications:YES]; | 530 [[self view] setPostsFrameChangedNotifications:YES]; |
| 531 [[NSNotificationCenter defaultCenter] | 531 [[NSNotificationCenter defaultCenter] |
| 532 addObserver:self | 532 addObserver:self |
| 533 selector:@selector(frameDidChange) | 533 selector:@selector(frameDidChange) |
| 534 name:NSViewFrameDidChangeNotification | 534 name:NSViewFrameDidChangeNotification |
| 535 object:[self view]]; | 535 object:[self view]]; |
| 536 | 536 |
| 537 // Watch for things going to or from fullscreen. | 537 // Watch for things going to or from fullscreen. |
| 538 [[NSNotificationCenter defaultCenter] | 538 [[NSNotificationCenter defaultCenter] |
| 539 addObserver:self | 539 addObserver:self |
| 540 selector:@selector(willEnterOrLeaveFullscreen:) | 540 selector:@selector(willEnterOrLeaveFullscreen:) |
| 541 name:kWillEnterFullscreenNotification | 541 name:NSWindowWillEnterFullScreenNotification |
| 542 object:nil]; | 542 object:nil]; |
| 543 [[NSNotificationCenter defaultCenter] | 543 [[NSNotificationCenter defaultCenter] |
| 544 addObserver:self | 544 addObserver:self |
| 545 selector:@selector(willEnterOrLeaveFullscreen:) | 545 selector:@selector(willEnterOrLeaveFullscreen:) |
| 546 name:kWillLeaveFullscreenNotification | 546 name:NSWindowWillExitFullScreenNotification |
| 547 object:nil]; | 547 object:nil]; |
| 548 | 548 |
| 549 // Don't pass ourself along (as 'self') until our init is completely | 549 // Don't pass ourself along (as 'self') until our init is completely |
| 550 // done. Thus, this call is (almost) last. | 550 // done. Thus, this call is (almost) last. |
| 551 bridge_.reset(new BookmarkBarBridge(browser_->profile(), self, | 551 bridge_.reset(new BookmarkBarBridge(browser_->profile(), self, |
| 552 bookmarkModel_)); | 552 bookmarkModel_)); |
| 553 } | 553 } |
| 554 | 554 |
| 555 // Called by our main view (a BookmarkBarView) when it gets moved to a | 555 // Called by our main view (a BookmarkBarView) when it gets moved to a |
| 556 // window. We perform operations which need to know the relevant | 556 // window. We perform operations which need to know the relevant |
| 557 // window (e.g. watch for a window close) so they can't be performed | 557 // window (e.g. watch for a window close) so they can't be performed |
| (...skipping 2537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3095 - (id<BookmarkButtonControllerProtocol>)controllerForNode: | 3095 - (id<BookmarkButtonControllerProtocol>)controllerForNode: |
| 3096 (const BookmarkNode*)node { | 3096 (const BookmarkNode*)node { |
| 3097 // See if it's in the bar, then if it is in the hierarchy of visible | 3097 // See if it's in the bar, then if it is in the hierarchy of visible |
| 3098 // folder menus. | 3098 // folder menus. |
| 3099 if (bookmarkModel_->bookmark_bar_node() == node) | 3099 if (bookmarkModel_->bookmark_bar_node() == node) |
| 3100 return self; | 3100 return self; |
| 3101 return [folderController_ controllerForNode:node]; | 3101 return [folderController_ controllerForNode:node]; |
| 3102 } | 3102 } |
| 3103 | 3103 |
| 3104 @end | 3104 @end |
| OLD | NEW |