| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_BROWSER_H_ | 5 #ifndef CHROME_BROWSER_BROWSER_H_ |
| 6 #define CHROME_BROWSER_BROWSER_H_ | 6 #define CHROME_BROWSER_BROWSER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 // or NULL. | 220 // or NULL. |
| 221 static TabContents* OpenApplication(Profile* profile, | 221 static TabContents* OpenApplication(Profile* profile, |
| 222 Extension* extension, | 222 Extension* extension, |
| 223 Extension::LaunchContainer container); | 223 Extension::LaunchContainer container); |
| 224 | 224 |
| 225 // Opens a new application window for the specified url. If |as_panel| | 225 // Opens a new application window for the specified url. If |as_panel| |
| 226 // is true, the application will be opened as a Browser::Type::APP_PANEL in | 226 // is true, the application will be opened as a Browser::Type::APP_PANEL in |
| 227 // app panel window, otherwise it will be opened as as either | 227 // app panel window, otherwise it will be opened as as either |
| 228 // Browser::Type::APP a.k.a. "thin frame" (if |extension| is NULL) or | 228 // Browser::Type::APP a.k.a. "thin frame" (if |extension| is NULL) or |
| 229 // Browser::Type::EXTENSION_APP (if |extension| is non-NULL). | 229 // Browser::Type::EXTENSION_APP (if |extension| is non-NULL). |
| 230 // Returns the browser hosting for the TabContents via optional parameter, |
| 231 // |browser|. |
| 230 static TabContents* OpenApplicationWindow( | 232 static TabContents* OpenApplicationWindow( |
| 231 Profile* profile, | 233 Profile* profile, |
| 232 Extension* extension, | 234 Extension* extension, |
| 233 Extension::LaunchContainer container, | 235 Extension::LaunchContainer container, |
| 234 const GURL& url); | 236 const GURL& url, |
| 237 Browser** browser); |
| 235 | 238 |
| 236 // Open an application for |extension| in a new application window or panel. | 239 // Open an application for |extension| in a new application window or panel. |
| 240 // Returns the browser hosting the TabContents via optional parameter, |
| 241 // |browser|. |
| 237 static TabContents* OpenApplicationWindow(Profile* profile, | 242 static TabContents* OpenApplicationWindow(Profile* profile, |
| 238 GURL& url); | 243 GURL& url, |
| 244 Browser** browser); |
| 239 | 245 |
| 240 // Open an application for |extension| in a new application tab. Returns | 246 // Open an application for |extension| in a new application tab. Returns |
| 241 // NULL if there are no appropriate existing browser windows for |profile|. | 247 // NULL if there are no appropriate existing browser windows for |profile|. |
| 248 // Returns the browser hosting the TabContents via optional parameter, |
| 249 // |browser|. |
| 242 static TabContents* OpenApplicationTab(Profile* profile, | 250 static TabContents* OpenApplicationTab(Profile* profile, |
| 243 Extension* extension); | 251 Extension* extension, |
| 252 Browser** browser); |
| 244 | 253 |
| 245 // Opens a new window and opens the bookmark manager. | 254 // Opens a new window and opens the bookmark manager. |
| 246 static void OpenBookmarkManagerWindow(Profile* profile); | 255 static void OpenBookmarkManagerWindow(Profile* profile); |
| 247 | 256 |
| 248 #if defined(OS_MACOSX) | 257 #if defined(OS_MACOSX) |
| 249 // Open a new window with history/downloads/help/options (needed on Mac when | 258 // Open a new window with history/downloads/help/options (needed on Mac when |
| 250 // there are no windows). | 259 // there are no windows). |
| 251 static void OpenHistoryWindow(Profile* profile); | 260 static void OpenHistoryWindow(Profile* profile); |
| 252 static void OpenDownloadsWindow(Profile* profile); | 261 static void OpenDownloadsWindow(Profile* profile); |
| 253 static void OpenHelpWindow(Profile* profile); | 262 static void OpenHelpWindow(Profile* profile); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 // Returns the index to insert a tab at during session restore and startup. | 335 // Returns the index to insert a tab at during session restore and startup. |
| 327 // |relative_index| gives the index of the url into the number of tabs that | 336 // |relative_index| gives the index of the url into the number of tabs that |
| 328 // are going to be opened. For example, if three urls are passed in on the | 337 // are going to be opened. For example, if three urls are passed in on the |
| 329 // command line this is invoked three times with the values 0, 1 and 2. | 338 // command line this is invoked three times with the values 0, 1 and 2. |
| 330 int GetIndexForInsertionDuringRestore(int relative_index); | 339 int GetIndexForInsertionDuringRestore(int relative_index); |
| 331 | 340 |
| 332 // Adds a new tab at the specified index. |add_types| is a bitmask of the | 341 // Adds a new tab at the specified index. |add_types| is a bitmask of the |
| 333 // values defined by TabStripModel::AddTabTypes; see it for details. If | 342 // values defined by TabStripModel::AddTabTypes; see it for details. If |
| 334 // |instance| is not null, its process will be used to render the tab. If | 343 // |instance| is not null, its process will be used to render the tab. If |
| 335 // |extension_app_id| is non-empty the new tab is an app tab. | 344 // |extension_app_id| is non-empty the new tab is an app tab. |
| 345 // The returned tab may be hosted in a different browser. |browser_used| |
| 346 // will be assigned the browser that satisfied the add tab request. |
| 347 // |browser_used| may be passed |
| 336 TabContents* AddTabWithURL(const GURL& url, | 348 TabContents* AddTabWithURL(const GURL& url, |
| 337 const GURL& referrer, | 349 const GURL& referrer, |
| 338 PageTransition::Type transition, | 350 PageTransition::Type transition, |
| 339 int index, | 351 int index, |
| 340 int add_types, | 352 int add_types, |
| 341 SiteInstance* instance, | 353 SiteInstance* instance, |
| 342 const std::string& extension_app_id); | 354 const std::string& extension_app_id, |
| 355 Browser** browser_used); |
| 343 | 356 |
| 344 // Add a new tab, given a TabContents. A TabContents appropriate to | 357 // Add a new tab, given a TabContents. A TabContents appropriate to |
| 345 // display the last committed entry is created and returned. | 358 // display the last committed entry is created and returned. |
| 346 TabContents* AddTab(TabContents* tab_contents, PageTransition::Type type); | 359 TabContents* AddTab(TabContents* tab_contents, PageTransition::Type type); |
| 347 | 360 |
| 348 // Add a tab with its session history restored from the SessionRestore | 361 // Add a tab with its session history restored from the SessionRestore |
| 349 // system. If select is true, the tab is selected. |tab_index| gives the index | 362 // system. If select is true, the tab is selected. |tab_index| gives the index |
| 350 // to insert the tab at. |selected_navigation| is the index of the | 363 // to insert the tab at. |selected_navigation| is the index of the |
| 351 // TabNavigation in |navigations| to select. If |extension_app_id| is | 364 // TabNavigation in |navigations| to select. If |extension_app_id| is |
| 352 // non-empty the tab is an app tab and |extension_app_id| is the id of the | 365 // non-empty the tab is an app tab and |extension_app_id| is the id of the |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 virtual void CloseFrameAfterDragSession(); | 666 virtual void CloseFrameAfterDragSession(); |
| 654 virtual void CreateHistoricalTab(TabContents* contents); | 667 virtual void CreateHistoricalTab(TabContents* contents); |
| 655 virtual bool RunUnloadListenerBeforeClosing(TabContents* contents); | 668 virtual bool RunUnloadListenerBeforeClosing(TabContents* contents); |
| 656 virtual bool CanCloseContentsAt(int index); | 669 virtual bool CanCloseContentsAt(int index); |
| 657 virtual bool CanBookmarkAllTabs() const; | 670 virtual bool CanBookmarkAllTabs() const; |
| 658 virtual void BookmarkAllTabs(); | 671 virtual void BookmarkAllTabs(); |
| 659 virtual bool CanCloseTab() const; | 672 virtual bool CanCloseTab() const; |
| 660 virtual void ToggleUseVerticalTabs(); | 673 virtual void ToggleUseVerticalTabs(); |
| 661 virtual bool CanRestoreTab(); | 674 virtual bool CanRestoreTab(); |
| 662 virtual void RestoreTab(); | 675 virtual void RestoreTab(); |
| 676 virtual bool LargeIconsPermitted() const; |
| 663 | 677 |
| 664 // Overridden from TabStripModelObserver: | 678 // Overridden from TabStripModelObserver: |
| 665 virtual void TabInsertedAt(TabContents* contents, | 679 virtual void TabInsertedAt(TabContents* contents, |
| 666 int index, | 680 int index, |
| 667 bool foreground); | 681 bool foreground); |
| 668 virtual void TabClosingAt(TabContents* contents, int index); | 682 virtual void TabClosingAt(TabContents* contents, int index); |
| 669 virtual void TabDetachedAt(TabContents* contents, int index); | 683 virtual void TabDetachedAt(TabContents* contents, int index); |
| 670 virtual void TabDeselectedAt(TabContents* contents, int index); | 684 virtual void TabDeselectedAt(TabContents* contents, int index); |
| 671 virtual void TabSelectedAt(TabContents* old_contents, | 685 virtual void TabSelectedAt(TabContents* old_contents, |
| 672 TabContents* new_contents, | 686 TabContents* new_contents, |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 bool show_history); | 748 bool show_history); |
| 735 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, | 749 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, |
| 736 bool* is_keyboard_shortcut); | 750 bool* is_keyboard_shortcut); |
| 737 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event); | 751 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event); |
| 738 virtual void ShowRepostFormWarningDialog(TabContents* tab_contents); | 752 virtual void ShowRepostFormWarningDialog(TabContents* tab_contents); |
| 739 virtual void ShowContentSettingsWindow(ContentSettingsType content_type); | 753 virtual void ShowContentSettingsWindow(ContentSettingsType content_type); |
| 740 virtual void ShowCollectedCookiesDialog(TabContents* tab_contents); | 754 virtual void ShowCollectedCookiesDialog(TabContents* tab_contents); |
| 741 virtual bool ShouldAddNavigationsToHistory() const; | 755 virtual bool ShouldAddNavigationsToHistory() const; |
| 742 virtual void OnDidGetApplicationInfo(TabContents* tab_contents, | 756 virtual void OnDidGetApplicationInfo(TabContents* tab_contents, |
| 743 int32 page_id); | 757 int32 page_id); |
| 744 virtual Browser* GetBrowser(); | |
| 745 virtual void ContentTypeChanged(TabContents* source); | 758 virtual void ContentTypeChanged(TabContents* source); |
| 746 virtual void CommitMatchPreview(TabContents* source); | 759 virtual void CommitMatchPreview(TabContents* source); |
| 747 | 760 |
| 748 // Overridden from SelectFileDialog::Listener: | 761 // Overridden from SelectFileDialog::Listener: |
| 749 virtual void FileSelected(const FilePath& path, int index, void* params); | 762 virtual void FileSelected(const FilePath& path, int index, void* params); |
| 750 | 763 |
| 751 // Overridden from NotificationObserver: | 764 // Overridden from NotificationObserver: |
| 752 virtual void Observe(NotificationType type, | 765 virtual void Observe(NotificationType type, |
| 753 const NotificationSource& source, | 766 const NotificationSource& source, |
| 754 const NotificationDetails& details); | 767 const NotificationDetails& details); |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1076 mutable BooleanPrefMember use_vertical_tabs_; | 1089 mutable BooleanPrefMember use_vertical_tabs_; |
| 1077 | 1090 |
| 1078 // The profile's tab restore service. The service is owned by the profile, | 1091 // The profile's tab restore service. The service is owned by the profile, |
| 1079 // and we install ourselves as an observer. | 1092 // and we install ourselves as an observer. |
| 1080 TabRestoreService* tab_restore_service_; | 1093 TabRestoreService* tab_restore_service_; |
| 1081 | 1094 |
| 1082 DISALLOW_COPY_AND_ASSIGN(Browser); | 1095 DISALLOW_COPY_AND_ASSIGN(Browser); |
| 1083 }; | 1096 }; |
| 1084 | 1097 |
| 1085 #endif // CHROME_BROWSER_BROWSER_H_ | 1098 #endif // CHROME_BROWSER_BROWSER_H_ |
| OLD | NEW |