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