| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 // The browser is shutting down and there are active downloads | 141 // The browser is shutting down and there are active downloads |
| 142 // that would be cancelled. | 142 // that would be cancelled. |
| 143 DOWNLOAD_CLOSE_BROWSER_SHUTDOWN, | 143 DOWNLOAD_CLOSE_BROWSER_SHUTDOWN, |
| 144 | 144 |
| 145 // There are active downloads associated with this incognito profile | 145 // There are active downloads associated with this incognito profile |
| 146 // that would be canceled. | 146 // that would be canceled. |
| 147 DOWNLOAD_CLOSE_LAST_WINDOW_IN_INCOGNITO_PROFILE, | 147 DOWNLOAD_CLOSE_LAST_WINDOW_IN_INCOGNITO_PROFILE, |
| 148 }; | 148 }; |
| 149 | 149 |
| 150 struct CreateParams { | 150 struct CreateParams { |
| 151 static CreateParams CreateForApp(Type type, |
| 152 const std::string& app_name, |
| 153 const gfx::Rect& window_bounds, |
| 154 Profile* profile); |
| 155 |
| 156 static CreateParams CreateForDevTools(Profile* profile); |
| 157 |
| 158 CreateParams(); |
| 151 CreateParams(Type type, Profile* profile); | 159 CreateParams(Type type, Profile* profile); |
| 152 | 160 |
| 153 // The browser type. | 161 // The browser type. |
| 154 Type type; | 162 Type type; |
| 155 | 163 |
| 156 // The associated profile. | 164 // The associated profile. |
| 157 Profile* profile; | 165 Profile* profile; |
| 158 | 166 |
| 159 // The application name that is also the name of the window to the shell. | 167 // The application name that is also the name of the window to the shell. |
| 160 // This name should be set when: | 168 // This name should be set when: |
| (...skipping 22 matching lines...) Expand all Loading... |
| 183 Browser(Type type, Profile* profile); | 191 Browser(Type type, Profile* profile); |
| 184 virtual ~Browser(); | 192 virtual ~Browser(); |
| 185 | 193 |
| 186 // Creates a normal tabbed browser with the specified profile. The Browser's | 194 // Creates a normal tabbed browser with the specified profile. The Browser's |
| 187 // window is created by this function call. | 195 // window is created by this function call. |
| 188 static Browser* Create(Profile* profile); | 196 static Browser* Create(Profile* profile); |
| 189 | 197 |
| 190 // Like Create, but creates a browser of the specified parameters. | 198 // Like Create, but creates a browser of the specified parameters. |
| 191 static Browser* CreateWithParams(const CreateParams& params); | 199 static Browser* CreateWithParams(const CreateParams& params); |
| 192 | 200 |
| 193 // Like Create, but creates a browser of the specified type. | |
| 194 static Browser* CreateForType(Type type, Profile* profile); | |
| 195 | |
| 196 // Like Create, but creates a toolbar-less "app" window for the specified | |
| 197 // app. |app_name| is required and is used to identify the window to the | |
| 198 // shell. If |window_bounds| is set, it is used to determine the bounds of | |
| 199 // the window to open. | |
| 200 static Browser* CreateForApp(Type type, | |
| 201 const std::string& app_name, | |
| 202 const gfx::Rect& window_bounds, | |
| 203 Profile* profile); | |
| 204 | |
| 205 // Like Create, but creates a tabstrip-less and toolbar-less | |
| 206 // DevTools "app" window. | |
| 207 static Browser* CreateForDevTools(Profile* profile); | |
| 208 | |
| 209 // Set overrides for the initial window bounds and maximized state. | 201 // Set overrides for the initial window bounds and maximized state. |
| 210 void set_override_bounds(const gfx::Rect& bounds) { | 202 void set_override_bounds(const gfx::Rect& bounds) { |
| 211 override_bounds_ = bounds; | 203 override_bounds_ = bounds; |
| 212 } | 204 } |
| 213 void set_show_state(ui::WindowShowState show_state) { | 205 void set_show_state(ui::WindowShowState show_state) { |
| 214 show_state_ = show_state; | 206 show_state_ = show_state; |
| 215 } | 207 } |
| 216 // Return true if the initial window bounds have been overridden. | 208 // Return true if the initial window bounds have been overridden. |
| 217 bool bounds_overridden() const { | 209 bool bounds_overridden() const { |
| 218 return !override_bounds_.IsEmpty(); | 210 return !override_bounds_.IsEmpty(); |
| (...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1519 bool window_has_shown_; | 1511 bool window_has_shown_; |
| 1520 | 1512 |
| 1521 // Currently open color chooser. Non-NULL after OpenColorChooser is called and | 1513 // Currently open color chooser. Non-NULL after OpenColorChooser is called and |
| 1522 // before DidEndColorChooser is called. | 1514 // before DidEndColorChooser is called. |
| 1523 scoped_ptr<content::ColorChooser> color_chooser_; | 1515 scoped_ptr<content::ColorChooser> color_chooser_; |
| 1524 | 1516 |
| 1525 DISALLOW_COPY_AND_ASSIGN(Browser); | 1517 DISALLOW_COPY_AND_ASSIGN(Browser); |
| 1526 }; | 1518 }; |
| 1527 | 1519 |
| 1528 #endif // CHROME_BROWSER_UI_BROWSER_H_ | 1520 #endif // CHROME_BROWSER_UI_BROWSER_H_ |
| OLD | NEW |