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

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_controller.h

Issue 117533002: [Mac] Redesign of the avatar menu button (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tabstrip width Created 6 years, 11 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 | Annotate | Revision Log
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_BROWSER_WINDOW_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_
7 7
8 // A class acting as the Objective-C controller for the Browser 8 // A class acting as the Objective-C controller for the Browser
9 // object. Handles interactions between Cocoa and the cross-platform 9 // object. Handles interactions between Cocoa and the cross-platform
10 // code. Each window has a single toolbar and, by virtue of being a 10 // code. Each window has a single toolbar and, by virtue of being a
11 // TabWindowController, a tab strip along the top. 11 // TabWindowController, a tab strip along the top.
12 12
13 #import <Cocoa/Cocoa.h> 13 #import <Cocoa/Cocoa.h>
14 14
15 #include "base/mac/scoped_nsobject.h" 15 #include "base/mac/scoped_nsobject.h"
16 #include "base/memory/scoped_ptr.h" 16 #include "base/memory/scoped_ptr.h"
17 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" 17 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h"
18 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.h" 18 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.h"
19 #import "chrome/browser/ui/cocoa/browser_command_executor.h" 19 #import "chrome/browser/ui/cocoa/browser_command_executor.h"
20 #import "chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.h" 20 #import "chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.h"
21 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" 21 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h"
22 #import "chrome/browser/ui/cocoa/tabs/tab_window_controller.h" 22 #import "chrome/browser/ui/cocoa/tabs/tab_window_controller.h"
23 #import "chrome/browser/ui/cocoa/themed_window.h" 23 #import "chrome/browser/ui/cocoa/themed_window.h"
24 #import "chrome/browser/ui/cocoa/url_drop_target.h" 24 #import "chrome/browser/ui/cocoa/url_drop_target.h"
25 #import "chrome/browser/ui/cocoa/view_resizer.h" 25 #import "chrome/browser/ui/cocoa/view_resizer.h"
26 #include "ui/gfx/rect.h" 26 #include "ui/gfx/rect.h"
27 27
28 @class AvatarButtonController; 28 @class AvatarButtonController;
29 @class NewAvatarButtonController;
29 class Browser; 30 class Browser;
30 class BrowserWindow; 31 class BrowserWindow;
31 class BrowserWindowCocoa; 32 class BrowserWindowCocoa;
32 @class DevToolsController; 33 @class DevToolsController;
33 @class DownloadShelfController; 34 @class DownloadShelfController;
34 class ExtensionKeybindingRegistryCocoa; 35 class ExtensionKeybindingRegistryCocoa;
35 @class FindBarCocoaController; 36 @class FindBarCocoaController;
36 @class FullscreenModeController; 37 @class FullscreenModeController;
37 @class FullscreenWindow; 38 @class FullscreenWindow;
38 @class InfoBarContainerController; 39 @class InfoBarContainerController;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 // The raw accumulated zoom value and the actual zoom increments made for an 102 // The raw accumulated zoom value and the actual zoom increments made for an
102 // an in-progress pinch gesture. 103 // an in-progress pinch gesture.
103 CGFloat totalMagnifyGestureAmount_; 104 CGFloat totalMagnifyGestureAmount_;
104 NSInteger currentZoomStepDelta_; 105 NSInteger currentZoomStepDelta_;
105 106
106 // The view controller that manages the incognito badge or the multi-profile 107 // The view controller that manages the incognito badge or the multi-profile
107 // avatar icon. The view is always in the view hierarchy, but will be hidden 108 // avatar icon. The view is always in the view hierarchy, but will be hidden
108 // unless it's appropriate to show it. 109 // unless it's appropriate to show it.
109 base::scoped_nsobject<AvatarButtonController> avatarButtonController_; 110 base::scoped_nsobject<AvatarButtonController> avatarButtonController_;
110 111
112 // The view controller that manages the new multi-profile avatar button.
113 // It is always shown, except for incognito profiles, in which case the
114 // incognito badge is shown.
115 base::scoped_nsobject<NewAvatarButtonController> newAvatarButtonController_;
116
111 // Lazily created view which draws the background for the floating set of bars 117 // Lazily created view which draws the background for the floating set of bars
112 // in presentation mode (for window types having a floating bar; it remains 118 // in presentation mode (for window types having a floating bar; it remains
113 // nil for those which don't). 119 // nil for those which don't).
114 base::scoped_nsobject<NSView> floatingBarBackingView_; 120 base::scoped_nsobject<NSView> floatingBarBackingView_;
115 121
116 // The borderless window used in fullscreen mode. Lion reuses the original 122 // The borderless window used in fullscreen mode. Lion reuses the original
117 // window in fullscreen mode, so this is always nil on Lion. 123 // window in fullscreen mode, so this is always nil on Lion.
118 base::scoped_nsobject<NSWindow> fullscreenWindow_; 124 base::scoped_nsobject<NSWindow> fullscreenWindow_;
119 125
120 // Tracks whether presentation mode was entered from fullscreen mode or 126 // Tracks whether presentation mode was entered from fullscreen mode or
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 223
218 // Returns a weak pointer to the overlayable contents controller. 224 // Returns a weak pointer to the overlayable contents controller.
219 - (OverlayableContentsController*)overlayableContentsController; 225 - (OverlayableContentsController*)overlayableContentsController;
220 226
221 // Access the Profile object that backs this Browser. 227 // Access the Profile object that backs this Browser.
222 - (Profile*)profile; 228 - (Profile*)profile;
223 229
224 // Access the avatar button controller. 230 // Access the avatar button controller.
225 - (AvatarButtonController*)avatarButtonController; 231 - (AvatarButtonController*)avatarButtonController;
226 232
233 - (NewAvatarButtonController*)newAvatarButtonController;
234
227 // Forces the toolbar (and transitively the location bar) to update its current 235 // Forces the toolbar (and transitively the location bar) to update its current
228 // state. If |tab| is non-NULL, we're switching (back?) to this tab and should 236 // state. If |tab| is non-NULL, we're switching (back?) to this tab and should
229 // restore any previous location bar state (such as user editing) as well. 237 // restore any previous location bar state (such as user editing) as well.
230 - (void)updateToolbarWithContents:(content::WebContents*)tab; 238 - (void)updateToolbarWithContents:(content::WebContents*)tab;
231 239
232 // Sets whether or not the current page in the frontmost tab is bookmarked. 240 // Sets whether or not the current page in the frontmost tab is bookmarked.
233 - (void)setStarredState:(BOOL)isStarred; 241 - (void)setStarredState:(BOOL)isStarred;
234 242
235 // Happens when the zoom level is changed in the active tab, the active tab is 243 // Happens when the zoom level is changed in the active tab, the active tab is
236 // changed, or a new browser window or tab is created. |canShowBubble| denotes 244 // changed, or a new browser window or tab is created. |canShowBubble| denotes
(...skipping 20 matching lines...) Expand all
257 265
258 // Returns the frame of the regular (non-fullscreened) window (even if the 266 // Returns the frame of the regular (non-fullscreened) window (even if the
259 // window is currently in fullscreen mode). The frame is returned in Cocoa 267 // window is currently in fullscreen mode). The frame is returned in Cocoa
260 // coordinates (origin in bottom-left). 268 // coordinates (origin in bottom-left).
261 - (NSRect)regularWindowFrame; 269 - (NSRect)regularWindowFrame;
262 270
263 // Whether or not to show the avatar, which is either the incognito guy or the 271 // Whether or not to show the avatar, which is either the incognito guy or the
264 // user's profile avatar. 272 // user's profile avatar.
265 - (BOOL)shouldShowAvatar; 273 - (BOOL)shouldShowAvatar;
266 274
275 // Whether or not to show the new avatar button used by --new-profile-maagement.
Nico 2014/01/07 23:20:33 typo maagement Why is this behind a flag? Can it
noms (inactive) 2014/01/08 15:05:31 This isn't ready to become the new look immediatel
276 - (BOOL)shouldUseNewAvatarButton;
277
267 - (BOOL)isBookmarkBarVisible; 278 - (BOOL)isBookmarkBarVisible;
268 279
269 // Returns YES if the bookmark bar is currently animating. 280 // Returns YES if the bookmark bar is currently animating.
270 - (BOOL)isBookmarkBarAnimating; 281 - (BOOL)isBookmarkBarAnimating;
271 282
272 - (BookmarkBarController*)bookmarkBarController; 283 - (BookmarkBarController*)bookmarkBarController;
273 284
274 - (DevToolsController*)devToolsController; 285 - (DevToolsController*)devToolsController;
275 286
276 - (BOOL)isDownloadShelfVisible; 287 - (BOOL)isDownloadShelfVisible;
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 // positioned relative to. 507 // positioned relative to.
497 - (NSRect)omniboxPopupAnchorRect; 508 - (NSRect)omniboxPopupAnchorRect;
498 509
499 // Force a layout of info bars. 510 // Force a layout of info bars.
500 - (void)layoutInfoBars; 511 - (void)layoutInfoBars;
501 512
502 @end // @interface BrowserWindowController (TestingAPI) 513 @end // @interface BrowserWindowController (TestingAPI)
503 514
504 515
505 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ 516 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698