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

Side by Side Diff: chrome/browser/app_controller_mac.h

Issue 14923004: [Mac] AppController needs to update its "last profile" pointer when the active profile is deleted (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: deal with multiple simultaneous deletions Created 7 years, 7 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_APP_CONTROLLER_MAC_H_ 5 #ifndef CHROME_BROWSER_APP_CONTROLLER_MAC_H_
6 #define CHROME_BROWSER_APP_CONTROLLER_MAC_H_ 6 #define CHROME_BROWSER_APP_CONTROLLER_MAC_H_
7 7
8 #if defined(__OBJC__) 8 #if defined(__OBJC__)
9 9
10 #import <Cocoa/Cocoa.h> 10 #import <Cocoa/Cocoa.h>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/memory/scoped_nsobject.h" 13 #include "base/memory/scoped_nsobject.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/observer_list.h" 15 #include "base/observer_list.h"
16 #include "base/prefs/pref_change_registrar.h" 16 #include "base/prefs/pref_change_registrar.h"
17 #include "ui/base/work_area_watcher_observer.h" 17 #include "ui/base/work_area_watcher_observer.h"
18 18
19 class AppControllerProfileObserver;
19 class BookmarkMenuBridge; 20 class BookmarkMenuBridge;
20 class CommandUpdater; 21 class CommandUpdater;
21 class GURL; 22 class GURL;
22 class HistoryMenuBridge; 23 class HistoryMenuBridge;
23 class Profile; 24 class Profile;
24 @class ProfileMenuController; 25 @class ProfileMenuController;
25 namespace ui { 26 namespace ui {
26 class WorkAreaWatcherObserver; 27 class WorkAreaWatcherObserver;
27 } 28 }
28 29
29 // The application controller object, created by loading the MainMenu nib. 30 // The application controller object, created by loading the MainMenu nib.
30 // This handles things like responding to menus when there are no windows 31 // This handles things like responding to menus when there are no windows
31 // open, etc and acts as the NSApplication delegate. 32 // open, etc and acts as the NSApplication delegate.
32 @interface AppController : NSObject<NSUserInterfaceValidations, 33 @interface AppController : NSObject<NSUserInterfaceValidations,
33 NSApplicationDelegate> { 34 NSApplicationDelegate> {
34 @private 35 @private
35 // Manages the state of the command menu items. 36 // Manages the state of the command menu items.
36 scoped_ptr<CommandUpdater> menuState_; 37 scoped_ptr<CommandUpdater> menuState_;
37 38
38 // The profile last used by a Browser. It is this profile that was used to 39 // The profile last used by a Browser. It is this profile that was used to
39 // build the user-data specific main menu items. 40 // build the user-data specific main menu items.
40 Profile* lastProfile_; 41 Profile* lastProfile_;
41 42
43 // If YES, then the active profile was deleted and we must update the
44 // lastProfile_ instance to the next active profile and rebuild the
45 // user-data menus.
46 BOOL lastProfileWasDeleted_;
47
48 // The ProfileObserver observes the ProfileInfoCache and gets notified
49 // when a profile has been deleted.
50 scoped_ptr<AppControllerProfileObserver> profileInfoCacheObserver_;
51
42 // Management of the bookmark menu which spans across all windows 52 // Management of the bookmark menu which spans across all windows
43 // (and Browser*s). 53 // (and Browser*s).
44 scoped_ptr<BookmarkMenuBridge> bookmarkMenuBridge_; 54 scoped_ptr<BookmarkMenuBridge> bookmarkMenuBridge_;
45 scoped_ptr<HistoryMenuBridge> historyMenuBridge_; 55 scoped_ptr<HistoryMenuBridge> historyMenuBridge_;
46 56
47 // The profile menu, which appears right before the Help menu. It is only 57 // The profile menu, which appears right before the Help menu. It is only
48 // available when multiple profiles is enabled. 58 // available when multiple profiles is enabled.
49 scoped_nsobject<ProfileMenuController> profileMenuController_; 59 scoped_nsobject<ProfileMenuController> profileMenuController_;
50 60
51 // If we're told to open URLs (in particular, via |-application:openFiles:| by 61 // If we're told to open URLs (in particular, via |-application:openFiles:| by
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 // modal) blocking the active browser. Note that tab modal dialogs (HTTP auth 104 // modal) blocking the active browser. Note that tab modal dialogs (HTTP auth
95 // sheets) will not count as blocking the browser. But things like open/save 105 // sheets) will not count as blocking the browser. But things like open/save
96 // dialogs that are window modal will block the browser. 106 // dialogs that are window modal will block the browser.
97 - (BOOL)keyWindowIsModal; 107 - (BOOL)keyWindowIsModal;
98 108
99 // Show the preferences window, or bring it to the front if it's already 109 // Show the preferences window, or bring it to the front if it's already
100 // visible. 110 // visible.
101 - (IBAction)showPreferences:(id)sender; 111 - (IBAction)showPreferences:(id)sender;
102 112
103 // Redirect in the menu item from the expected target of "File's 113 // Redirect in the menu item from the expected target of "File's
104 // Owner" (NSAppliation) for a Branded About Box 114 // Owner" (NSApplication) for a Branded About Box
105 - (IBAction)orderFrontStandardAboutPanel:(id)sender; 115 - (IBAction)orderFrontStandardAboutPanel:(id)sender;
106 116
107 // Toggles the "Confirm to Quit" preference. 117 // Toggles the "Confirm to Quit" preference.
108 - (IBAction)toggleConfirmToQuit:(id)sender; 118 - (IBAction)toggleConfirmToQuit:(id)sender;
109 119
110 // Delegate method to return the dock menu. 120 // Delegate method to return the dock menu.
111 - (NSMenu*)applicationDockMenu:(NSApplication*)sender; 121 - (NSMenu*)applicationDockMenu:(NSApplication*)sender;
112 122
113 // Get the URLs that Launch Services expects the browser to open at startup. 123 // Get the URLs that Launch Services expects the browser to open at startup.
114 - (const std::vector<GURL>&)startupUrls; 124 - (const std::vector<GURL>&)startupUrls;
(...skipping 16 matching lines...) Expand all
131 namespace app_controller_mac { 141 namespace app_controller_mac {
132 142
133 // True if we are currently handling an IDC_NEW_{TAB,WINDOW} command. Used in 143 // True if we are currently handling an IDC_NEW_{TAB,WINDOW} command. Used in
134 // SessionService::Observe() to get around windows/linux and mac having 144 // SessionService::Observe() to get around windows/linux and mac having
135 // different models of application lifetime. 145 // different models of application lifetime.
136 bool IsOpeningNewWindow(); 146 bool IsOpeningNewWindow();
137 147
138 } // namespace app_controller_mac 148 } // namespace app_controller_mac
139 149
140 #endif 150 #endif
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/app_controller_mac.mm » ('j') | chrome/browser/app_controller_mac.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698