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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 class Profile; | 65 class Profile; |
66 class SessionStorageNamespace; | 66 class SessionStorageNamespace; |
67 class SkBitmap; | 67 class SkBitmap; |
68 class StatusBubble; | 68 class StatusBubble; |
69 class TabNavigation; | 69 class TabNavigation; |
70 class TabStripModel; | 70 class TabStripModel; |
71 struct WebApplicationInfo; | 71 struct WebApplicationInfo; |
72 | 72 |
73 namespace content { | 73 namespace content { |
74 class NavigationController; | 74 class NavigationController; |
75 class SiteInstance; | |
jam
2012/01/24 03:29:33
nit: not needed since one of the methods that use
| |
75 } | 76 } |
76 | 77 |
77 namespace gfx { | 78 namespace gfx { |
78 class Point; | 79 class Point; |
79 } | 80 } |
80 | 81 |
81 class Browser : public TabHandlerDelegate, | 82 class Browser : public TabHandlerDelegate, |
82 public content::WebContentsDelegate, | 83 public content::WebContentsDelegate, |
83 public CoreTabHelperDelegate, | 84 public CoreTabHelperDelegate, |
84 public SearchEngineTabHelperDelegate, | 85 public SearchEngineTabHelperDelegate, |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
767 virtual void ExecuteCommand(int id) OVERRIDE; | 768 virtual void ExecuteCommand(int id) OVERRIDE; |
768 | 769 |
769 // Overridden from TabRestoreServiceObserver: | 770 // Overridden from TabRestoreServiceObserver: |
770 virtual void TabRestoreServiceChanged(TabRestoreService* service) OVERRIDE; | 771 virtual void TabRestoreServiceChanged(TabRestoreService* service) OVERRIDE; |
771 virtual void TabRestoreServiceDestroyed(TabRestoreService* service) OVERRIDE; | 772 virtual void TabRestoreServiceDestroyed(TabRestoreService* service) OVERRIDE; |
772 | 773 |
773 // Centralized method for creating a TabContents, configuring and installing | 774 // Centralized method for creating a TabContents, configuring and installing |
774 // all its supporting objects and observers. | 775 // all its supporting objects and observers. |
775 static TabContentsWrapper* | 776 static TabContentsWrapper* |
776 TabContentsFactory(Profile* profile, | 777 TabContentsFactory(Profile* profile, |
777 SiteInstance* site_instance, | 778 content::SiteInstance* site_instance, |
778 int routing_id, | 779 int routing_id, |
779 const content::WebContents* base_web_contents, | 780 const content::WebContents* base_web_contents, |
780 SessionStorageNamespace* session_storage_namespace); | 781 SessionStorageNamespace* session_storage_namespace); |
781 | 782 |
782 // Overridden from TabHandlerDelegate: | 783 // Overridden from TabHandlerDelegate: |
783 virtual Profile* GetProfile() const OVERRIDE; | 784 virtual Profile* GetProfile() const OVERRIDE; |
784 virtual Browser* AsBrowser() OVERRIDE; | 785 virtual Browser* AsBrowser() OVERRIDE; |
785 | 786 |
786 // Overridden from TabStripModelDelegate: | 787 // Overridden from TabStripModelDelegate: |
787 virtual TabContentsWrapper* AddBlankTab(bool foreground); | 788 virtual TabContentsWrapper* AddBlankTab(bool foreground); |
788 virtual TabContentsWrapper* AddBlankTabAt(int index, bool foreground); | 789 virtual TabContentsWrapper* AddBlankTabAt(int index, bool foreground); |
789 virtual Browser* CreateNewStripWithContents( | 790 virtual Browser* CreateNewStripWithContents( |
790 TabContentsWrapper* detached_contents, | 791 TabContentsWrapper* detached_contents, |
791 const gfx::Rect& window_bounds, | 792 const gfx::Rect& window_bounds, |
792 const DockInfo& dock_info, | 793 const DockInfo& dock_info, |
793 bool maximize); | 794 bool maximize); |
794 virtual int GetDragActions() const; | 795 virtual int GetDragActions() const; |
795 // Construct a TabContents for a given URL, profile and transition type. | 796 // Construct a TabContents for a given URL, profile and transition type. |
796 // If instance is not null, its process will be used to render the tab. | 797 // If instance is not null, its process will be used to render the tab. |
797 virtual TabContentsWrapper* CreateTabContentsForURL( | 798 virtual TabContentsWrapper* CreateTabContentsForURL( |
798 const GURL& url, | 799 const GURL& url, |
799 const content::Referrer& referrer, | 800 const content::Referrer& referrer, |
800 Profile* profile, | 801 Profile* profile, |
801 content::PageTransition transition, | 802 content::PageTransition transition, |
802 bool defer_load, | 803 bool defer_load, |
803 SiteInstance* instance) const; | 804 content::SiteInstance* instance) const; |
804 virtual bool CanDuplicateContentsAt(int index); | 805 virtual bool CanDuplicateContentsAt(int index); |
805 virtual void DuplicateContentsAt(int index); | 806 virtual void DuplicateContentsAt(int index); |
806 virtual void CloseFrameAfterDragSession(); | 807 virtual void CloseFrameAfterDragSession(); |
807 virtual void CreateHistoricalTab(TabContentsWrapper* contents); | 808 virtual void CreateHistoricalTab(TabContentsWrapper* contents); |
808 virtual bool RunUnloadListenerBeforeClosing(TabContentsWrapper* contents); | 809 virtual bool RunUnloadListenerBeforeClosing(TabContentsWrapper* contents); |
809 virtual bool CanCloseContents(std::vector<int>* indices); | 810 virtual bool CanCloseContents(std::vector<int>* indices); |
810 virtual bool CanBookmarkAllTabs() const; | 811 virtual bool CanBookmarkAllTabs() const; |
811 virtual void BookmarkAllTabs(); | 812 virtual void BookmarkAllTabs(); |
812 virtual bool CanCloseTab() const; | 813 virtual bool CanCloseTab() const; |
813 virtual bool CanRestoreTab(); | 814 virtual bool CanRestoreTab(); |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1286 // Resets |bookmark_bar_state_| based on the active tab. Notifies the | 1287 // Resets |bookmark_bar_state_| based on the active tab. Notifies the |
1287 // BrowserWindow if necessary. | 1288 // BrowserWindow if necessary. |
1288 void UpdateBookmarkBarState(BookmarkBarStateChangeReason reason); | 1289 void UpdateBookmarkBarState(BookmarkBarStateChangeReason reason); |
1289 | 1290 |
1290 // Open the bookmark manager with a defined hash action. | 1291 // Open the bookmark manager with a defined hash action. |
1291 void OpenBookmarkManagerWithHash(const std::string& action, int64 node_id); | 1292 void OpenBookmarkManagerWithHash(const std::string& action, int64 node_id); |
1292 | 1293 |
1293 // Creates a BackgroundContents if appropriate; return true if one was | 1294 // Creates a BackgroundContents if appropriate; return true if one was |
1294 // created. | 1295 // created. |
1295 bool MaybeCreateBackgroundContents(int route_id, | 1296 bool MaybeCreateBackgroundContents(int route_id, |
1296 SiteInstance* site, | 1297 content::SiteInstance* site, |
1297 const GURL& opener_url, | 1298 const GURL& opener_url, |
1298 const string16& frame_name); | 1299 const string16& frame_name); |
1299 | 1300 |
1300 // Data members ///////////////////////////////////////////////////////////// | 1301 // Data members ///////////////////////////////////////////////////////////// |
1301 | 1302 |
1302 content::NotificationRegistrar registrar_; | 1303 content::NotificationRegistrar registrar_; |
1303 | 1304 |
1304 PrefChangeRegistrar profile_pref_registrar_; | 1305 PrefChangeRegistrar profile_pref_registrar_; |
1305 | 1306 |
1306 PrefChangeRegistrar local_pref_registrar_; | 1307 PrefChangeRegistrar local_pref_registrar_; |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1439 | 1440 |
1440 scoped_refptr<FullscreenController> fullscreen_controller_; | 1441 scoped_refptr<FullscreenController> fullscreen_controller_; |
1441 | 1442 |
1442 // True if the browser window has been shown at least once. | 1443 // True if the browser window has been shown at least once. |
1443 bool window_has_shown_; | 1444 bool window_has_shown_; |
1444 | 1445 |
1445 DISALLOW_COPY_AND_ASSIGN(Browser); | 1446 DISALLOW_COPY_AND_ASSIGN(Browser); |
1446 }; | 1447 }; |
1447 | 1448 |
1448 #endif // CHROME_BROWSER_UI_BROWSER_H_ | 1449 #endif // CHROME_BROWSER_UI_BROWSER_H_ |
OLD | NEW |