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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 // The browser is shutting down and there are active downloads | 149 // The browser is shutting down and there are active downloads |
150 // that would be cancelled. | 150 // that would be cancelled. |
151 DOWNLOAD_CLOSE_BROWSER_SHUTDOWN, | 151 DOWNLOAD_CLOSE_BROWSER_SHUTDOWN, |
152 | 152 |
153 // There are active downloads associated with this incognito profile | 153 // There are active downloads associated with this incognito profile |
154 // that would be canceled. | 154 // that would be canceled. |
155 DOWNLOAD_CLOSE_LAST_WINDOW_IN_INCOGNITO_PROFILE, | 155 DOWNLOAD_CLOSE_LAST_WINDOW_IN_INCOGNITO_PROFILE, |
156 }; | 156 }; |
157 | 157 |
158 struct CreateParams { | 158 struct CreateParams { |
159 explicit CreateParams(Profile* profile); | 159 explicit CreateParams(Profile* profile, bool user_gesture); |
160 CreateParams(Type type, Profile* profile); | 160 CreateParams(Type type, Profile* profile, bool user_gesture); |
161 CreateParams(const CreateParams& other); | 161 CreateParams(const CreateParams& other); |
162 | 162 |
163 static CreateParams CreateForApp(const std::string& app_name, | 163 static CreateParams CreateForApp(const std::string& app_name, |
164 bool trusted_source, | 164 bool trusted_source, |
165 const gfx::Rect& window_bounds, | 165 const gfx::Rect& window_bounds, |
166 Profile* profile); | 166 Profile* profile, |
| 167 bool user_gesture); |
167 | 168 |
168 static CreateParams CreateForDevTools(Profile* profile); | 169 static CreateParams CreateForDevTools(Profile* profile); |
169 | 170 |
170 // The browser type. | 171 // The browser type. |
171 Type type; | 172 Type type; |
172 | 173 |
173 // The associated profile. | 174 // The associated profile. |
174 Profile* profile; | 175 Profile* profile; |
175 | 176 |
176 // Specifies the browser is_trusted_source_ value. | 177 // Specifies the browser is_trusted_source_ value. |
177 bool trusted_source; | 178 bool trusted_source; |
178 | 179 |
179 // The bounds of the window to open. | 180 // The bounds of the window to open. |
180 gfx::Rect initial_bounds; | 181 gfx::Rect initial_bounds; |
181 | 182 |
182 // The workspace the window should open in, if the platform supports it. | 183 // The workspace the window should open in, if the platform supports it. |
183 std::string initial_workspace; | 184 std::string initial_workspace; |
184 | 185 |
185 ui::WindowShowState initial_show_state; | 186 ui::WindowShowState initial_show_state; |
186 | 187 |
187 bool is_session_restore; | 188 bool is_session_restore; |
188 | 189 |
| 190 // Whether this browser was created by a user gesture. We track this |
| 191 // specifically for the multi-user case in chromeos where we can place |
| 192 // windows generated by user gestures differently from ones |
| 193 // programmatically created. |
| 194 bool user_gesture; |
| 195 |
189 // Supply a custom BrowserWindow implementation, to be used instead of the | 196 // Supply a custom BrowserWindow implementation, to be used instead of the |
190 // default. Intended for testing. | 197 // default. Intended for testing. |
191 BrowserWindow* window; | 198 BrowserWindow* window; |
192 | 199 |
193 private: | 200 private: |
194 friend class Browser; | 201 friend class Browser; |
195 | 202 |
196 // The application name that is also the name of the window to the shell. | 203 // The application name that is also the name of the window to the shell. |
197 // Do not set this value directly, use CreateForApp. | 204 // Do not set this value directly, use CreateForApp. |
198 // This name will be set for: | 205 // This name will be set for: |
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1023 // The following factory is used for chrome update coalescing. | 1030 // The following factory is used for chrome update coalescing. |
1024 base::WeakPtrFactory<Browser> chrome_updater_factory_; | 1031 base::WeakPtrFactory<Browser> chrome_updater_factory_; |
1025 | 1032 |
1026 // The following factory is used to close the frame at a later time. | 1033 // The following factory is used to close the frame at a later time. |
1027 base::WeakPtrFactory<Browser> weak_factory_; | 1034 base::WeakPtrFactory<Browser> weak_factory_; |
1028 | 1035 |
1029 DISALLOW_COPY_AND_ASSIGN(Browser); | 1036 DISALLOW_COPY_AND_ASSIGN(Browser); |
1030 }; | 1037 }; |
1031 | 1038 |
1032 #endif // CHROME_BROWSER_UI_BROWSER_H_ | 1039 #endif // CHROME_BROWSER_UI_BROWSER_H_ |
OLD | NEW |