| 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 std::string app_name; | 189 std::string app_name; |
| 190 | 190 |
| 191 // Type of app (host or child). See description of AppType. | 191 // Type of app (host or child). See description of AppType. |
| 192 AppType app_type; | 192 AppType app_type; |
| 193 | 193 |
| 194 // The bounds of the window to open. | 194 // The bounds of the window to open. |
| 195 gfx::Rect initial_bounds; | 195 gfx::Rect initial_bounds; |
| 196 | 196 |
| 197 ui::WindowShowState initial_show_state; | 197 ui::WindowShowState initial_show_state; |
| 198 | 198 |
| 199 // If |is_session_restore| is set upon restoration and this flag is true, |
| 200 // the window will get marked as user hand positioned. |
| 201 bool initial_user_has_changed_window_or_position; |
| 202 |
| 199 bool is_session_restore; | 203 bool is_session_restore; |
| 200 | 204 |
| 201 // Supply a custom BrowserWindow implementation, to be used instead of the | 205 // Supply a custom BrowserWindow implementation, to be used instead of the |
| 202 // default. Intended for testing. | 206 // default. Intended for testing. |
| 203 BrowserWindow* window; | 207 BrowserWindow* window; |
| 204 }; | 208 }; |
| 205 | 209 |
| 206 // Constructors, Creation, Showing ////////////////////////////////////////// | 210 // Constructors, Creation, Showing ////////////////////////////////////////// |
| 207 | 211 |
| 208 explicit Browser(const CreateParams& params); | 212 explicit Browser(const CreateParams& params); |
| 209 virtual ~Browser(); | 213 virtual ~Browser(); |
| 210 | 214 |
| 211 // Set overrides for the initial window bounds and maximized state. | 215 // Set overrides for the initial window bounds and maximized state. |
| 212 void set_override_bounds(const gfx::Rect& bounds) { | 216 void set_override_bounds(const gfx::Rect& bounds) { |
| 213 override_bounds_ = bounds; | 217 override_bounds_ = bounds; |
| 214 } | 218 } |
| 215 ui::WindowShowState initial_show_state() const { return initial_show_state_; } | 219 ui::WindowShowState initial_show_state() const { return initial_show_state_; } |
| 220 bool initial_user_has_changed_window_or_position() const { |
| 221 return initial_user_has_changed_window_or_position_; |
| 222 } |
| 216 void set_initial_show_state(ui::WindowShowState initial_show_state) { | 223 void set_initial_show_state(ui::WindowShowState initial_show_state) { |
| 217 initial_show_state_ = initial_show_state; | 224 initial_show_state_ = initial_show_state; |
| 218 } | 225 } |
| 219 // Return true if the initial window bounds have been overridden. | 226 // Return true if the initial window bounds have been overridden. |
| 220 bool bounds_overridden() const { | 227 bool bounds_overridden() const { |
| 221 return !override_bounds_.IsEmpty(); | 228 return !override_bounds_.IsEmpty(); |
| 222 } | 229 } |
| 223 // Set indicator that this browser is being created via session restore. | 230 // Set indicator that this browser is being created via session restore. |
| 224 // This is used on the Mac (only) to determine animation style when the | 231 // This is used on the Mac (only) to determine animation style when the |
| 225 // browser window is shown. | 232 // browser window is shown. |
| (...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 ///////////////////////////////////////////////////////////////////////////// | 882 ///////////////////////////////////////////////////////////////////////////// |
| 876 | 883 |
| 877 // Override values for the bounds of the window and its maximized or minimized | 884 // Override values for the bounds of the window and its maximized or minimized |
| 878 // state. | 885 // state. |
| 879 // These are supplied by callers that don't want to use the default values. | 886 // These are supplied by callers that don't want to use the default values. |
| 880 // The default values are typically loaded from local state (last session), | 887 // The default values are typically loaded from local state (last session), |
| 881 // obtained from the last window of the same type, or obtained from the | 888 // obtained from the last window of the same type, or obtained from the |
| 882 // shell shortcut's startup info. | 889 // shell shortcut's startup info. |
| 883 gfx::Rect override_bounds_; | 890 gfx::Rect override_bounds_; |
| 884 ui::WindowShowState initial_show_state_; | 891 ui::WindowShowState initial_show_state_; |
| 892 bool initial_user_has_changed_window_or_position_; |
| 885 | 893 |
| 886 // Tracks when this browser is being created by session restore. | 894 // Tracks when this browser is being created by session restore. |
| 887 bool is_session_restore_; | 895 bool is_session_restore_; |
| 888 | 896 |
| 889 chrome::HostDesktopType host_desktop_type_; | 897 chrome::HostDesktopType host_desktop_type_; |
| 890 | 898 |
| 891 scoped_ptr<chrome::UnloadController> unload_controller_; | 899 scoped_ptr<chrome::UnloadController> unload_controller_; |
| 892 | 900 |
| 893 // The following factory is used to close the frame at a later time. | 901 // The following factory is used to close the frame at a later time. |
| 894 base::WeakPtrFactory<Browser> weak_factory_; | 902 base::WeakPtrFactory<Browser> weak_factory_; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 939 bool window_has_shown_; | 947 bool window_has_shown_; |
| 940 | 948 |
| 941 // Currently open color chooser. Non-NULL after OpenColorChooser is called and | 949 // Currently open color chooser. Non-NULL after OpenColorChooser is called and |
| 942 // before DidEndColorChooser is called. | 950 // before DidEndColorChooser is called. |
| 943 scoped_ptr<content::ColorChooser> color_chooser_; | 951 scoped_ptr<content::ColorChooser> color_chooser_; |
| 944 | 952 |
| 945 DISALLOW_COPY_AND_ASSIGN(Browser); | 953 DISALLOW_COPY_AND_ASSIGN(Browser); |
| 946 }; | 954 }; |
| 947 | 955 |
| 948 #endif // CHROME_BROWSER_UI_BROWSER_H_ | 956 #endif // CHROME_BROWSER_UI_BROWSER_H_ |
| OLD | NEW |