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

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

Issue 1350653004: [sessions] Properly namespace recently-componentized TabRestore code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Mac Created 5 years, 3 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
« no previous file with comments | « chrome/browser/ui/browser.cc ('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 <vector> 8 #include <vector>
9 9
10 #include "base/prefs/pref_change_registrar.h" 10 #include "base/prefs/pref_change_registrar.h"
11 #include "base/prefs/pref_member.h" 11 #include "base/prefs/pref_member.h"
12 #include "chrome/browser/command_updater.h" 12 #include "chrome/browser/command_updater.h"
13 #include "chrome/browser/command_updater_delegate.h" 13 #include "chrome/browser/command_updater_delegate.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 "components/sessions/core/tab_restore_service_observer.h" 15 #include "components/sessions/core/tab_restore_service_observer.h"
16 #include "ui/base/window_open_disposition.h" 16 #include "ui/base/window_open_disposition.h"
17 17
18 class Browser; 18 class Browser;
19 class BrowserWindow; 19 class BrowserWindow;
20 class Profile; 20 class Profile;
21 21
22 namespace content { 22 namespace content {
23 struct NativeWebKeyboardEvent; 23 struct NativeWebKeyboardEvent;
24 } 24 }
25 25
26 namespace chrome { 26 namespace chrome {
27 27
28 class BrowserCommandController : public CommandUpdaterDelegate, 28 class BrowserCommandController : public CommandUpdaterDelegate,
29 public TabStripModelObserver, 29 public TabStripModelObserver,
30 public TabRestoreServiceObserver { 30 public sessions::TabRestoreServiceObserver {
31 public: 31 public:
32 explicit BrowserCommandController(Browser* browser); 32 explicit BrowserCommandController(Browser* browser);
33 ~BrowserCommandController() override; 33 ~BrowserCommandController() override;
34 34
35 CommandUpdater* command_updater() { return &command_updater_; } 35 CommandUpdater* command_updater() { return &command_updater_; }
36 bool block_command_execution() const { return block_command_execution_; } 36 bool block_command_execution() const { return block_command_execution_; }
37 37
38 // Returns true if |command_id| is a reserved command whose keyboard shortcuts 38 // Returns true if |command_id| is a reserved command whose keyboard shortcuts
39 // should not be sent to the renderer or |event| was triggered by a key that 39 // should not be sent to the renderer or |event| was triggered by a key that
40 // we never want to send to the renderer. 40 // we never want to send to the renderer.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 bool foreground) override; 88 bool foreground) override;
89 void TabDetachedAt(content::WebContents* contents, int index) override; 89 void TabDetachedAt(content::WebContents* contents, int index) override;
90 void TabReplacedAt(TabStripModel* tab_strip_model, 90 void TabReplacedAt(TabStripModel* tab_strip_model,
91 content::WebContents* old_contents, 91 content::WebContents* old_contents,
92 content::WebContents* new_contents, 92 content::WebContents* new_contents,
93 int index) override; 93 int index) override;
94 void TabBlockedStateChanged(content::WebContents* contents, 94 void TabBlockedStateChanged(content::WebContents* contents,
95 int index) override; 95 int index) override;
96 96
97 // Overridden from TabRestoreServiceObserver: 97 // Overridden from TabRestoreServiceObserver:
98 void TabRestoreServiceChanged(TabRestoreService* service) override; 98 void TabRestoreServiceChanged(sessions::TabRestoreService* service) override;
99 void TabRestoreServiceDestroyed(TabRestoreService* service) override; 99 void TabRestoreServiceDestroyed(
100 void TabRestoreServiceLoaded(TabRestoreService* service) override; 100 sessions::TabRestoreService* service) override;
101 void TabRestoreServiceLoaded(sessions::TabRestoreService* service) override;
101 102
102 // Returns true if the regular Chrome UI (not the fullscreen one and 103 // Returns true if the regular Chrome UI (not the fullscreen one and
103 // not the single-tab one) is shown. Used for updating window command states 104 // not the single-tab one) is shown. Used for updating window command states
104 // only. Consider using SupportsWindowFeature if you need the mentioned 105 // only. Consider using SupportsWindowFeature if you need the mentioned
105 // functionality anywhere else. 106 // functionality anywhere else.
106 bool IsShowingMainUI(); 107 bool IsShowingMainUI();
107 108
108 // Initialize state for all browser commands. 109 // Initialize state for all browser commands.
109 void InitCommandState(); 110 void InitCommandState();
110 111
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 PrefChangeRegistrar profile_pref_registrar_; 187 PrefChangeRegistrar profile_pref_registrar_;
187 PrefChangeRegistrar local_pref_registrar_; 188 PrefChangeRegistrar local_pref_registrar_;
188 BooleanPrefMember pref_signin_allowed_; 189 BooleanPrefMember pref_signin_allowed_;
189 190
190 DISALLOW_COPY_AND_ASSIGN(BrowserCommandController); 191 DISALLOW_COPY_AND_ASSIGN(BrowserCommandController);
191 }; 192 };
192 193
193 } // namespace chrome 194 } // namespace chrome
194 195
195 #endif // CHROME_BROWSER_UI_BROWSER_COMMAND_CONTROLLER_H_ 196 #endif // CHROME_BROWSER_UI_BROWSER_COMMAND_CONTROLLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/browser_command_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698