| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 #endif // OS_WIN | 10 #endif // OS_WIN |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 Browser* Browser::Create(Profile* profile) { | 438 Browser* Browser::Create(Profile* profile) { |
| 439 Browser* browser = new Browser(TYPE_TABBED, profile); | 439 Browser* browser = new Browser(TYPE_TABBED, profile); |
| 440 browser->InitBrowserWindow(); | 440 browser->InitBrowserWindow(); |
| 441 return browser; | 441 return browser; |
| 442 } | 442 } |
| 443 | 443 |
| 444 // static | 444 // static |
| 445 Browser* Browser::CreateWithParams(const CreateParams& params) { | 445 Browser* Browser::CreateWithParams(const CreateParams& params) { |
| 446 Browser* browser = new Browser(params.type, params.profile); | 446 Browser* browser = new Browser(params.type, params.profile); |
| 447 browser->app_name_ = params.app_name; | 447 browser->app_name_ = params.app_name; |
| 448 if (!params.initial_bounds.IsEmpty()) | 448 browser->set_override_bounds(params.initial_bounds); |
| 449 browser->set_override_bounds(params.initial_bounds); | |
| 450 browser->InitBrowserWindow(); | 449 browser->InitBrowserWindow(); |
| 451 return browser; | 450 return browser; |
| 452 } | 451 } |
| 453 | 452 |
| 454 // static | 453 // static |
| 455 Browser* Browser::CreateForType(Type type, Profile* profile) { | 454 Browser* Browser::CreateForType(Type type, Profile* profile) { |
| 456 CreateParams params(type, profile); | 455 CreateParams params(type, profile); |
| 457 return CreateWithParams(params); | 456 return CreateWithParams(params); |
| 458 } | 457 } |
| 459 | 458 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 480 wm_type != ui::WM_KWIN && | 479 wm_type != ui::WM_KWIN && |
| 481 wm_type != ui::WM_METACITY && | 480 wm_type != ui::WM_METACITY && |
| 482 wm_type != ui::WM_MUTTER) { | 481 wm_type != ui::WM_MUTTER) { |
| 483 type = TYPE_POPUP; | 482 type = TYPE_POPUP; |
| 484 } | 483 } |
| 485 } | 484 } |
| 486 #endif // TOOLKIT_GTK | 485 #endif // TOOLKIT_GTK |
| 487 | 486 |
| 488 CreateParams params(type, profile); | 487 CreateParams params(type, profile); |
| 489 params.app_name = app_name; | 488 params.app_name = app_name; |
| 490 if (!window_bounds.IsEmpty()) | 489 params.initial_bounds = window_bounds; |
| 491 params.initial_bounds = window_bounds; | |
| 492 | |
| 493 return CreateWithParams(params); | 490 return CreateWithParams(params); |
| 494 } | 491 } |
| 495 | 492 |
| 496 // static | 493 // static |
| 497 Browser* Browser::CreateForDevTools(Profile* profile) { | 494 Browser* Browser::CreateForDevTools(Profile* profile) { |
| 498 #if defined(OS_CHROMEOS) | 495 #if defined(OS_CHROMEOS) |
| 499 CreateParams params(TYPE_TABBED, profile); | 496 CreateParams params(TYPE_TABBED, profile); |
| 500 #else | 497 #else |
| 501 CreateParams params(TYPE_POPUP, profile); | 498 CreateParams params(TYPE_POPUP, profile); |
| 502 #endif | 499 #endif |
| (...skipping 4769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5272 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); | 5269 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); |
| 5273 } else if (is_type_tabbed()) { | 5270 } else if (is_type_tabbed()) { |
| 5274 GlobalErrorService* service = | 5271 GlobalErrorService* service = |
| 5275 GlobalErrorServiceFactory::GetForProfile(profile()); | 5272 GlobalErrorServiceFactory::GetForProfile(profile()); |
| 5276 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); | 5273 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); |
| 5277 if (error) { | 5274 if (error) { |
| 5278 error->ShowBubbleView(this); | 5275 error->ShowBubbleView(this); |
| 5279 } | 5276 } |
| 5280 } | 5277 } |
| 5281 } | 5278 } |
| OLD | NEW |