| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <windows.h> | 5 #include <windows.h> |
| 6 #include <shellapi.h> | 6 #include <shellapi.h> |
| 7 | 7 |
| 8 #include "chrome/browser/browser.h" | 8 #include "chrome/browser/browser.h" |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1324 tabstrip_model_.AddTabContents(new_contents, index + 1, | 1324 tabstrip_model_.AddTabContents(new_contents, index + 1, |
| 1325 PageTransition::LINK, true); | 1325 PageTransition::LINK, true); |
| 1326 } else { | 1326 } else { |
| 1327 Browser* browser = NULL; | 1327 Browser* browser = NULL; |
| 1328 if (type_ == TYPE_APP) { | 1328 if (type_ == TYPE_APP) { |
| 1329 browser = Browser::CreateForApp(app_name_, profile_); | 1329 browser = Browser::CreateForApp(app_name_, profile_); |
| 1330 } else if (type_ == TYPE_POPUP) { | 1330 } else if (type_ == TYPE_POPUP) { |
| 1331 browser = Browser::CreateForPopup(profile_); | 1331 browser = Browser::CreateForPopup(profile_); |
| 1332 } | 1332 } |
| 1333 | 1333 |
| 1334 // Preserve the size of the original window. The new window has already |
| 1335 // been given an offset by the OS, so we shouldn't copy the old bounds. |
| 1336 BrowserWindow* new_window = browser->window(); |
| 1337 new_window->SetBounds(gfx::Rect(new_window->GetNormalBounds().origin(), |
| 1338 window()->GetNormalBounds().size())); |
| 1339 |
| 1334 // We need to show the browser now. Otherwise ContainerWin assumes the | 1340 // We need to show the browser now. Otherwise ContainerWin assumes the |
| 1335 // TabContents is invisible and won't size it. | 1341 // TabContents is invisible and won't size it. |
| 1336 browser->window()->Show(); | 1342 browser->window()->Show(); |
| 1337 | 1343 |
| 1338 // The page transition below is only for the purpose of inserting the tab. | 1344 // The page transition below is only for the purpose of inserting the tab. |
| 1339 new_contents = browser->AddTabWithNavigationController( | 1345 new_contents = browser->AddTabWithNavigationController( |
| 1340 contents->controller()->Clone(), | 1346 contents->controller()->Clone(), |
| 1341 PageTransition::LINK); | 1347 PageTransition::LINK); |
| 1342 } | 1348 } |
| 1343 | 1349 |
| (...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2399 | 2405 |
| 2400 // We need to register the window position pref. | 2406 // We need to register the window position pref. |
| 2401 std::wstring window_pref(prefs::kBrowserWindowPlacement); | 2407 std::wstring window_pref(prefs::kBrowserWindowPlacement); |
| 2402 window_pref.append(L"_"); | 2408 window_pref.append(L"_"); |
| 2403 window_pref.append(app_name); | 2409 window_pref.append(app_name); |
| 2404 PrefService* prefs = g_browser_process->local_state(); | 2410 PrefService* prefs = g_browser_process->local_state(); |
| 2405 DCHECK(prefs); | 2411 DCHECK(prefs); |
| 2406 | 2412 |
| 2407 prefs->RegisterDictionaryPref(window_pref.c_str()); | 2413 prefs->RegisterDictionaryPref(window_pref.c_str()); |
| 2408 } | 2414 } |
| OLD | NEW |