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 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
18 #include "base/string16.h" | 18 #include "base/string16.h" |
19 #include "chrome/browser/debugger/devtools_toggle_action.h" | 19 #include "chrome/browser/debugger/devtools_toggle_action.h" |
20 #include "chrome/browser/event_disposition.h" | 20 #include "chrome/browser/event_disposition.h" |
21 #include "chrome/browser/prefs/pref_change_registrar.h" | 21 #include "chrome/browser/prefs/pref_change_registrar.h" |
22 #include "chrome/browser/prefs/pref_member.h" | 22 #include "chrome/browser/prefs/pref_member.h" |
23 #include "chrome/browser/sessions/session_id.h" | 23 #include "chrome/browser/sessions/session_id.h" |
24 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper_delegate.
h" | 24 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper_delegate.
h" |
25 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" | 25 #include "chrome/browser/ui/bookmarks/bookmark_bar.h" |
26 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper_delegate.h" | 26 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper_delegate.h" |
27 #include "chrome/browser/ui/browser_navigator.h" | 27 #include "chrome/browser/ui/browser_navigator.h" |
28 #include "chrome/browser/ui/constrained_window_tab_helper_delegate.h" | 28 #include "chrome/browser/ui/constrained_window_tab_helper_delegate.h" |
| 29 #include "chrome/browser/ui/host_desktop.h" |
29 #include "chrome/browser/ui/search_engines/search_engine_tab_helper_delegate.h" | 30 #include "chrome/browser/ui/search_engines/search_engine_tab_helper_delegate.h" |
30 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" | 31 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" |
31 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" | 32 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
32 #include "chrome/browser/ui/toolbar/toolbar_model.h" | 33 #include "chrome/browser/ui/toolbar/toolbar_model.h" |
33 #include "chrome/browser/ui/zoom/zoom_observer.h" | 34 #include "chrome/browser/ui/zoom/zoom_observer.h" |
34 #include "chrome/common/content_settings.h" | 35 #include "chrome/common/content_settings.h" |
35 #include "chrome/common/content_settings_types.h" | 36 #include "chrome/common/content_settings_types.h" |
36 #include "chrome/common/extensions/extension_constants.h" | 37 #include "chrome/common/extensions/extension_constants.h" |
37 #include "content/public/browser/notification_registrar.h" | 38 #include "content/public/browser/notification_registrar.h" |
38 #include "content/public/browser/page_navigator.h" | 39 #include "content/public/browser/page_navigator.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 152 |
152 // There are active downloads associated with this incognito profile | 153 // There are active downloads associated with this incognito profile |
153 // that would be canceled. | 154 // that would be canceled. |
154 DOWNLOAD_CLOSE_LAST_WINDOW_IN_INCOGNITO_PROFILE, | 155 DOWNLOAD_CLOSE_LAST_WINDOW_IN_INCOGNITO_PROFILE, |
155 }; | 156 }; |
156 | 157 |
157 struct CreateParams { | 158 struct CreateParams { |
158 CreateParams(); | 159 CreateParams(); |
159 explicit CreateParams(Profile* profile); | 160 explicit CreateParams(Profile* profile); |
160 CreateParams(Type type, Profile* profile); | 161 CreateParams(Type type, Profile* profile); |
| 162 CreateParams(Type type, |
| 163 Profile* profile, |
| 164 chrome::HostDesktopType host_desktop_type); |
161 | 165 |
162 static CreateParams CreateForApp(Type type, | 166 static CreateParams CreateForApp(Type type, |
163 const std::string& app_name, | 167 const std::string& app_name, |
164 const gfx::Rect& window_bounds, | 168 const gfx::Rect& window_bounds, |
165 Profile* profile); | 169 Profile* profile); |
166 | 170 |
167 static CreateParams CreateForDevTools(Profile* profile); | 171 static CreateParams CreateForDevTools(Profile* profile); |
168 | 172 |
169 // The browser type. | 173 // The browser type. |
170 Type type; | 174 Type type; |
171 | 175 |
172 // The associated profile. | 176 // The associated profile. |
173 Profile* profile; | 177 Profile* profile; |
174 | 178 |
| 179 // The host desktop the browser is created on. |
| 180 chrome::HostDesktopType host_desktop_type; |
| 181 |
175 // The application name that is also the name of the window to the shell. | 182 // The application name that is also the name of the window to the shell. |
176 // This name should be set when: | 183 // This name should be set when: |
177 // 1) we launch an application via an application shortcut or extension API. | 184 // 1) we launch an application via an application shortcut or extension API. |
178 // 2) we launch an undocked devtool window. | 185 // 2) we launch an undocked devtool window. |
179 std::string app_name; | 186 std::string app_name; |
180 | 187 |
181 // Type of app (host or child). See description of AppType. | 188 // Type of app (host or child). See description of AppType. |
182 AppType app_type; | 189 AppType app_type; |
183 | 190 |
184 // The bounds of the window to open. | 191 // The bounds of the window to open. |
(...skipping 27 matching lines...) Expand all Loading... |
212 } | 219 } |
213 // Set indicator that this browser is being created via session restore. | 220 // Set indicator that this browser is being created via session restore. |
214 // This is used on the Mac (only) to determine animation style when the | 221 // This is used on the Mac (only) to determine animation style when the |
215 // browser window is shown. | 222 // browser window is shown. |
216 void set_is_session_restore(bool is_session_restore) { | 223 void set_is_session_restore(bool is_session_restore) { |
217 is_session_restore_ = is_session_restore; | 224 is_session_restore_ = is_session_restore; |
218 } | 225 } |
219 bool is_session_restore() const { | 226 bool is_session_restore() const { |
220 return is_session_restore_; | 227 return is_session_restore_; |
221 } | 228 } |
| 229 chrome::HostDesktopType host_desktop_type() { |
| 230 return host_desktop_type_; |
| 231 }; |
222 | 232 |
223 // Accessors //////////////////////////////////////////////////////////////// | 233 // Accessors //////////////////////////////////////////////////////////////// |
224 | 234 |
225 Type type() const { return type_; } | 235 Type type() const { return type_; } |
226 const std::string& app_name() const { return app_name_; } | 236 const std::string& app_name() const { return app_name_; } |
227 AppType app_type() const { return app_type_; } | 237 AppType app_type() const { return app_type_; } |
228 Profile* profile() const { return profile_; } | 238 Profile* profile() const { return profile_; } |
229 gfx::Rect override_bounds() const { return override_bounds_; } | 239 gfx::Rect override_bounds() const { return override_bounds_; } |
230 | 240 |
231 // |window()| will return NULL if called before |CreateBrowserWindow()| | 241 // |window()| will return NULL if called before |CreateBrowserWindow()| |
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 // These are supplied by callers that don't want to use the default values. | 866 // These are supplied by callers that don't want to use the default values. |
857 // The default values are typically loaded from local state (last session), | 867 // The default values are typically loaded from local state (last session), |
858 // obtained from the last window of the same type, or obtained from the | 868 // obtained from the last window of the same type, or obtained from the |
859 // shell shortcut's startup info. | 869 // shell shortcut's startup info. |
860 gfx::Rect override_bounds_; | 870 gfx::Rect override_bounds_; |
861 ui::WindowShowState initial_show_state_; | 871 ui::WindowShowState initial_show_state_; |
862 | 872 |
863 // Tracks when this browser is being created by session restore. | 873 // Tracks when this browser is being created by session restore. |
864 bool is_session_restore_; | 874 bool is_session_restore_; |
865 | 875 |
| 876 chrome::HostDesktopType host_desktop_type_; |
| 877 |
866 scoped_ptr<chrome::UnloadController> unload_controller_; | 878 scoped_ptr<chrome::UnloadController> unload_controller_; |
867 | 879 |
868 // The following factory is used to close the frame at a later time. | 880 // The following factory is used to close the frame at a later time. |
869 base::WeakPtrFactory<Browser> weak_factory_; | 881 base::WeakPtrFactory<Browser> weak_factory_; |
870 | 882 |
871 // The Find Bar. This may be NULL if there is no Find Bar, and if it is | 883 // The Find Bar. This may be NULL if there is no Find Bar, and if it is |
872 // non-NULL, it may or may not be visible. | 884 // non-NULL, it may or may not be visible. |
873 scoped_ptr<FindBarController> find_bar_controller_; | 885 scoped_ptr<FindBarController> find_bar_controller_; |
874 | 886 |
875 // Dialog box used for opening and saving files. | 887 // Dialog box used for opening and saving files. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
911 bool window_has_shown_; | 923 bool window_has_shown_; |
912 | 924 |
913 // Currently open color chooser. Non-NULL after OpenColorChooser is called and | 925 // Currently open color chooser. Non-NULL after OpenColorChooser is called and |
914 // before DidEndColorChooser is called. | 926 // before DidEndColorChooser is called. |
915 scoped_ptr<content::ColorChooser> color_chooser_; | 927 scoped_ptr<content::ColorChooser> color_chooser_; |
916 | 928 |
917 DISALLOW_COPY_AND_ASSIGN(Browser); | 929 DISALLOW_COPY_AND_ASSIGN(Browser); |
918 }; | 930 }; |
919 | 931 |
920 #endif // CHROME_BROWSER_UI_BROWSER_H_ | 932 #endif // CHROME_BROWSER_UI_BROWSER_H_ |
OLD | NEW |