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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 | 264 |
265 // Returns true if a FindBarController exists for this browser. | 265 // Returns true if a FindBarController exists for this browser. |
266 bool HasFindBarController() const; | 266 bool HasFindBarController() const; |
267 | 267 |
268 // Returns the state of the bookmark bar. | 268 // Returns the state of the bookmark bar. |
269 BookmarkBar::State bookmark_bar_state() const { return bookmark_bar_state_; } | 269 BookmarkBar::State bookmark_bar_state() const { return bookmark_bar_state_; } |
270 | 270 |
271 // Browser Creation Helpers ///////////////////////////////////////////////// | 271 // Browser Creation Helpers ///////////////////////////////////////////////// |
272 | 272 |
273 // Opens a new window with the default blank tab. | 273 // Opens a new window with the default blank tab. |
274 static void NewEmptyWindow(Profile* profile); | 274 static void NewEmptyWindow(Profile* profile); |
275 | 275 |
276 // Opens a new window with the default blank tab. This bypasses metrics and | 276 // Opens a new window with the default blank tab. This bypasses metrics and |
277 // various internal bookkeeping; NewEmptyWindow (above) is preferred. | 277 // various internal bookkeeping; NewEmptyWindow (above) is preferred. |
278 static Browser* OpenEmptyWindow(Profile* profile); | 278 static Browser* OpenEmptyWindow(Profile* profile); |
279 | 279 |
280 // Opens a new window with the tabs from |profile|'s TabRestoreService. | 280 // Opens a new window with the tabs from |profile|'s TabRestoreService. |
281 static void OpenWindowWithRestoredTabs(Profile* profile); | 281 static void OpenWindowWithRestoredTabs(Profile* profile); |
282 | 282 |
283 // Opens the specified URL in a new browser window in an incognito session. | 283 // Opens the specified URL in a new browser window in an incognito session. |
284 // If there is already an existing active incognito session for the specified | 284 // If there is already an existing active incognito session for the specified |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 // set new values if they have not been set already. This method gets called | 673 // set new values if they have not been set already. This method gets called |
674 // during First Run. | 674 // during First Run. |
675 static void SetNewHomePagePrefs(PrefService* prefs); | 675 static void SetNewHomePagePrefs(PrefService* prefs); |
676 | 676 |
677 static void RegisterPrefs(PrefService* prefs); | 677 static void RegisterPrefs(PrefService* prefs); |
678 static void RegisterUserPrefs(PrefService* prefs); | 678 static void RegisterUserPrefs(PrefService* prefs); |
679 | 679 |
680 // Helper function to run unload listeners on a WebContents. | 680 // Helper function to run unload listeners on a WebContents. |
681 static bool RunUnloadEventsHelper(content::WebContents* contents); | 681 static bool RunUnloadEventsHelper(content::WebContents* contents); |
682 | 682 |
683 // Returns the Browser which contains the tab with the given | |
684 // NavigationController, also filling in |index| (if valid) with the tab's | |
685 // index in the tab strip. | |
686 // Returns NULL if not found. | |
687 // This call is O(N) in the number of tabs. | |
688 static Browser* GetBrowserForController( | |
689 const content::NavigationController* controller, int* index); | |
690 | |
691 // Retrieve the last active tabbed browser with a profile matching |profile|. | |
692 // If |match_original_profiles| is true, matching is done based on the | |
693 // original profile, eg profile->GetOriginalProfile() == | |
694 // browser->profile()->GetOriginalProfile(). This has the effect of matching | |
695 // against both non-incognito and incognito profiles. If | |
696 // |match_original_profiles| is false, only an exact match may be returned. | |
697 static Browser* GetTabbedBrowser(Profile* profile, | |
698 bool match_original_profiles); | |
699 | |
700 // Retrieve the last active tabbed browser with a profile matching |profile|. | |
701 // Creates a new Browser if none are available. | |
702 static Browser* GetOrCreateTabbedBrowser(Profile* profile); | |
703 | |
704 // Helper function to display the file selection dialog. | 683 // Helper function to display the file selection dialog. |
705 static void RunFileChooserHelper( | 684 static void RunFileChooserHelper( |
706 content::WebContents* tab, const content::FileChooserParams& params); | 685 content::WebContents* tab, const content::FileChooserParams& params); |
707 | 686 |
708 // Helper function to enumerate a directory. | 687 // Helper function to enumerate a directory. |
709 static void EnumerateDirectoryHelper(content::WebContents* tab, | 688 static void EnumerateDirectoryHelper(content::WebContents* tab, |
710 int request_id, | 689 int request_id, |
711 const FilePath& path); | 690 const FilePath& path); |
712 | 691 |
713 // Helper function to handle JS out of memory notifications | 692 // Helper function to handle JS out of memory notifications |
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1480 bool window_has_shown_; | 1459 bool window_has_shown_; |
1481 | 1460 |
1482 // Currently open color chooser. Non-NULL after OpenColorChooser is called and | 1461 // Currently open color chooser. Non-NULL after OpenColorChooser is called and |
1483 // before DidEndColorChooser is called. | 1462 // before DidEndColorChooser is called. |
1484 scoped_ptr<content::ColorChooser> color_chooser_; | 1463 scoped_ptr<content::ColorChooser> color_chooser_; |
1485 | 1464 |
1486 DISALLOW_COPY_AND_ASSIGN(Browser); | 1465 DISALLOW_COPY_AND_ASSIGN(Browser); |
1487 }; | 1466 }; |
1488 | 1467 |
1489 #endif // CHROME_BROWSER_UI_BROWSER_H_ | 1468 #endif // CHROME_BROWSER_UI_BROWSER_H_ |
OLD | NEW |