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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
16 #include "base/scoped_ptr.h" | 16 #include "base/scoped_ptr.h" |
| 17 #include "base/task.h" |
17 #include "chrome/browser/command_updater.h" | 18 #include "chrome/browser/command_updater.h" |
18 #include "chrome/browser/debugger/devtools_toggle_action.h" | 19 #include "chrome/browser/debugger/devtools_toggle_action.h" |
19 #include "chrome/browser/prefs/pref_member.h" | 20 #include "chrome/browser/prefs/pref_member.h" |
20 #include "chrome/browser/sessions/session_id.h" | 21 #include "chrome/browser/sessions/session_id.h" |
21 #include "chrome/browser/sessions/tab_restore_service.h" | 22 #include "chrome/browser/sessions/tab_restore_service_observer.h" |
22 #include "chrome/browser/shell_dialogs.h" | 23 #include "chrome/browser/shell_dialogs.h" |
23 #include "chrome/browser/sync/profile_sync_service_observer.h" | 24 #include "chrome/browser/sync/profile_sync_service_observer.h" |
24 #include "chrome/browser/tabs/tab_strip_model.h" | 25 #include "chrome/browser/tabs/tab_strip_model.h" |
25 #include "chrome/browser/tab_contents/page_navigator.h" | 26 #include "chrome/browser/tab_contents/page_navigator.h" |
26 #include "chrome/browser/tab_contents/tab_contents_delegate.h" | 27 #include "chrome/browser/tab_contents/tab_contents_delegate.h" |
27 #include "chrome/browser/toolbar_model.h" | 28 #include "chrome/browser/toolbar_model.h" |
28 #include "chrome/common/extensions/extension.h" | 29 #include "chrome/common/extensions/extension.h" |
29 #include "chrome/common/notification_registrar.h" | 30 #include "chrome/common/notification_registrar.h" |
30 #include "chrome/common/page_transition_types.h" | 31 #include "chrome/common/page_transition_types.h" |
31 #include "chrome/common/page_zoom.h" | 32 #include "chrome/common/page_zoom.h" |
(...skipping 11 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 TabRestoreServiceObserver, |
54 public ProfileSyncServiceObserver { | 55 public ProfileSyncServiceObserver { |
55 public: | 56 public: |
56 // 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. |
57 // 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 |
58 // and chrome. | 59 // and chrome. |
59 enum Type { | 60 enum Type { |
60 TYPE_NORMAL = 1, | 61 TYPE_NORMAL = 1, |
61 TYPE_POPUP = 2, | 62 TYPE_POPUP = 2, |
62 // The old-style app created via "Create application shortcuts". | 63 // The old-style app created via "Create application shortcuts". |
63 TYPE_APP = 4, | 64 TYPE_APP = 4, |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 virtual void OpenURL(const GURL& url, const GURL& referrer, | 613 virtual void OpenURL(const GURL& url, const GURL& referrer, |
613 WindowOpenDisposition disposition, | 614 WindowOpenDisposition disposition, |
614 PageTransition::Type transition); | 615 PageTransition::Type transition); |
615 | 616 |
616 // Overridden from CommandUpdater::CommandUpdaterDelegate: | 617 // Overridden from CommandUpdater::CommandUpdaterDelegate: |
617 virtual void ExecuteCommand(int id); | 618 virtual void ExecuteCommand(int id); |
618 | 619 |
619 // Helper function to run unload listeners on a TabContents. | 620 // Helper function to run unload listeners on a TabContents. |
620 static bool RunUnloadEventsHelper(TabContents* contents); | 621 static bool RunUnloadEventsHelper(TabContents* contents); |
621 | 622 |
622 // TabRestoreService::Observer /////////////////////////////////////////////// | 623 // TabRestoreServiceObserver ///////////////////////////////////////////////// |
623 virtual void TabRestoreServiceChanged(TabRestoreService* service); | 624 virtual void TabRestoreServiceChanged(TabRestoreService* service); |
624 virtual void TabRestoreServiceDestroyed(TabRestoreService* service); | 625 virtual void TabRestoreServiceDestroyed(TabRestoreService* service); |
625 | 626 |
626 private: | 627 private: |
627 FRIEND_TEST_ALL_PREFIXES(BrowserTest, NoTabsInPopups); | 628 FRIEND_TEST_ALL_PREFIXES(BrowserTest, NoTabsInPopups); |
628 | 629 |
629 // Used to describe why a tab is being detached. This is used by | 630 // Used to describe why a tab is being detached. This is used by |
630 // TabDetachedAtImpl. | 631 // TabDetachedAtImpl. |
631 enum DetachType { | 632 enum DetachType { |
632 // Result of TabDetachedAt. | 633 // Result of TabDetachedAt. |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1074 mutable BooleanPrefMember use_vertical_tabs_; | 1075 mutable BooleanPrefMember use_vertical_tabs_; |
1075 | 1076 |
1076 // The profile's tab restore service. The service is owned by the profile, | 1077 // The profile's tab restore service. The service is owned by the profile, |
1077 // and we install ourselves as an observer. | 1078 // and we install ourselves as an observer. |
1078 TabRestoreService* tab_restore_service_; | 1079 TabRestoreService* tab_restore_service_; |
1079 | 1080 |
1080 DISALLOW_COPY_AND_ASSIGN(Browser); | 1081 DISALLOW_COPY_AND_ASSIGN(Browser); |
1081 }; | 1082 }; |
1082 | 1083 |
1083 #endif // CHROME_BROWSER_BROWSER_H_ | 1084 #endif // CHROME_BROWSER_BROWSER_H_ |
OLD | NEW |