| 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 "components/content_settings/core/common/content_settings.h" | 34 #include "components/content_settings/core/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_zoom.h" | 41 #include "content/public/common/page_zoom.h" |
| 42 #include "extensions/browser/extension_registry_observer.h" |
| 41 #include "ui/base/page_transition_types.h" | 43 #include "ui/base/page_transition_types.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; |
| (...skipping 19 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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 virtual void FileSelectedWithExtraInfo( | 709 virtual void FileSelectedWithExtraInfo( |
| 706 const ui::SelectedFileInfo& file_info, | 710 const ui::SelectedFileInfo& file_info, |
| 707 int index, | 711 int index, |
| 708 void* params) override; | 712 void* params) override; |
| 709 | 713 |
| 710 // Overridden from content::NotificationObserver: | 714 // Overridden from content::NotificationObserver: |
| 711 virtual void Observe(int type, | 715 virtual void Observe(int type, |
| 712 const content::NotificationSource& source, | 716 const content::NotificationSource& source, |
| 713 const content::NotificationDetails& details) override; | 717 const content::NotificationDetails& details) override; |
| 714 | 718 |
| 719 // Overridden from extensions::ExtensionRegistryObserver: |
| 720 virtual void OnExtensionUninstalled( |
| 721 content::BrowserContext* browser_context, |
| 722 const extensions::Extension* extension, |
| 723 extensions::UninstallReason reason) OVERRIDE; |
| 724 virtual void OnExtensionLoaded( |
| 725 content::BrowserContext* browser_context, |
| 726 const extensions::Extension* extension) OVERRIDE; |
| 727 virtual void OnExtensionUnloaded( |
| 728 content::BrowserContext* browser_context, |
| 729 const extensions::Extension* extension, |
| 730 extensions::UnloadedExtensionInfo::Reason reason) OVERRIDE; |
| 731 |
| 715 // Command and state updating /////////////////////////////////////////////// | 732 // Command and state updating /////////////////////////////////////////////// |
| 716 | 733 |
| 717 // Handle changes to kDevTools preference. | 734 // Handle changes to kDevTools preference. |
| 718 void OnDevToolsDisabledChanged(); | 735 void OnDevToolsDisabledChanged(); |
| 719 | 736 |
| 720 // UI update coalescing and handling //////////////////////////////////////// | 737 // UI update coalescing and handling //////////////////////////////////////// |
| 721 | 738 |
| 722 // Asks the toolbar (and as such the location bar) to update its state to | 739 // Asks the toolbar (and as such the location bar) to update its state to |
| 723 // reflect the current tab's current URL, security state, etc. | 740 // reflect the current tab's current URL, security state, etc. |
| 724 // If |should_restore_state| is true, we're switching (back?) to this tab and | 741 // If |should_restore_state| is true, we're switching (back?) to this tab and |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 818 const GURL& target_url, | 835 const GURL& target_url, |
| 819 const std::string& partition_id, | 836 const std::string& partition_id, |
| 820 content::SessionStorageNamespace* session_storage_namespace); | 837 content::SessionStorageNamespace* session_storage_namespace); |
| 821 | 838 |
| 822 // Data members ///////////////////////////////////////////////////////////// | 839 // Data members ///////////////////////////////////////////////////////////// |
| 823 | 840 |
| 824 std::vector<InterstitialObserver*> interstitial_observers_; | 841 std::vector<InterstitialObserver*> interstitial_observers_; |
| 825 | 842 |
| 826 content::NotificationRegistrar registrar_; | 843 content::NotificationRegistrar registrar_; |
| 827 | 844 |
| 845 ScopedObserver<extensions::ExtensionRegistry, |
| 846 extensions::ExtensionRegistryObserver> |
| 847 extension_registry_observer_; |
| 848 |
| 828 PrefChangeRegistrar profile_pref_registrar_; | 849 PrefChangeRegistrar profile_pref_registrar_; |
| 829 | 850 |
| 830 // This Browser's type. | 851 // This Browser's type. |
| 831 const Type type_; | 852 const Type type_; |
| 832 | 853 |
| 833 // This Browser's profile. | 854 // This Browser's profile. |
| 834 Profile* const profile_; | 855 Profile* const profile_; |
| 835 | 856 |
| 836 // This Browser's window. | 857 // This Browser's window. |
| 837 BrowserWindow* window_; | 858 BrowserWindow* window_; |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 958 | 979 |
| 959 scoped_ptr<chrome::ValidationMessageBubble> validation_message_bubble_; | 980 scoped_ptr<chrome::ValidationMessageBubble> validation_message_bubble_; |
| 960 | 981 |
| 961 // The following factory is used to close the frame at a later time. | 982 // The following factory is used to close the frame at a later time. |
| 962 base::WeakPtrFactory<Browser> weak_factory_; | 983 base::WeakPtrFactory<Browser> weak_factory_; |
| 963 | 984 |
| 964 DISALLOW_COPY_AND_ASSIGN(Browser); | 985 DISALLOW_COPY_AND_ASSIGN(Browser); |
| 965 }; | 986 }; |
| 966 | 987 |
| 967 #endif // CHROME_BROWSER_UI_BROWSER_H_ | 988 #endif // CHROME_BROWSER_UI_BROWSER_H_ |
| OLD | NEW |