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> |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 // The browser is shutting down and there are active downloads | 150 // The browser is shutting down and there are active downloads |
151 // that would be cancelled. | 151 // that would be cancelled. |
152 DOWNLOAD_CLOSE_BROWSER_SHUTDOWN, | 152 DOWNLOAD_CLOSE_BROWSER_SHUTDOWN, |
153 | 153 |
154 // There are active downloads associated with this incognito profile | 154 // There are active downloads associated with this incognito profile |
155 // that would be canceled. | 155 // that would be canceled. |
156 DOWNLOAD_CLOSE_LAST_WINDOW_IN_INCOGNITO_PROFILE, | 156 DOWNLOAD_CLOSE_LAST_WINDOW_IN_INCOGNITO_PROFILE, |
157 }; | 157 }; |
158 | 158 |
159 struct CreateParams { | 159 struct CreateParams { |
160 CreateParams(Profile* profile, chrome::HostDesktopType host_desktop_type); | 160 CreateParams(Profile* profile, ui::HostDesktopType host_desktop_type); |
161 CreateParams(Type type, | 161 CreateParams(Type type, |
162 Profile* profile, | 162 Profile* profile, |
163 chrome::HostDesktopType host_desktop_type); | 163 ui::HostDesktopType host_desktop_type); |
164 | 164 |
165 static CreateParams CreateForApp(const std::string& app_name, | 165 static CreateParams CreateForApp(const std::string& app_name, |
166 bool trusted_source, | 166 bool trusted_source, |
167 const gfx::Rect& window_bounds, | 167 const gfx::Rect& window_bounds, |
168 Profile* profile, | 168 Profile* profile, |
169 chrome::HostDesktopType host_desktop_type); | 169 ui::HostDesktopType host_desktop_type); |
170 | 170 |
171 static CreateParams CreateForDevTools( | 171 static CreateParams CreateForDevTools( |
172 Profile* profile, | 172 Profile* profile, |
173 chrome::HostDesktopType host_desktop_type); | 173 ui::HostDesktopType host_desktop_type); |
174 | 174 |
175 // The browser type. | 175 // The browser type. |
176 Type type; | 176 Type type; |
177 | 177 |
178 // The associated profile. | 178 // The associated profile. |
179 Profile* profile; | 179 Profile* profile; |
180 | 180 |
181 // The host desktop the browser is created on. | 181 // The host desktop the browser is created on. |
182 chrome::HostDesktopType host_desktop_type; | 182 ui::HostDesktopType host_desktop_type; |
183 | 183 |
184 // Specifies the browser is_trusted_source_ value. | 184 // Specifies the browser is_trusted_source_ value. |
185 bool trusted_source; | 185 bool trusted_source; |
186 | 186 |
187 // The bounds of the window to open. | 187 // The bounds of the window to open. |
188 gfx::Rect initial_bounds; | 188 gfx::Rect initial_bounds; |
189 | 189 |
190 ui::WindowShowState initial_show_state; | 190 ui::WindowShowState initial_show_state; |
191 | 191 |
192 bool is_session_restore; | 192 bool is_session_restore; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 } | 226 } |
227 // Set indicator that this browser is being created via session restore. | 227 // Set indicator that this browser is being created via session restore. |
228 // This is used on the Mac (only) to determine animation style when the | 228 // This is used on the Mac (only) to determine animation style when the |
229 // browser window is shown. | 229 // browser window is shown. |
230 void set_is_session_restore(bool is_session_restore) { | 230 void set_is_session_restore(bool is_session_restore) { |
231 is_session_restore_ = is_session_restore; | 231 is_session_restore_ = is_session_restore; |
232 } | 232 } |
233 bool is_session_restore() const { | 233 bool is_session_restore() const { |
234 return is_session_restore_; | 234 return is_session_restore_; |
235 } | 235 } |
236 chrome::HostDesktopType host_desktop_type() const { | 236 ui::HostDesktopType host_desktop_type() const { return host_desktop_type_; } |
237 return host_desktop_type_; | |
238 } | |
239 | 237 |
240 // Accessors //////////////////////////////////////////////////////////////// | 238 // Accessors //////////////////////////////////////////////////////////////// |
241 | 239 |
242 Type type() const { return type_; } | 240 Type type() const { return type_; } |
243 const std::string& app_name() const { return app_name_; } | 241 const std::string& app_name() const { return app_name_; } |
244 bool is_trusted_source() const { return is_trusted_source_; } | 242 bool is_trusted_source() const { return is_trusted_source_; } |
245 Profile* profile() const { return profile_; } | 243 Profile* profile() const { return profile_; } |
246 gfx::Rect override_bounds() const { return override_bounds_; } | 244 gfx::Rect override_bounds() const { return override_bounds_; } |
247 | 245 |
248 // |window()| will return NULL if called before |CreateBrowserWindow()| | 246 // |window()| will return NULL if called before |CreateBrowserWindow()| |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 // These are supplied by callers that don't want to use the default values. | 919 // These are supplied by callers that don't want to use the default values. |
922 // The default values are typically loaded from local state (last session), | 920 // The default values are typically loaded from local state (last session), |
923 // obtained from the last window of the same type, or obtained from the | 921 // obtained from the last window of the same type, or obtained from the |
924 // shell shortcut's startup info. | 922 // shell shortcut's startup info. |
925 gfx::Rect override_bounds_; | 923 gfx::Rect override_bounds_; |
926 ui::WindowShowState initial_show_state_; | 924 ui::WindowShowState initial_show_state_; |
927 | 925 |
928 // Tracks when this browser is being created by session restore. | 926 // Tracks when this browser is being created by session restore. |
929 bool is_session_restore_; | 927 bool is_session_restore_; |
930 | 928 |
931 const chrome::HostDesktopType host_desktop_type_; | 929 const ui::HostDesktopType host_desktop_type_; |
932 | 930 |
933 scoped_ptr<chrome::UnloadController> unload_controller_; | 931 scoped_ptr<chrome::UnloadController> unload_controller_; |
934 scoped_ptr<chrome::FastUnloadController> fast_unload_controller_; | 932 scoped_ptr<chrome::FastUnloadController> fast_unload_controller_; |
935 | 933 |
936 scoped_ptr<ChromeBubbleManager> bubble_manager_; | 934 scoped_ptr<ChromeBubbleManager> bubble_manager_; |
937 | 935 |
938 // The Find Bar. This may be NULL if there is no Find Bar, and if it is | 936 // The Find Bar. This may be NULL if there is no Find Bar, and if it is |
939 // non-NULL, it may or may not be visible. | 937 // non-NULL, it may or may not be visible. |
940 scoped_ptr<FindBarController> find_bar_controller_; | 938 scoped_ptr<FindBarController> find_bar_controller_; |
941 | 939 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
983 // The following factory is used for chrome update coalescing. | 981 // The following factory is used for chrome update coalescing. |
984 base::WeakPtrFactory<Browser> chrome_updater_factory_; | 982 base::WeakPtrFactory<Browser> chrome_updater_factory_; |
985 | 983 |
986 // The following factory is used to close the frame at a later time. | 984 // The following factory is used to close the frame at a later time. |
987 base::WeakPtrFactory<Browser> weak_factory_; | 985 base::WeakPtrFactory<Browser> weak_factory_; |
988 | 986 |
989 DISALLOW_COPY_AND_ASSIGN(Browser); | 987 DISALLOW_COPY_AND_ASSIGN(Browser); |
990 }; | 988 }; |
991 | 989 |
992 #endif // CHROME_BROWSER_UI_BROWSER_H_ | 990 #endif // CHROME_BROWSER_UI_BROWSER_H_ |
OLD | NEW |