Chromium Code Reviews| 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_H_ | 5 #ifndef CHROME_BROWSER_UI_BROWSER_H_ |
| 6 #define CHROME_BROWSER_UI_BROWSER_H_ | 6 #define CHROME_BROWSER_UI_BROWSER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
| 16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 18 #include "base/prefs/pref_change_registrar.h" | 18 #include "base/prefs/pref_change_registrar.h" |
| 19 #include "base/prefs/pref_member.h" | 19 #include "base/prefs/pref_member.h" |
| 20 #include "base/scoped_observer.h" | |
| 20 #include "base/strings/string16.h" | 21 #include "base/strings/string16.h" |
| 21 #include "chrome/browser/devtools/devtools_toggle_action.h" | 22 #include "chrome/browser/devtools/devtools_toggle_action.h" |
| 22 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" | 23 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" |
| 23 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper_delegate.h" | 24 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper_delegate.h" |
| 24 #include "chrome/browser/ui/browser_navigator.h" | 25 #include "chrome/browser/ui/browser_navigator.h" |
| 25 #include "chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.h" | 26 #include "chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.h" |
| 26 #include "chrome/browser/ui/host_desktop.h" | 27 #include "chrome/browser/ui/host_desktop.h" |
| 27 #include "chrome/browser/ui/search/search_tab_helper_delegate.h" | 28 #include "chrome/browser/ui/search/search_tab_helper_delegate.h" |
| 28 #include "chrome/browser/ui/search_engines/search_engine_tab_helper_delegate.h" | 29 #include "chrome/browser/ui/search_engines/search_engine_tab_helper_delegate.h" |
| 29 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" | 30 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" |
| 30 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" | 31 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
| 31 #include "chrome/browser/ui/toolbar/toolbar_model.h" | 32 #include "chrome/browser/ui/toolbar/toolbar_model.h" |
| 32 #include "chrome/browser/ui/zoom/zoom_observer.h" | 33 #include "chrome/browser/ui/zoom/zoom_observer.h" |
| 33 #include "chrome/common/content_settings.h" | 34 #include "chrome/common/content_settings.h" |
| 34 #include "components/content_settings/core/common/content_settings_types.h" | 35 #include "components/content_settings/core/common/content_settings_types.h" |
| 35 #include "components/sessions/session_id.h" | 36 #include "components/sessions/session_id.h" |
| 36 #include "content/public/browser/notification_observer.h" | 37 #include "content/public/browser/notification_observer.h" |
| 37 #include "content/public/browser/notification_registrar.h" | 38 #include "content/public/browser/notification_registrar.h" |
| 38 #include "content/public/browser/page_navigator.h" | 39 #include "content/public/browser/page_navigator.h" |
| 39 #include "content/public/browser/web_contents_delegate.h" | 40 #include "content/public/browser/web_contents_delegate.h" |
| 40 #include "content/public/common/page_transition_types.h" | 41 #include "content/public/common/page_transition_types.h" |
| 41 #include "content/public/common/page_zoom.h" | 42 #include "content/public/common/page_zoom.h" |
| 43 #include "extensions/browser/extension_registry_observer.h" | |
| 42 #include "ui/base/ui_base_types.h" | 44 #include "ui/base/ui_base_types.h" |
| 43 #include "ui/base/window_open_disposition.h" | 45 #include "ui/base/window_open_disposition.h" |
| 44 #include "ui/gfx/rect.h" | 46 #include "ui/gfx/rect.h" |
| 45 #include "ui/shell_dialogs/select_file_dialog.h" | 47 #include "ui/shell_dialogs/select_file_dialog.h" |
| 46 | 48 |
| 47 class BrowserContentSettingBubbleModelDelegate; | 49 class BrowserContentSettingBubbleModelDelegate; |
| 48 class BrowserContentTranslateDriverObserver; | 50 class BrowserContentTranslateDriverObserver; |
| 49 class BrowserInstantController; | 51 class BrowserInstantController; |
| 50 class BrowserSyncedWindowDelegate; | 52 class BrowserSyncedWindowDelegate; |
| 51 class BrowserToolbarModelDelegate; | 53 class BrowserToolbarModelDelegate; |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 70 } | 72 } |
| 71 | 73 |
| 72 namespace content { | 74 namespace content { |
| 73 class NavigationController; | 75 class NavigationController; |
| 74 class PageState; | 76 class PageState; |
| 75 class SessionStorageNamespace; | 77 class SessionStorageNamespace; |
| 76 } | 78 } |
| 77 | 79 |
| 78 namespace extensions { | 80 namespace extensions { |
| 79 class Extension; | 81 class Extension; |
| 82 class ExtensionRegistry; | |
| 80 class WindowController; | 83 class WindowController; |
| 81 } | 84 } |
| 82 | 85 |
| 83 namespace gfx { | 86 namespace gfx { |
| 84 class Image; | 87 class Image; |
| 85 class Point; | 88 class Point; |
| 86 } | 89 } |
| 87 | 90 |
| 88 namespace ui { | 91 namespace ui { |
| 89 struct SelectedFileInfo; | 92 struct SelectedFileInfo; |
| 90 class WebDialogDelegate; | 93 class WebDialogDelegate; |
| 91 } | 94 } |
| 92 | 95 |
| 93 namespace web_modal { | 96 namespace web_modal { |
| 94 class PopupManager; | 97 class PopupManager; |
| 95 class WebContentsModalDialogHost; | 98 class WebContentsModalDialogHost; |
| 96 } | 99 } |
| 97 | 100 |
| 98 class Browser : public TabStripModelObserver, | 101 class Browser : public TabStripModelObserver, |
| 99 public content::WebContentsDelegate, | 102 public content::WebContentsDelegate, |
| 100 public CoreTabHelperDelegate, | 103 public CoreTabHelperDelegate, |
| 101 public SearchEngineTabHelperDelegate, | 104 public SearchEngineTabHelperDelegate, |
| 102 public SearchTabHelperDelegate, | 105 public SearchTabHelperDelegate, |
| 103 public ChromeWebModalDialogManagerDelegate, | 106 public ChromeWebModalDialogManagerDelegate, |
| 104 public BookmarkTabHelperDelegate, | 107 public BookmarkTabHelperDelegate, |
| 105 public ZoomObserver, | 108 public ZoomObserver, |
| 106 public content::PageNavigator, | 109 public content::PageNavigator, |
| 107 public content::NotificationObserver, | 110 public content::NotificationObserver, |
| 111 public extensions::ExtensionRegistryObserver, | |
| 108 public ui::SelectFileDialog::Listener { | 112 public ui::SelectFileDialog::Listener { |
| 109 public: | 113 public: |
| 110 // SessionService::WindowType mirrors these values. If you add to this | 114 // SessionService::WindowType mirrors these values. If you add to this |
| 111 // enum, look at SessionService::WindowType to see if it needs to be | 115 // enum, look at SessionService::WindowType to see if it needs to be |
| 112 // updated. | 116 // updated. |
| 113 enum Type { | 117 enum Type { |
| 114 // If you add a new type, consider updating the test | 118 // If you add a new type, consider updating the test |
| 115 // BrowserTest.StartMaximized. | 119 // BrowserTest.StartMaximized. |
| 116 TYPE_TABBED = 1, | 120 TYPE_TABBED = 1, |
| 117 TYPE_POPUP = 2 | 121 TYPE_POPUP = 2 |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 696 | 700 |
| 697 // Overridden from SelectFileDialog::Listener: | 701 // Overridden from SelectFileDialog::Listener: |
| 698 virtual void FileSelected(const base::FilePath& path, | 702 virtual void FileSelected(const base::FilePath& path, |
| 699 int index, | 703 int index, |
| 700 void* params) OVERRIDE; | 704 void* params) OVERRIDE; |
| 701 virtual void FileSelectedWithExtraInfo( | 705 virtual void FileSelectedWithExtraInfo( |
| 702 const ui::SelectedFileInfo& file_info, | 706 const ui::SelectedFileInfo& file_info, |
| 703 int index, | 707 int index, |
| 704 void* params) OVERRIDE; | 708 void* params) OVERRIDE; |
| 705 | 709 |
| 710 // Called when an extension is uninstalled: | |
|
Bernhard Bauer
2014/09/10 12:32:04
These comments are unnecessary. Just add back the
| |
| 711 virtual void OnExtensionUninstalled( | |
| 712 content::BrowserContext* browser_context, | |
| 713 const extensions::Extension* extension, | |
| 714 extensions::UninstallReason reason) OVERRIDE; | |
| 715 | |
| 716 // Called when an extension is unloaded: | |
| 717 virtual void OnExtensionUnloaded( | |
| 718 content::BrowserContext* browser_context, | |
| 719 const extensions::Extension* extension, | |
| 720 extensions::UnloadedExtensionInfo::Reason reason) OVERRIDE; | |
| 721 | |
| 722 // Called when an extension is loaded | |
| 723 virtual void OnExtensionLoaded( | |
| 724 content::BrowserContext* browser_context, | |
| 725 const extensions::Extension* extension) OVERRIDE; | |
| 726 | |
| 706 // Overridden from content::NotificationObserver: | 727 // Overridden from content::NotificationObserver: |
| 707 virtual void Observe(int type, | 728 virtual void Observe(int type, |
| 708 const content::NotificationSource& source, | 729 const content::NotificationSource& source, |
| 709 const content::NotificationDetails& details) OVERRIDE; | 730 const content::NotificationDetails& details) OVERRIDE; |
| 710 | 731 |
| 711 // Command and state updating /////////////////////////////////////////////// | 732 // Command and state updating /////////////////////////////////////////////// |
| 712 | 733 |
| 713 // Handle changes to kDevTools preference. | 734 // Handle changes to kDevTools preference. |
| 714 void OnDevToolsDisabledChanged(); | 735 void OnDevToolsDisabledChanged(); |
| 715 | 736 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 814 const GURL& target_url, | 835 const GURL& target_url, |
| 815 const std::string& partition_id, | 836 const std::string& partition_id, |
| 816 content::SessionStorageNamespace* session_storage_namespace); | 837 content::SessionStorageNamespace* session_storage_namespace); |
| 817 | 838 |
| 818 // Data members ///////////////////////////////////////////////////////////// | 839 // Data members ///////////////////////////////////////////////////////////// |
| 819 | 840 |
| 820 std::vector<InterstitialObserver*> interstitial_observers_; | 841 std::vector<InterstitialObserver*> interstitial_observers_; |
| 821 | 842 |
| 822 content::NotificationRegistrar registrar_; | 843 content::NotificationRegistrar registrar_; |
| 823 | 844 |
| 845 ScopedObserver<extensions::ExtensionRegistry, | |
| 846 extensions::ExtensionRegistryObserver> | |
| 847 extension_registry_observer_; | |
| 848 | |
| 824 PrefChangeRegistrar profile_pref_registrar_; | 849 PrefChangeRegistrar profile_pref_registrar_; |
| 825 | 850 |
| 826 // This Browser's type. | 851 // This Browser's type. |
| 827 const Type type_; | 852 const Type type_; |
| 828 | 853 |
| 829 // This Browser's profile. | 854 // This Browser's profile. |
| 830 Profile* const profile_; | 855 Profile* const profile_; |
| 831 | 856 |
| 832 // This Browser's window. | 857 // This Browser's window. |
| 833 BrowserWindow* window_; | 858 BrowserWindow* window_; |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 954 base::WeakPtrFactory<Browser> weak_factory_; | 979 base::WeakPtrFactory<Browser> weak_factory_; |
| 955 | 980 |
| 956 scoped_ptr<BrowserContentTranslateDriverObserver> translate_driver_observer_; | 981 scoped_ptr<BrowserContentTranslateDriverObserver> translate_driver_observer_; |
| 957 | 982 |
| 958 scoped_ptr<chrome::ValidationMessageBubble> validation_message_bubble_; | 983 scoped_ptr<chrome::ValidationMessageBubble> validation_message_bubble_; |
| 959 | 984 |
| 960 DISALLOW_COPY_AND_ASSIGN(Browser); | 985 DISALLOW_COPY_AND_ASSIGN(Browser); |
| 961 }; | 986 }; |
| 962 | 987 |
| 963 #endif // CHROME_BROWSER_UI_BROWSER_H_ | 988 #endif // CHROME_BROWSER_UI_BROWSER_H_ |
| OLD | NEW |