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

Side by Side Diff: chrome/browser/ui/browser_command_controller.h

Issue 11906008: Make Mac menu code obey incognito availability. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: adjust comment Created 7 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
« no previous file with comments | « chrome/browser/app_controller_mac.mm ('k') | chrome/browser/ui/browser_command_controller.cc » ('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_BROWSER_COMMAND_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_BROWSER_COMMAND_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_BROWSER_COMMAND_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_BROWSER_COMMAND_CONTROLLER_H_
7 7
8 #include "base/prefs/public/pref_change_registrar.h" 8 #include "base/prefs/public/pref_change_registrar.h"
9 #include "chrome/browser/api/sync/profile_sync_service_observer.h" 9 #include "chrome/browser/api/sync/profile_sync_service_observer.h"
10 #include "chrome/browser/command_updater.h" 10 #include "chrome/browser/command_updater.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 int GetLastBlockedCommand(WindowOpenDisposition* disposition); 59 int GetLastBlockedCommand(WindowOpenDisposition* disposition);
60 60
61 // Notifies the controller that state has changed in one of the following 61 // Notifies the controller that state has changed in one of the following
62 // areas and it should update command states. 62 // areas and it should update command states.
63 void TabStateChanged(); 63 void TabStateChanged();
64 void ContentRestrictionsChanged(); 64 void ContentRestrictionsChanged();
65 void FullscreenStateChanged(); 65 void FullscreenStateChanged();
66 void PrintingStateChanged(); 66 void PrintingStateChanged();
67 void LoadingStateChanged(bool is_loading, bool force); 67 void LoadingStateChanged(bool is_loading, bool force);
68 68
69 // Shared state updating: these functions are static and public to share with
70 // outside code.
71
72 // Updates the open-file state.
73 static void UpdateOpenFileState(CommandUpdater* command_updater);
74
75 // Update commands whose state depends on incognito mode availability and that
76 // only depend on the profile.
77 static void UpdateSharedCommandsForIncognitoAvailability(
78 CommandUpdater* command_updater,
79 Profile* profile);
80
69 private: 81 private:
70 enum FullScreenMode { 82 enum FullScreenMode {
71 // Not in fullscreen mode. 83 // Not in fullscreen mode.
72 FULLSCREEN_DISABLED, 84 FULLSCREEN_DISABLED,
73 85
74 // Fullscreen mode, occupying the whole screen. 86 // Fullscreen mode, occupying the whole screen.
75 FULLSCREEN_NORMAL, 87 FULLSCREEN_NORMAL,
76 88
77 // Fullscreen mode for metro snap, occupying the full height and 20% of 89 // Fullscreen mode for metro snap, occupying the full height and 20% of
78 // the screen width. 90 // the screen width.
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 // Update commands whose state depends on whether multiple profiles are 168 // Update commands whose state depends on whether multiple profiles are
157 // allowed. 169 // allowed.
158 void UpdateCommandsForMultipleProfiles(); 170 void UpdateCommandsForMultipleProfiles();
159 171
160 // Updates the printing command state. 172 // Updates the printing command state.
161 void UpdatePrintingState(); 173 void UpdatePrintingState();
162 174
163 // Updates the save-page-as command state. 175 // Updates the save-page-as command state.
164 void UpdateSaveAsState(); 176 void UpdateSaveAsState();
165 177
166 // Updates the open-file state (Mac Only).
167 void UpdateOpenFileState();
168
169 // Ask the Reload/Stop button to change its icon, and update the Stop command 178 // Ask the Reload/Stop button to change its icon, and update the Stop command
170 // state. |is_loading| is true if the current WebContents is loading. 179 // state. |is_loading| is true if the current WebContents is loading.
171 // |force| is true if the button should change its icon immediately. 180 // |force| is true if the button should change its icon immediately.
172 void UpdateReloadStopState(bool is_loading, bool force); 181 void UpdateReloadStopState(bool is_loading, bool force);
173 182
174 // Updates commands for find. 183 // Updates commands for find.
175 void UpdateCommandsForFind(); 184 void UpdateCommandsForFind();
176 185
177 // Add/remove observers for interstitial attachment/detachment from 186 // Add/remove observers for interstitial attachment/detachment from
178 // |contents|. 187 // |contents|.
(...skipping 22 matching lines...) Expand all
201 content::NotificationRegistrar registrar_; 210 content::NotificationRegistrar registrar_;
202 PrefChangeRegistrar profile_pref_registrar_; 211 PrefChangeRegistrar profile_pref_registrar_;
203 PrefChangeRegistrar local_pref_registrar_; 212 PrefChangeRegistrar local_pref_registrar_;
204 213
205 DISALLOW_COPY_AND_ASSIGN(BrowserCommandController); 214 DISALLOW_COPY_AND_ASSIGN(BrowserCommandController);
206 }; 215 };
207 216
208 } // namespace chrome 217 } // namespace chrome
209 218
210 #endif // CHROME_BROWSER_UI_BROWSER_COMMAND_CONTROLLER_H_ 219 #endif // CHROME_BROWSER_UI_BROWSER_COMMAND_CONTROLLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/app_controller_mac.mm ('k') | chrome/browser/ui/browser_command_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698