| 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_LIST_H_ | 5 #ifndef CHROME_BROWSER_UI_BROWSER_LIST_H_ |
| 6 #define CHROME_BROWSER_UI_BROWSER_LIST_H_ | 6 #define CHROME_BROWSER_UI_BROWSER_LIST_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #if defined(OS_CHROMEOS) | 33 #if defined(OS_CHROMEOS) |
| 34 namespace chromeos { | 34 namespace chromeos { |
| 35 class ScreenLocker; | 35 class ScreenLocker; |
| 36 } | 36 } |
| 37 #endif | 37 #endif |
| 38 | 38 |
| 39 namespace content { | 39 namespace content { |
| 40 class WebContents; | 40 class WebContents; |
| 41 } | 41 } |
| 42 | 42 |
| 43 namespace web_intents { |
| 44 Browser* GetWebIntentDeliveryBrowser(Profile*); |
| 45 } |
| 46 |
| 43 #if defined(USE_ASH) | 47 #if defined(USE_ASH) |
| 44 content::WebContents* GetActiveWebContents(); | 48 content::WebContents* GetActiveWebContents(); |
| 45 #endif | 49 #endif |
| 46 | 50 |
| 47 // Stores a list of all Browser objects. | 51 // Stores a list of all Browser objects. |
| 48 class BrowserList { | 52 class BrowserList { |
| 49 public: | 53 public: |
| 50 typedef std::vector<Browser*> BrowserVector; | 54 typedef std::vector<Browser*> BrowserVector; |
| 51 typedef BrowserVector::iterator iterator; | 55 typedef BrowserVector::iterator iterator; |
| 52 typedef BrowserVector::const_iterator const_iterator; | 56 typedef BrowserVector::const_iterator const_iterator; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 // GetLastActive(). | 99 // GetLastActive(). |
| 96 friend class BrowserView; | 100 friend class BrowserView; |
| 97 friend class ChromeShellDelegate; | 101 friend class ChromeShellDelegate; |
| 98 friend class NetworkProfileBubble; | 102 friend class NetworkProfileBubble; |
| 99 friend class PrintPreviewHandler; | 103 friend class PrintPreviewHandler; |
| 100 friend class SelectFileDialogExtension; | 104 friend class SelectFileDialogExtension; |
| 101 friend class StartupBrowserCreatorImpl; | 105 friend class StartupBrowserCreatorImpl; |
| 102 friend class TaskManager; | 106 friend class TaskManager; |
| 103 friend class WindowSizer; | 107 friend class WindowSizer; |
| 104 friend class browser::BrowserActivityObserver; | 108 friend class browser::BrowserActivityObserver; |
| 109 friend Browser* web_intents::GetWebIntentDeliveryBrowser(Profile*); |
| 105 #if defined(OS_CHROMEOS) | 110 #if defined(OS_CHROMEOS) |
| 106 friend class chromeos::ScreenLocker; | 111 friend class chromeos::ScreenLocker; |
| 107 #endif | 112 #endif |
| 108 #if defined(OS_MACOSX) | 113 #if defined(OS_MACOSX) |
| 109 friend Browser* browser::GetLastActiveBrowser(); | 114 friend Browser* browser::GetLastActiveBrowser(); |
| 110 #endif | 115 #endif |
| 111 #if defined(USE_ASH) | 116 #if defined(USE_ASH) |
| 112 friend content::WebContents* GetActiveWebContents(); | 117 friend content::WebContents* GetActiveWebContents(); |
| 113 #endif | 118 #endif |
| 114 friend void chrome::internal::NotifyNotDefaultBrowserCallback(); | 119 friend void chrome::internal::NotifyNotDefaultBrowserCallback(); |
| 115 // DO NOT ADD MORE FRIENDS TO THIS LIST. | 120 // DO NOT ADD MORE FRIENDS TO THIS LIST. |
| 116 | 121 |
| 117 // Returns the Browser object whose window was most recently active. If the | 122 // Returns the Browser object whose window was most recently active. If the |
| 118 // most recently open Browser's window was closed, returns the first Browser | 123 // most recently open Browser's window was closed, returns the first Browser |
| 119 // in the list. If no Browsers exist, returns NULL. | 124 // in the list. If no Browsers exist, returns NULL. |
| 120 // | 125 // |
| 121 // WARNING: this is NULL until a browser becomes active. If during startup | 126 // WARNING: this is NULL until a browser becomes active. If during startup |
| 122 // a browser does not become active (perhaps the user launches Chrome, then | 127 // a browser does not become active (perhaps the user launches Chrome, then |
| 123 // clicks on another app before the first browser window appears) then this | 128 // clicks on another app before the first browser window appears) then this |
| 124 // returns NULL. | 129 // returns NULL. |
| 125 // WARNING #2: this will always be NULL in unit tests run on the bots. | 130 // WARNING #2: this will always be NULL in unit tests run on the bots. |
| 126 // THIS FUNCTION IS PRIVATE AND NOT TO BE USED AS A REPLACEMENT FOR RELEVANT | 131 // THIS FUNCTION IS PRIVATE AND NOT TO BE USED AS A REPLACEMENT FOR RELEVANT |
| 127 // CONTEXT. | 132 // CONTEXT. |
| 128 static Browser* GetLastActive(); | 133 static Browser* GetLastActive(); |
| 129 }; | 134 }; |
| 130 | 135 |
| 131 #endif // CHROME_BROWSER_UI_BROWSER_LIST_H_ | 136 #endif // CHROME_BROWSER_UI_BROWSER_LIST_H_ |
| OLD | NEW |