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

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: Fix whitespace 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 BOOL lastProfileWasDeleted;
Roger Tawa OOO till Jul 10th 2013/05/14 14:38:40 Please add trailing _ and comment.
noms (inactive) 2013/05/14 15:06:48 Done.
44
45 // The ProfileObserver observes the ProfileInfoCache and gets notified
46 // when a profile has been deleted.
47 scoped_ptr<AppControllerProfileObserver> profileInfoCacheObserver_;
48
42 // Management of the bookmark menu which spans across all windows 49 // Management of the bookmark menu which spans across all windows
43 // (and Browser*s). 50 // (and Browser*s).
44 scoped_ptr<BookmarkMenuBridge> bookmarkMenuBridge_; 51 scoped_ptr<BookmarkMenuBridge> bookmarkMenuBridge_;
45 scoped_ptr<HistoryMenuBridge> historyMenuBridge_; 52 scoped_ptr<HistoryMenuBridge> historyMenuBridge_;
46 53
47 // The profile menu, which appears right before the Help menu. It is only 54 // The profile menu, which appears right before the Help menu. It is only
48 // available when multiple profiles is enabled. 55 // available when multiple profiles is enabled.
49 scoped_nsobject<ProfileMenuController> profileMenuController_; 56 scoped_nsobject<ProfileMenuController> profileMenuController_;
50 57
51 // If we're told to open URLs (in particular, via |-application:openFiles:| by 58 // 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 101 // 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 102 // sheets) will not count as blocking the browser. But things like open/save
96 // dialogs that are window modal will block the browser. 103 // dialogs that are window modal will block the browser.
97 - (BOOL)keyWindowIsModal; 104 - (BOOL)keyWindowIsModal;
98 105
99 // Show the preferences window, or bring it to the front if it's already 106 // Show the preferences window, or bring it to the front if it's already
100 // visible. 107 // visible.
101 - (IBAction)showPreferences:(id)sender; 108 - (IBAction)showPreferences:(id)sender;
102 109
103 // Redirect in the menu item from the expected target of "File's 110 // Redirect in the menu item from the expected target of "File's
104 // Owner" (NSAppliation) for a Branded About Box 111 // Owner" (NSApplication) for a Branded About Box
105 - (IBAction)orderFrontStandardAboutPanel:(id)sender; 112 - (IBAction)orderFrontStandardAboutPanel:(id)sender;
106 113
107 // Toggles the "Confirm to Quit" preference. 114 // Toggles the "Confirm to Quit" preference.
108 - (IBAction)toggleConfirmToQuit:(id)sender; 115 - (IBAction)toggleConfirmToQuit:(id)sender;
109 116
110 // Delegate method to return the dock menu. 117 // Delegate method to return the dock menu.
111 - (NSMenu*)applicationDockMenu:(NSApplication*)sender; 118 - (NSMenu*)applicationDockMenu:(NSApplication*)sender;
112 119
113 // Get the URLs that Launch Services expects the browser to open at startup. 120 // Get the URLs that Launch Services expects the browser to open at startup.
114 - (const std::vector<GURL>&)startupUrls; 121 - (const std::vector<GURL>&)startupUrls;
(...skipping 16 matching lines...) Expand all
131 namespace app_controller_mac { 138 namespace app_controller_mac {
132 139
133 // True if we are currently handling an IDC_NEW_{TAB,WINDOW} command. Used in 140 // 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 141 // SessionService::Observe() to get around windows/linux and mac having
135 // different models of application lifetime. 142 // different models of application lifetime.
136 bool IsOpeningNewWindow(); 143 bool IsOpeningNewWindow();
137 144
138 } // namespace app_controller_mac 145 } // namespace app_controller_mac
139 146
140 #endif 147 #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