| 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 16 matching lines...) Expand all Loading... |
| 27 #include "chrome/browser/sessions/session_id.h" | 27 #include "chrome/browser/sessions/session_id.h" |
| 28 #include "chrome/browser/sessions/tab_restore_service_observer.h" | 28 #include "chrome/browser/sessions/tab_restore_service_observer.h" |
| 29 #include "chrome/browser/sync/profile_sync_service_observer.h" | 29 #include "chrome/browser/sync/profile_sync_service_observer.h" |
| 30 #include "chrome/browser/tabs/tab_handler.h" | 30 #include "chrome/browser/tabs/tab_handler.h" |
| 31 #include "chrome/browser/tabs/tab_strip_model_delegate.h" // TODO(beng): remove | 31 #include "chrome/browser/tabs/tab_strip_model_delegate.h" // TODO(beng): remove |
| 32 #include "chrome/browser/tabs/tab_strip_model_observer.h" // TODO(beng): remove | 32 #include "chrome/browser/tabs/tab_strip_model_observer.h" // TODO(beng): remove |
| 33 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper_delegate.
h" | 33 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper_delegate.
h" |
| 34 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" | 34 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" |
| 35 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper_delegate.h" | 35 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper_delegate.h" |
| 36 #include "chrome/browser/ui/browser_navigator.h" | 36 #include "chrome/browser/ui/browser_navigator.h" |
| 37 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" |
| 37 #include "chrome/browser/ui/constrained_window_tab_helper_delegate.h" | 38 #include "chrome/browser/ui/constrained_window_tab_helper_delegate.h" |
| 38 #include "chrome/browser/ui/dialog_style.h" | 39 #include "chrome/browser/ui/dialog_style.h" |
| 39 #include "chrome/browser/ui/fullscreen_exit_bubble_type.h" | 40 #include "chrome/browser/ui/fullscreen_exit_bubble_type.h" |
| 40 #include "chrome/browser/ui/search_engines/search_engine_tab_helper_delegate.h" | 41 #include "chrome/browser/ui/search_engines/search_engine_tab_helper_delegate.h" |
| 41 #include "chrome/browser/ui/select_file_dialog.h" | 42 #include "chrome/browser/ui/select_file_dialog.h" |
| 42 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" | 43 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" |
| 44 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper_container.h" |
| 43 #include "chrome/browser/ui/toolbar/toolbar_model.h" | 45 #include "chrome/browser/ui/toolbar/toolbar_model.h" |
| 44 #include "chrome/common/content_settings.h" | 46 #include "chrome/common/content_settings.h" |
| 45 #include "chrome/common/content_settings_types.h" | 47 #include "chrome/common/content_settings_types.h" |
| 46 #include "chrome/common/extensions/extension_constants.h" | 48 #include "chrome/common/extensions/extension_constants.h" |
| 47 #include "content/public/browser/notification_registrar.h" | 49 #include "content/public/browser/notification_registrar.h" |
| 48 #include "content/public/browser/page_navigator.h" | 50 #include "content/public/browser/page_navigator.h" |
| 49 #include "content/public/browser/web_contents_delegate.h" | 51 #include "content/public/browser/web_contents_delegate.h" |
| 50 #include "content/public/common/page_transition_types.h" | 52 #include "content/public/common/page_transition_types.h" |
| 51 #include "content/public/common/page_zoom.h" | 53 #include "content/public/common/page_zoom.h" |
| 52 #include "ui/base/ui_base_types.h" | 54 #include "ui/base/ui_base_types.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 public CoreTabHelperDelegate, | 86 public CoreTabHelperDelegate, |
| 85 public SearchEngineTabHelperDelegate, | 87 public SearchEngineTabHelperDelegate, |
| 86 public ConstrainedWindowTabHelperDelegate, | 88 public ConstrainedWindowTabHelperDelegate, |
| 87 public BlockedContentTabHelperDelegate, | 89 public BlockedContentTabHelperDelegate, |
| 88 public BookmarkTabHelperDelegate, | 90 public BookmarkTabHelperDelegate, |
| 89 public ExtensionTabHelperDelegate, | 91 public ExtensionTabHelperDelegate, |
| 90 public content::PageNavigator, | 92 public content::PageNavigator, |
| 91 public CommandUpdater::CommandUpdaterDelegate, | 93 public CommandUpdater::CommandUpdaterDelegate, |
| 92 public content::NotificationObserver, | 94 public content::NotificationObserver, |
| 93 public SelectFileDialog::Listener, | 95 public SelectFileDialog::Listener, |
| 96 public TabContentsWrapperContainer, |
| 97 public ContentSettingBubbleModelDelegate, |
| 94 public TabRestoreServiceObserver, | 98 public TabRestoreServiceObserver, |
| 95 public ProfileSyncServiceObserver, | 99 public ProfileSyncServiceObserver, |
| 96 public InstantDelegate { | 100 public InstantDelegate { |
| 97 public: | 101 public: |
| 98 // SessionService::WindowType mirrors these values. If you add to this | 102 // SessionService::WindowType mirrors these values. If you add to this |
| 99 // enum, look at SessionService::WindowType to see if it needs to be | 103 // enum, look at SessionService::WindowType to see if it needs to be |
| 100 // updated. | 104 // updated. |
| 101 enum Type { | 105 enum Type { |
| 102 // If you add a new type, consider updating the test | 106 // If you add a new type, consider updating the test |
| 103 // BrowserTest.StartMaximized. | 107 // BrowserTest.StartMaximized. |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 DownloadClosePreventionType OkToCloseWithInProgressDownloads( | 400 DownloadClosePreventionType OkToCloseWithInProgressDownloads( |
| 397 int* num_downloads_blocking) const; | 401 int* num_downloads_blocking) const; |
| 398 | 402 |
| 399 // TabStripModel pass-thrus ///////////////////////////////////////////////// | 403 // TabStripModel pass-thrus ///////////////////////////////////////////////// |
| 400 | 404 |
| 401 TabStripModel* tabstrip_model() const { | 405 TabStripModel* tabstrip_model() const { |
| 402 // TODO(beng): remove this accessor. It violates google style. | 406 // TODO(beng): remove this accessor. It violates google style. |
| 403 return tab_handler_->GetTabStripModel(); | 407 return tab_handler_->GetTabStripModel(); |
| 404 } | 408 } |
| 405 | 409 |
| 406 int tab_count() const; | |
| 407 int active_index() const; | |
| 408 int GetIndexOfController( | |
| 409 const content::NavigationController* controller) const; | |
| 410 | |
| 411 // TODO(dpapad): Rename to GetActiveTabContentsWrapper(). | |
| 412 TabContentsWrapper* GetSelectedTabContentsWrapper() const; | |
| 413 // A convenient version of the above which returns the TCW's WebContents. | |
| 414 content::WebContents* GetSelectedWebContents() const; | |
| 415 TabContentsWrapper* GetTabContentsWrapperAt(int index) const; | |
| 416 // A convenient version of the above which returns the TCW's WebContents. | |
| 417 content::WebContents* GetWebContentsAt(int index) const; | |
| 418 void ActivateTabAt(int index, bool user_gesture); | 410 void ActivateTabAt(int index, bool user_gesture); |
| 419 bool IsTabPinned(int index) const; | 411 bool IsTabPinned(int index) const; |
| 420 bool IsTabDiscarded(int index) const; | 412 bool IsTabDiscarded(int index) const; |
| 421 void CloseAllTabs(); | 413 void CloseAllTabs(); |
| 422 | 414 |
| 423 // Tab adding/showing functions ///////////////////////////////////////////// | 415 // Tab adding/showing functions ///////////////////////////////////////////// |
| 424 | 416 |
| 425 // Returns true if the tab strip is editable (for extensions). | 417 // Returns true if the tab strip is editable (for extensions). |
| 426 bool IsTabStripEditable() const; | 418 bool IsTabStripEditable() const; |
| 427 | 419 |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 void OpenBookmarkManagerEditNode(int64 node_id); | 625 void OpenBookmarkManagerEditNode(int64 node_id); |
| 634 void OpenBookmarkManagerAddNodeIn(int64 node_id); | 626 void OpenBookmarkManagerAddNodeIn(int64 node_id); |
| 635 void ShowAppMenu(); | 627 void ShowAppMenu(); |
| 636 void ShowAvatarMenu(); | 628 void ShowAvatarMenu(); |
| 637 void ShowHistoryTab(); | 629 void ShowHistoryTab(); |
| 638 void ShowDownloadsTab(); | 630 void ShowDownloadsTab(); |
| 639 void ShowExtensionsTab(); | 631 void ShowExtensionsTab(); |
| 640 void ShowAboutConflictsTab(); | 632 void ShowAboutConflictsTab(); |
| 641 void ShowBrokenPageTab(content::WebContents* contents); | 633 void ShowBrokenPageTab(content::WebContents* contents); |
| 642 void ShowOptionsTab(const std::string& sub_page); | 634 void ShowOptionsTab(const std::string& sub_page); |
| 643 // Shows the Content Settings page for a given content type. | |
| 644 void ShowContentSettingsPage(ContentSettingsType content_type); | |
| 645 void OpenClearBrowsingDataDialog(); | 635 void OpenClearBrowsingDataDialog(); |
| 646 void OpenOptionsDialog(); | 636 void OpenOptionsDialog(); |
| 647 void OpenPasswordManager(); | 637 void OpenPasswordManager(); |
| 648 void OpenSyncMyBookmarksDialog(); | 638 void OpenSyncMyBookmarksDialog(); |
| 649 void OpenImportSettingsDialog(); | 639 void OpenImportSettingsDialog(); |
| 650 void OpenInstantConfirmDialog(); | 640 void OpenInstantConfirmDialog(); |
| 651 void OpenAboutChromeDialog(); | 641 void OpenAboutChromeDialog(); |
| 652 void OpenUpdateChromeDialog(); | 642 void OpenUpdateChromeDialog(); |
| 653 void ShowHelpTab(); | 643 void ShowHelpTab(); |
| 654 void OpenAutofillHelpTabAndActivate(); | 644 void OpenAutofillHelpTabAndActivate(); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 // disposition type of the command will be stored in |*disposition| if it's | 765 // disposition type of the command will be stored in |*disposition| if it's |
| 776 // not null. | 766 // not null. |
| 777 int GetLastBlockedCommand(WindowOpenDisposition* disposition); | 767 int GetLastBlockedCommand(WindowOpenDisposition* disposition); |
| 778 | 768 |
| 779 // Called by browser::Navigate() when a navigation has occurred in a tab in | 769 // Called by browser::Navigate() when a navigation has occurred in a tab in |
| 780 // this Browser. Updates the UI for the start of this navigation. | 770 // this Browser. Updates the UI for the start of this navigation. |
| 781 void UpdateUIForNavigationInTab(TabContentsWrapper* contents, | 771 void UpdateUIForNavigationInTab(TabContentsWrapper* contents, |
| 782 content::PageTransition transition, | 772 content::PageTransition transition, |
| 783 bool user_initiated); | 773 bool user_initiated); |
| 784 | 774 |
| 785 // Shows the cookies collected in the tab contents wrapper. | 775 // Interface implementations //////////////////////////////////////////////// |
| 786 void ShowCollectedCookiesDialog(TabContentsWrapper* wrapper); | |
| 787 | 776 |
| 788 // Interface implementations //////////////////////////////////////////////// | 777 // Overridden from ContentSettingBubbleModelDelegate: |
| 778 virtual void ShowCollectedCookiesDialog(TabContentsWrapper* wrapper) OVERRIDE; |
| 779 virtual void ShowContentSettingsPage( |
| 780 ContentSettingsType content_type) OVERRIDE; |
| 781 |
| 782 // Overriddent from TabContentsWrapperContainer: |
| 783 virtual int tab_count() const OVERRIDE; |
| 784 virtual int active_index() const OVERRIDE; |
| 785 virtual int GetIndexOfController( |
| 786 const content::NavigationController* controller) const OVERRIDE; |
| 787 virtual TabContentsWrapper* GetSelectedTabContentsWrapper() const OVERRIDE; |
| 788 virtual content::WebContents* GetSelectedWebContents() const OVERRIDE; |
| 789 virtual TabContentsWrapper* GetTabContentsWrapperAt(int index) const OVERRIDE; |
| 790 virtual content::WebContents* GetWebContentsAt(int index) const OVERRIDE; |
| 789 | 791 |
| 790 // Overridden from content::PageNavigator: | 792 // Overridden from content::PageNavigator: |
| 791 virtual content::WebContents* OpenURL( | 793 virtual content::WebContents* OpenURL( |
| 792 const content::OpenURLParams& params) OVERRIDE; | 794 const content::OpenURLParams& params) OVERRIDE; |
| 793 | 795 |
| 794 // Overridden from CommandUpdater::CommandUpdaterDelegate: | 796 // Overridden from CommandUpdater::CommandUpdaterDelegate: |
| 795 virtual void ExecuteCommand(int id) OVERRIDE; | 797 virtual void ExecuteCommand(int id) OVERRIDE; |
| 796 | 798 |
| 797 // Overridden from TabRestoreServiceObserver: | 799 // Overridden from TabRestoreServiceObserver: |
| 798 virtual void TabRestoreServiceChanged(TabRestoreService* service) OVERRIDE; | 800 virtual void TabRestoreServiceChanged(TabRestoreService* service) OVERRIDE; |
| (...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1468 | 1470 |
| 1469 scoped_ptr<ExtensionWindowController> extension_window_controller_; | 1471 scoped_ptr<ExtensionWindowController> extension_window_controller_; |
| 1470 | 1472 |
| 1471 // True if the browser window has been shown at least once. | 1473 // True if the browser window has been shown at least once. |
| 1472 bool window_has_shown_; | 1474 bool window_has_shown_; |
| 1473 | 1475 |
| 1474 DISALLOW_COPY_AND_ASSIGN(Browser); | 1476 DISALLOW_COPY_AND_ASSIGN(Browser); |
| 1475 }; | 1477 }; |
| 1476 | 1478 |
| 1477 #endif // CHROME_BROWSER_UI_BROWSER_H_ | 1479 #endif // CHROME_BROWSER_UI_BROWSER_H_ |
| OLD | NEW |