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_ASH_CHROME_SHELL_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_CHROME_SHELL_DELEGATE_H_ |
6 #define CHROME_BROWSER_UI_ASH_CHROME_SHELL_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_ASH_CHROME_SHELL_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ash/launcher/launcher_types.h" | 10 #include "ash/launcher/launcher_types.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 101 |
102 private: | 102 private: |
103 class TabRestoreHelper; | 103 class TabRestoreHelper; |
104 | 104 |
105 void PlatformInit(); | 105 void PlatformInit(); |
106 | 106 |
107 // Returns the browser for active ash window if any. Otherwise it searches | 107 // Returns the browser for active ash window if any. Otherwise it searches |
108 // for a browser or create one for default profile and returns it. | 108 // for a browser or create one for default profile and returns it. |
109 Browser* GetTargetBrowser(); | 109 Browser* GetTargetBrowser(); |
110 | 110 |
| 111 // This returns the active ash window if any. Unlike the method above, it |
| 112 // does not create a window if one isn't available, instead it returns NULL |
| 113 // in that case. |
| 114 Browser* GetTargetBrowserIfAvailable(); |
| 115 |
111 static ChromeShellDelegate* instance_; | 116 static ChromeShellDelegate* instance_; |
112 | 117 |
113 content::NotificationRegistrar registrar_; | 118 content::NotificationRegistrar registrar_; |
114 | 119 |
115 scoped_ptr<ash::WindowPositioner> window_positioner_; | 120 scoped_ptr<ash::WindowPositioner> window_positioner_; |
116 | 121 |
117 base::WeakPtrFactory<ChromeShellDelegate> weak_factory_; | 122 base::WeakPtrFactory<ChromeShellDelegate> weak_factory_; |
118 | 123 |
119 ChromeLauncherController* launcher_delegate_; | 124 ChromeLauncherController* launcher_delegate_; |
120 | 125 |
121 scoped_ptr<TabRestoreHelper> tab_restore_helper_; | 126 scoped_ptr<TabRestoreHelper> tab_restore_helper_; |
122 | 127 |
123 DISALLOW_COPY_AND_ASSIGN(ChromeShellDelegate); | 128 DISALLOW_COPY_AND_ASSIGN(ChromeShellDelegate); |
124 }; | 129 }; |
125 | 130 |
126 #endif // CHROME_BROWSER_UI_ASH_CHROME_SHELL_DELEGATE_H_ | 131 #endif // CHROME_BROWSER_UI_ASH_CHROME_SHELL_DELEGATE_H_ |
OLD | NEW |