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

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

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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
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 <stdint.h> 9 #include <stdint.h>
10
10 #include <map> 11 #include <map>
12 #include <memory>
11 13
12 #import "base/mac/cocoa_protocols.h" 14 #import "base/mac/cocoa_protocols.h"
13 #include "base/mac/scoped_nsobject.h" 15 #include "base/mac/scoped_nsobject.h"
14 #include "base/memory/scoped_ptr.h"
15 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge.h" 16 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge.h"
16 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h" 17 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h"
17 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_state.h" 18 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_state.h"
18 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.h" 19 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.h"
19 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" 20 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h"
20 #import "chrome/browser/ui/cocoa/has_weak_browser_pointer.h" 21 #import "chrome/browser/ui/cocoa/has_weak_browser_pointer.h"
21 #include "chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h" 22 #include "chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h"
22 #include "ui/base/window_open_disposition.h" 23 #include "ui/base/window_open_disposition.h"
23 24
24 @class BookmarkBarController; 25 @class BookmarkBarController;
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 198
198 // The default image, so we can use one copy for all buttons. 199 // The default image, so we can use one copy for all buttons.
199 base::scoped_nsobject<NSImage> defaultImage_; 200 base::scoped_nsobject<NSImage> defaultImage_;
200 201
201 // If the bar is disabled, we hide it and ignore show/hide commands. 202 // If the bar is disabled, we hide it and ignore show/hide commands.
202 // Set when using fullscreen mode. 203 // Set when using fullscreen mode.
203 BOOL barIsEnabled_; 204 BOOL barIsEnabled_;
204 205
205 // Bridge from Chrome-style C++ notifications (e.g. derived from 206 // Bridge from Chrome-style C++ notifications (e.g. derived from
206 // BookmarkModelObserver) 207 // BookmarkModelObserver)
207 scoped_ptr<BookmarkBarBridge> bridge_; 208 std::unique_ptr<BookmarkBarBridge> bridge_;
208 209
209 // Delegate that is informed about state changes in the bookmark bar. 210 // Delegate that is informed about state changes in the bookmark bar.
210 id<BookmarkBarControllerDelegate> delegate_; // weak 211 id<BookmarkBarControllerDelegate> delegate_; // weak
211 212
212 // Logic for dealing with a click on a bookmark folder button. 213 // Logic for dealing with a click on a bookmark folder button.
213 base::scoped_nsobject<BookmarkFolderTarget> folderTarget_; 214 base::scoped_nsobject<BookmarkFolderTarget> folderTarget_;
214 215
215 // A controller for a pop-up bookmark folder window (custom menu). 216 // A controller for a pop-up bookmark folder window (custom menu).
216 // This is not a scoped_nsobject because it owns itself (when its 217 // This is not a scoped_nsobject because it owns itself (when its
217 // window closes the controller gets autoreleased). 218 // window closes the controller gets autoreleased).
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 base::scoped_nsobject<BookmarkContextMenuCocoaController> 287 base::scoped_nsobject<BookmarkContextMenuCocoaController>
287 contextMenuController_; 288 contextMenuController_;
288 289
289 // Weak pointer to the pulsed button for the currently pulsing node. We need 290 // Weak pointer to the pulsed button for the currently pulsing node. We need
290 // to store this as it may not be possible to determine the pulsing button if 291 // to store this as it may not be possible to determine the pulsing button if
291 // the pulsing node is deleted. Nil if there is no pulsing node. 292 // the pulsing node is deleted. Nil if there is no pulsing node.
292 BookmarkButton* pulsingButton_; 293 BookmarkButton* pulsingButton_;
293 294
294 // Specifically watch the currently pulsing node. This lets us stop pulsing 295 // Specifically watch the currently pulsing node. This lets us stop pulsing
295 // when anything happens to the node. Null if there is no pulsing node. 296 // when anything happens to the node. Null if there is no pulsing node.
296 scoped_ptr<BookmarkModelObserverForCocoa> pulsingBookmarkObserver_; 297 std::unique_ptr<BookmarkModelObserverForCocoa> pulsingBookmarkObserver_;
297 } 298 }
298 299
299 @property(readonly, nonatomic) BookmarkBar::State currentState; 300 @property(readonly, nonatomic) BookmarkBar::State currentState;
300 @property(readonly, nonatomic) BookmarkBar::State lastState; 301 @property(readonly, nonatomic) BookmarkBar::State lastState;
301 @property(readonly, nonatomic) BOOL isAnimationRunning; 302 @property(readonly, nonatomic) BOOL isAnimationRunning;
302 @property(assign, nonatomic) id<BookmarkBarControllerDelegate> delegate; 303 @property(assign, nonatomic) id<BookmarkBarControllerDelegate> delegate;
303 @property(assign, nonatomic) BOOL stateAnimationsEnabled; 304 @property(assign, nonatomic) BOOL stateAnimationsEnabled;
304 @property(assign, nonatomic) BOOL innerContentAnimationsEnabled; 305 @property(assign, nonatomic) BOOL innerContentAnimationsEnabled;
305 306
306 // Initializes the bookmark bar controller with the given browser and delegate. 307 // Initializes the bookmark bar controller with the given browser and delegate.
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 - (BookmarkButton*)buttonForDroppingOnAtPoint:(NSPoint)point; 443 - (BookmarkButton*)buttonForDroppingOnAtPoint:(NSPoint)point;
443 - (BOOL)isEventAnExitEvent:(NSEvent*)event; 444 - (BOOL)isEventAnExitEvent:(NSEvent*)event;
444 - (BOOL)shrinkOrHideView:(NSView*)view forMaxX:(CGFloat)maxViewX; 445 - (BOOL)shrinkOrHideView:(NSView*)view forMaxX:(CGFloat)maxViewX;
445 - (void)unhighlightBookmark:(const bookmarks::BookmarkNode*)node; 446 - (void)unhighlightBookmark:(const bookmarks::BookmarkNode*)node;
446 447
447 // The following are for testing purposes only and are not used internally. 448 // The following are for testing purposes only and are not used internally.
448 - (NSMenu *)menuForFolderNode:(const bookmarks::BookmarkNode*)node; 449 - (NSMenu *)menuForFolderNode:(const bookmarks::BookmarkNode*)node;
449 @end 450 @end
450 451
451 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_CONTROLLER_H_ 452 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698