Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Side by Side Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h

Issue 1221173003: [Mac] Inform reference counted objects that hold a weak Browser* when the Browser is being destroye… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_CONTROLLER_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 #include <map> 9 #include <map>
10 10
11 #import "base/mac/cocoa_protocols.h" 11 #import "base/mac/cocoa_protocols.h"
12 #include "base/mac/scoped_nsobject.h" 12 #include "base/mac/scoped_nsobject.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge.h" 14 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge.h"
15 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h" 15 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h"
16 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_state.h" 16 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_state.h"
17 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.h" 17 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.h"
18 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" 18 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h"
19 #import "chrome/browser/ui/cocoa/has_weak_browser_pointer.h"
19 #include "chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h" 20 #include "chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h"
20 #include "ui/base/window_open_disposition.h" 21 #include "ui/base/window_open_disposition.h"
21 22
22 @class BookmarkBarController; 23 @class BookmarkBarController;
23 @class BookmarkBarFolderController; 24 @class BookmarkBarFolderController;
24 @class BookmarkBarView; 25 @class BookmarkBarView;
25 @class BookmarkButtonCell; 26 @class BookmarkButtonCell;
26 @class BookmarkFolderTarget; 27 @class BookmarkFolderTarget;
27 @class BookmarkContextMenuCocoaController; 28 @class BookmarkContextMenuCocoaController;
28 class Browser; 29 class Browser;
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 147
147 // Sent before the animation begins. 148 // Sent before the animation begins.
148 - (void)bookmarkBar:(BookmarkBarController*)controller 149 - (void)bookmarkBar:(BookmarkBarController*)controller
149 willAnimateFromState:(BookmarkBar::State)oldState 150 willAnimateFromState:(BookmarkBar::State)oldState
150 toState:(BookmarkBar::State)newState; 151 toState:(BookmarkBar::State)newState;
151 152
152 @end 153 @end
153 154
154 // A controller for the bookmark bar in the browser window. Handles showing 155 // A controller for the bookmark bar in the browser window. Handles showing
155 // and hiding based on the preference in the given profile. 156 // and hiding based on the preference in the given profile.
156 @interface BookmarkBarController : 157 @interface BookmarkBarController
157 NSViewController<BookmarkBarState, 158 : NSViewController<BookmarkBarState,
158 BookmarkBarToolbarViewController, 159 BookmarkBarToolbarViewController,
159 BookmarkButtonDelegate, 160 BookmarkButtonDelegate,
160 BookmarkButtonControllerProtocol, 161 BookmarkButtonControllerProtocol,
161 NSDraggingDestination> { 162 NSDraggingDestination,
163 HasWeakBrowserPointer> {
162 @private 164 @private
163 // The state of the bookmark bar. If an animation is running, this is set to 165 // The state of the bookmark bar. If an animation is running, this is set to
164 // the "destination" and |lastState_| is set to the "original" state. 166 // the "destination" and |lastState_| is set to the "original" state.
165 BookmarkBar::State currentState_; 167 BookmarkBar::State currentState_;
166 168
167 // The "original" state of the bookmark bar if an animation is running. 169 // The "original" state of the bookmark bar if an animation is running.
168 BookmarkBar::State lastState_; 170 BookmarkBar::State lastState_;
169 171
170 // YES if an animation is running. 172 // YES if an animation is running.
171 BOOL isAnimationRunning_; 173 BOOL isAnimationRunning_;
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 - (BookmarkButton*)buttonForDroppingOnAtPoint:(NSPoint)point; 424 - (BookmarkButton*)buttonForDroppingOnAtPoint:(NSPoint)point;
423 - (BOOL)isEventAnExitEvent:(NSEvent*)event; 425 - (BOOL)isEventAnExitEvent:(NSEvent*)event;
424 - (BOOL)shrinkOrHideView:(NSView*)view forMaxX:(CGFloat)maxViewX; 426 - (BOOL)shrinkOrHideView:(NSView*)view forMaxX:(CGFloat)maxViewX;
425 - (void)unhighlightBookmark:(const bookmarks::BookmarkNode*)node; 427 - (void)unhighlightBookmark:(const bookmarks::BookmarkNode*)node;
426 428
427 // The following are for testing purposes only and are not used internally. 429 // The following are for testing purposes only and are not used internally.
428 - (NSMenu *)menuForFolderNode:(const bookmarks::BookmarkNode*)node; 430 - (NSMenu *)menuForFolderNode:(const bookmarks::BookmarkNode*)node;
429 @end 431 @end
430 432
431 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_CONTROLLER_H_ 433 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698