| OLD | NEW |
| 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 "base/prefs/public/pref_member.h" |
| 10 #include "chrome/browser/command_updater.h" | 10 #include "chrome/browser/command_updater.h" |
| 11 #include "chrome/browser/command_updater_delegate.h" | 11 #include "chrome/browser/command_updater_delegate.h" |
| 12 #include "chrome/browser/profiles/profile_info_cache_observer.h" | 12 #include "chrome/browser/profiles/profile_info_cache_observer.h" |
| 13 #include "chrome/browser/sessions/tab_restore_service_observer.h" | 13 #include "chrome/browser/sessions/tab_restore_service_observer.h" |
| 14 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" | 14 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
| 15 #include "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" |
| 16 #include "content/public/browser/notification_registrar.h" | 16 #include "content/public/browser/notification_registrar.h" |
| 17 #include "ui/base/window_open_disposition.h" | 17 #include "ui/base/window_open_disposition.h" |
| 18 | 18 |
| 19 class Browser; | 19 class Browser; |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 // window is in. | 162 // window is in. |
| 163 void UpdateCommandsForFullscreenMode(FullScreenMode fullscreen_mode); | 163 void UpdateCommandsForFullscreenMode(FullScreenMode fullscreen_mode); |
| 164 | 164 |
| 165 // Update commands whose state depends on whether multiple profiles are | 165 // Update commands whose state depends on whether multiple profiles are |
| 166 // allowed. | 166 // allowed. |
| 167 void UpdateCommandsForMultipleProfiles(); | 167 void UpdateCommandsForMultipleProfiles(); |
| 168 | 168 |
| 169 // Updates the printing command state. | 169 // Updates the printing command state. |
| 170 void UpdatePrintingState(); | 170 void UpdatePrintingState(); |
| 171 | 171 |
| 172 // Updates the SHOW_SYNC_SETUP menu entry. |
| 173 void OnSigninAllowedPrefChange(); |
| 174 |
| 172 // Updates the save-page-as command state. | 175 // Updates the save-page-as command state. |
| 173 void UpdateSaveAsState(); | 176 void UpdateSaveAsState(); |
| 174 | 177 |
| 178 // Updates the show-sync command state. |
| 179 void UpdateShowSyncState(bool show_main_ui); |
| 180 |
| 175 // Ask the Reload/Stop button to change its icon, and update the Stop command | 181 // Ask the Reload/Stop button to change its icon, and update the Stop command |
| 176 // state. |is_loading| is true if the current WebContents is loading. | 182 // state. |is_loading| is true if the current WebContents is loading. |
| 177 // |force| is true if the button should change its icon immediately. | 183 // |force| is true if the button should change its icon immediately. |
| 178 void UpdateReloadStopState(bool is_loading, bool force); | 184 void UpdateReloadStopState(bool is_loading, bool force); |
| 179 | 185 |
| 180 // Updates commands for find. | 186 // Updates commands for find. |
| 181 void UpdateCommandsForFind(); | 187 void UpdateCommandsForFind(); |
| 182 | 188 |
| 183 // Add/remove observers for interstitial attachment/detachment from | 189 // Add/remove observers for interstitial attachment/detachment from |
| 184 // |contents|. | 190 // |contents|. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 200 | 206 |
| 201 // Stores the last blocked command id when |block_command_execution_| is true. | 207 // Stores the last blocked command id when |block_command_execution_| is true. |
| 202 int last_blocked_command_id_; | 208 int last_blocked_command_id_; |
| 203 | 209 |
| 204 // Stores the disposition type of the last blocked command. | 210 // Stores the disposition type of the last blocked command. |
| 205 WindowOpenDisposition last_blocked_command_disposition_; | 211 WindowOpenDisposition last_blocked_command_disposition_; |
| 206 | 212 |
| 207 content::NotificationRegistrar registrar_; | 213 content::NotificationRegistrar registrar_; |
| 208 PrefChangeRegistrar profile_pref_registrar_; | 214 PrefChangeRegistrar profile_pref_registrar_; |
| 209 PrefChangeRegistrar local_pref_registrar_; | 215 PrefChangeRegistrar local_pref_registrar_; |
| 216 BooleanPrefMember pref_signin_allowed_; |
| 210 | 217 |
| 211 DISALLOW_COPY_AND_ASSIGN(BrowserCommandController); | 218 DISALLOW_COPY_AND_ASSIGN(BrowserCommandController); |
| 212 }; | 219 }; |
| 213 | 220 |
| 214 } // namespace chrome | 221 } // namespace chrome |
| 215 | 222 |
| 216 #endif // CHROME_BROWSER_UI_BROWSER_COMMAND_CONTROLLER_H_ | 223 #endif // CHROME_BROWSER_UI_BROWSER_COMMAND_CONTROLLER_H_ |
| OLD | NEW |