OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_BROWSER_H_ | 5 #ifndef CHROME_BROWSER_BROWSER_H_ |
6 #define CHROME_BROWSER_BROWSER_H_ | 6 #define CHROME_BROWSER_BROWSER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
14 #include "base/scoped_ptr.h" | 14 #include "base/scoped_ptr.h" |
15 #include "chrome/browser/command_updater.h" | 15 #include "chrome/browser/command_updater.h" |
16 #include "chrome/browser/pref_member.h" | 16 #include "chrome/browser/pref_member.h" |
17 #include "chrome/browser/sessions/session_id.h" | 17 #include "chrome/browser/sessions/session_id.h" |
18 #include "chrome/browser/sessions/tab_restore_service.h" | 18 #include "chrome/browser/sessions/tab_restore_service.h" |
19 #include "chrome/browser/shell_dialogs.h" | 19 #include "chrome/browser/shell_dialogs.h" |
| 20 #include "chrome/browser/sync/profile_sync_service_observer.h" |
20 #include "chrome/browser/tabs/tab_strip_model.h" | 21 #include "chrome/browser/tabs/tab_strip_model.h" |
21 #include "chrome/browser/tab_contents/page_navigator.h" | 22 #include "chrome/browser/tab_contents/page_navigator.h" |
22 #include "chrome/browser/tab_contents/tab_contents_delegate.h" | 23 #include "chrome/browser/tab_contents/tab_contents_delegate.h" |
23 #include "chrome/browser/toolbar_model.h" | 24 #include "chrome/browser/toolbar_model.h" |
24 #include "chrome/common/extensions/extension.h" | 25 #include "chrome/common/extensions/extension.h" |
25 #include "chrome/common/notification_registrar.h" | 26 #include "chrome/common/notification_registrar.h" |
26 #include "chrome/common/page_transition_types.h" | 27 #include "chrome/common/page_transition_types.h" |
27 #include "chrome/common/page_zoom.h" | 28 #include "chrome/common/page_zoom.h" |
28 #include "gfx/rect.h" | 29 #include "gfx/rect.h" |
29 | 30 |
(...skipping 13 matching lines...) Expand all Loading... |
43 class Point; | 44 class Point; |
44 } | 45 } |
45 | 46 |
46 class Browser : public TabStripModelDelegate, | 47 class Browser : public TabStripModelDelegate, |
47 public TabStripModelObserver, | 48 public TabStripModelObserver, |
48 public TabContentsDelegate, | 49 public TabContentsDelegate, |
49 public PageNavigator, | 50 public PageNavigator, |
50 public CommandUpdater::CommandUpdaterDelegate, | 51 public CommandUpdater::CommandUpdaterDelegate, |
51 public NotificationObserver, | 52 public NotificationObserver, |
52 public SelectFileDialog::Listener, | 53 public SelectFileDialog::Listener, |
53 public TabRestoreService::Observer { | 54 public TabRestoreService::Observer, |
| 55 public ProfileSyncServiceObserver { |
54 public: | 56 public: |
55 // If you change the values in this enum you'll need to update browser_proxy. | 57 // If you change the values in this enum you'll need to update browser_proxy. |
56 // TODO(sky): move into a common place that is referenced by both ui_tests | 58 // TODO(sky): move into a common place that is referenced by both ui_tests |
57 // and chrome. | 59 // and chrome. |
58 enum Type { | 60 enum Type { |
59 TYPE_NORMAL = 1, | 61 TYPE_NORMAL = 1, |
60 TYPE_POPUP = 2, | 62 TYPE_POPUP = 2, |
61 // The old-style app created via "Create application shortcuts". | 63 // The old-style app created via "Create application shortcuts". |
62 TYPE_APP = 4, | 64 TYPE_APP = 4, |
63 // The new-style app created by installing a crx. This kinda needs to be | 65 // The new-style app created by installing a crx. This kinda needs to be |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 virtual Browser* GetBrowser() { return this; } | 731 virtual Browser* GetBrowser() { return this; } |
730 | 732 |
731 // Overridden from SelectFileDialog::Listener: | 733 // Overridden from SelectFileDialog::Listener: |
732 virtual void FileSelected(const FilePath& path, int index, void* params); | 734 virtual void FileSelected(const FilePath& path, int index, void* params); |
733 | 735 |
734 // Overridden from NotificationObserver: | 736 // Overridden from NotificationObserver: |
735 virtual void Observe(NotificationType type, | 737 virtual void Observe(NotificationType type, |
736 const NotificationSource& source, | 738 const NotificationSource& source, |
737 const NotificationDetails& details); | 739 const NotificationDetails& details); |
738 | 740 |
| 741 // Overridden from ProfileSyncServiceObserver: |
| 742 virtual void OnStateChanged(); |
| 743 |
739 // Command and state updating /////////////////////////////////////////////// | 744 // Command and state updating /////////////////////////////////////////////// |
740 | 745 |
741 // Initialize state for all browser commands. | 746 // Initialize state for all browser commands. |
742 void InitCommandState(); | 747 void InitCommandState(); |
743 | 748 |
744 // Update commands whose state depends on the tab's state. | 749 // Update commands whose state depends on the tab's state. |
745 void UpdateCommandsForTabState(); | 750 void UpdateCommandsForTabState(); |
746 | 751 |
747 // Ask the Reload/Stop button to change its icon, and update the Stop command | 752 // Ask the Reload/Stop button to change its icon, and update the Stop command |
748 // state. |is_loading| is true if the current TabContents is loading. | 753 // state. |is_loading| is true if the current TabContents is loading. |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1044 mutable BooleanPrefMember use_vertical_tabs_; | 1049 mutable BooleanPrefMember use_vertical_tabs_; |
1045 | 1050 |
1046 // The profile's tab restore service. The service is owned by the profile, | 1051 // The profile's tab restore service. The service is owned by the profile, |
1047 // and we install ourselves as an observer. | 1052 // and we install ourselves as an observer. |
1048 TabRestoreService* tab_restore_service_; | 1053 TabRestoreService* tab_restore_service_; |
1049 | 1054 |
1050 DISALLOW_COPY_AND_ASSIGN(Browser); | 1055 DISALLOW_COPY_AND_ASSIGN(Browser); |
1051 }; | 1056 }; |
1052 | 1057 |
1053 #endif // CHROME_BROWSER_BROWSER_H_ | 1058 #endif // CHROME_BROWSER_BROWSER_H_ |
OLD | NEW |