OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 static void RegisterUserPrefs(PrefService* prefs); | 396 static void RegisterUserPrefs(PrefService* prefs); |
397 | 397 |
398 // Returns the Browser which contains the tab with the given | 398 // Returns the Browser which contains the tab with the given |
399 // NavigationController, also filling in |index| (if valid) with the tab's | 399 // NavigationController, also filling in |index| (if valid) with the tab's |
400 // index in the tab strip. | 400 // index in the tab strip. |
401 // Returns NULL if not found. | 401 // Returns NULL if not found. |
402 // This call is O(N) in the number of tabs. | 402 // This call is O(N) in the number of tabs. |
403 static Browser* GetBrowserForController( | 403 static Browser* GetBrowserForController( |
404 const NavigationController* controller, int* index); | 404 const NavigationController* controller, int* index); |
405 | 405 |
| 406 // Retrieve the last active tabbed browser with a profile matching |profile|. |
| 407 // Creates a new Browser if none are available. |
| 408 static Browser* GetOrCreateTabbedBrowser(Profile* profile); |
406 | 409 |
407 // Helper function to create a new popup window. | 410 // Helper function to create a new popup window. |
408 static void BuildPopupWindowHelper(TabContents* source, | 411 static void BuildPopupWindowHelper(TabContents* source, |
409 TabContents* new_contents, | 412 TabContents* new_contents, |
410 const gfx::Rect& initial_pos, | 413 const gfx::Rect& initial_pos, |
411 Browser::Type browser_type, | 414 Browser::Type browser_type, |
412 Profile* profile, | 415 Profile* profile, |
413 bool honor_saved_maximized_state); | 416 bool honor_saved_maximized_state); |
414 | 417 |
415 // Calls ExecuteCommandWithDisposition with the given disposition. | 418 // Calls ExecuteCommandWithDisposition with the given disposition. |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 | 609 |
607 // In-progress download termination handling ///////////////////////////////// | 610 // In-progress download termination handling ///////////////////////////////// |
608 | 611 |
609 // Called when the window is closing to check if potential in-progress | 612 // Called when the window is closing to check if potential in-progress |
610 // downloads should prevent it from closing. | 613 // downloads should prevent it from closing. |
611 // Returns true if the window can close, false otherwise. | 614 // Returns true if the window can close, false otherwise. |
612 bool CanCloseWithInProgressDownloads(); | 615 bool CanCloseWithInProgressDownloads(); |
613 | 616 |
614 // Assorted utility functions /////////////////////////////////////////////// | 617 // Assorted utility functions /////////////////////////////////////////////// |
615 | 618 |
616 // Retrieve the last active tabbed browser with the same profile as the | |
617 // receiving Browser. Creates a new Browser if none are available. | |
618 Browser* GetOrCreateTabbedBrowser(); | |
619 | |
620 // The low-level function that other OpenURL...() functions call. This | 619 // The low-level function that other OpenURL...() functions call. This |
621 // determines the appropriate SiteInstance to pass to AddTabWithURL(), focuses | 620 // determines the appropriate SiteInstance to pass to AddTabWithURL(), focuses |
622 // the newly created tab as needed, and does other miscellaneous housekeeping. | 621 // the newly created tab as needed, and does other miscellaneous housekeeping. |
623 void OpenURLAtIndex(TabContents* source, | 622 void OpenURLAtIndex(TabContents* source, |
624 const GURL& url, | 623 const GURL& url, |
625 const GURL& referrer, | 624 const GURL& referrer, |
626 WindowOpenDisposition disposition, | 625 WindowOpenDisposition disposition, |
627 PageTransition::Type transition, | 626 PageTransition::Type transition, |
628 int index, | 627 int index, |
629 bool force_index); | 628 bool force_index); |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 // The browser idle task helps cleanup unused memory resources when idle. | 772 // The browser idle task helps cleanup unused memory resources when idle. |
774 scoped_ptr<BrowserIdleTimer> idle_task_; | 773 scoped_ptr<BrowserIdleTimer> idle_task_; |
775 | 774 |
776 // Keep track of the encoding auto detect pref. | 775 // Keep track of the encoding auto detect pref. |
777 BooleanPrefMember encoding_auto_detect_; | 776 BooleanPrefMember encoding_auto_detect_; |
778 | 777 |
779 DISALLOW_COPY_AND_ASSIGN(Browser); | 778 DISALLOW_COPY_AND_ASSIGN(Browser); |
780 }; | 779 }; |
781 | 780 |
782 #endif // CHROME_BROWSER_BROWSER_H_ | 781 #endif // CHROME_BROWSER_BROWSER_H_ |
OLD | NEW |