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

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

Issue 50003: Should only create one downloads tab per window. Introducing another window disposition (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 9 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 | chrome/browser/download/download_shelf.cc » ('j') | 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-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 "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 1597 matching lines...) Expand 10 before | Expand all | Expand 10 after
1608 disposition = NEW_FOREGROUND_TAB; 1608 disposition = NEW_FOREGROUND_TAB;
1609 1609
1610 b->OpenURL(url, referrer, disposition, transition); 1610 b->OpenURL(url, referrer, disposition, transition);
1611 b->window()->Show(); 1611 b->window()->Show();
1612 return; 1612 return;
1613 } 1613 }
1614 1614
1615 if (profile_->IsOffTheRecord() && disposition == OFF_THE_RECORD) 1615 if (profile_->IsOffTheRecord() && disposition == OFF_THE_RECORD)
1616 disposition = NEW_FOREGROUND_TAB; 1616 disposition = NEW_FOREGROUND_TAB;
1617 1617
1618 if (disposition == NEW_WINDOW) { 1618 if (disposition == SINGLETON_TAB) {
1619 ShowSingleDOMUITab(url);
1620 return;
1621 } else if (disposition == NEW_WINDOW) {
1619 Browser* browser = Browser::Create(profile_); 1622 Browser* browser = Browser::Create(profile_);
1620 new_contents = browser->AddTabWithURL(url, referrer, transition, true, 1623 new_contents = browser->AddTabWithURL(url, referrer, transition, true,
1621 instance); 1624 instance);
1622 browser->window()->Show(); 1625 browser->window()->Show();
1623 } else if ((disposition == CURRENT_TAB) && current_tab) { 1626 } else if ((disposition == CURRENT_TAB) && current_tab) {
1624 tabstrip_model_.TabNavigating(current_tab, transition); 1627 tabstrip_model_.TabNavigating(current_tab, transition);
1625 1628
1626 // TODO(beng): remove all this once there are no TabContents types. 1629 // TODO(beng): remove all this once there are no TabContents types.
1627 // It seems like under some circumstances current_tab can be dust after the 1630 // It seems like under some circumstances current_tab can be dust after the
1628 // call to LoadURL (perhaps related to TabContents type switching), so we 1631 // call to LoadURL (perhaps related to TabContents type switching), so we
(...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after
2496 2499
2497 // We need to register the window position pref. 2500 // We need to register the window position pref.
2498 std::wstring window_pref(prefs::kBrowserWindowPlacement); 2501 std::wstring window_pref(prefs::kBrowserWindowPlacement);
2499 window_pref.append(L"_"); 2502 window_pref.append(L"_");
2500 window_pref.append(app_name); 2503 window_pref.append(app_name);
2501 PrefService* prefs = g_browser_process->local_state(); 2504 PrefService* prefs = g_browser_process->local_state();
2502 DCHECK(prefs); 2505 DCHECK(prefs);
2503 2506
2504 prefs->RegisterDictionaryPref(window_pref.c_str()); 2507 prefs->RegisterDictionaryPref(window_pref.c_str());
2505 } 2508 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/download/download_shelf.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698