Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: chrome/browser/browser.cc

Issue 93058: Browser Crash when opening urls with NEW_BACKGROUND_TAB disposition... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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/browser.h" 5 #include "chrome/browser/browser.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/idle_timer.h" 8 #include "base/idle_timer.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 1644 matching lines...) Expand 10 before | Expand all | Expand 10 after
1655 if (current_tab) { 1655 if (current_tab) {
1656 const WebContents* const web_contents = current_tab->AsWebContents(); 1656 const WebContents* const web_contents = current_tab->AsWebContents();
1657 if (web_contents) { 1657 if (web_contents) {
1658 const GURL& current_url = web_contents->GetURL(); 1658 const GURL& current_url = web_contents->GetURL();
1659 if (SiteInstance::IsSameWebSite(current_url, url)) 1659 if (SiteInstance::IsSameWebSite(current_url, url))
1660 instance = web_contents->GetSiteInstance(); 1660 instance = web_contents->GetSiteInstance();
1661 } 1661 }
1662 } 1662 }
1663 } 1663 }
1664 1664
1665 // If this is an application we can only have one tab so a new tab always 1665 // If this is not a normal window (such as a popup or an application), we can
1666 // goes into a tabbed browser window. 1666 // only have one tab so a new tab always goes into a tabbed browser window.
1667 if (disposition != NEW_WINDOW && type_ & TYPE_APP) { 1667 if (disposition != NEW_WINDOW && type_ != TYPE_NORMAL) {
1668 // If the disposition is OFF_THE_RECORD we don't want to create a new 1668 // If the disposition is OFF_THE_RECORD we don't want to create a new
1669 // browser that will itself create another OTR browser. This will result in 1669 // browser that will itself create another OTR browser. This will result in
1670 // a browser leak (and crash below because no tab is created or selected). 1670 // a browser leak (and crash below because no tab is created or selected).
1671 if (disposition == OFF_THE_RECORD) { 1671 if (disposition == OFF_THE_RECORD) {
1672 OpenURLOffTheRecord(profile_, url); 1672 OpenURLOffTheRecord(profile_, url);
1673 return; 1673 return;
1674 } 1674 }
1675 1675
1676 Browser* b = GetOrCreateTabbedBrowser(); 1676 Browser* b = GetOrCreateTabbedBrowser();
1677 DCHECK(b); 1677 DCHECK(b);
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after
2603 2603
2604 // We need to register the window position pref. 2604 // We need to register the window position pref.
2605 std::wstring window_pref(prefs::kBrowserWindowPlacement); 2605 std::wstring window_pref(prefs::kBrowserWindowPlacement);
2606 window_pref.append(L"_"); 2606 window_pref.append(L"_");
2607 window_pref.append(app_name); 2607 window_pref.append(app_name);
2608 PrefService* prefs = g_browser_process->local_state(); 2608 PrefService* prefs = g_browser_process->local_state();
2609 DCHECK(prefs); 2609 DCHECK(prefs);
2610 2610
2611 prefs->RegisterDictionaryPref(window_pref.c_str()); 2611 prefs->RegisterDictionaryPref(window_pref.c_str());
2612 } 2612 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698