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

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

Issue 60062: Only create one downloads tab per window. If there is already a Downloads... (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 | 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 1616 matching lines...) Expand 10 before | Expand all | Expand 10 after
1627 disposition = NEW_FOREGROUND_TAB; 1627 disposition = NEW_FOREGROUND_TAB;
1628 1628
1629 b->OpenURL(url, referrer, disposition, transition); 1629 b->OpenURL(url, referrer, disposition, transition);
1630 b->window()->Show(); 1630 b->window()->Show();
1631 return; 1631 return;
1632 } 1632 }
1633 1633
1634 if (profile_->IsOffTheRecord() && disposition == OFF_THE_RECORD) 1634 if (profile_->IsOffTheRecord() && disposition == OFF_THE_RECORD)
1635 disposition = NEW_FOREGROUND_TAB; 1635 disposition = NEW_FOREGROUND_TAB;
1636 1636
1637 if (disposition == NEW_WINDOW) { 1637 if (disposition == SINGLETON_TAB) {
1638 ShowSingleDOMUITab(url);
1639 return;
1640 } else if (disposition == NEW_WINDOW) {
1638 Browser* browser = Browser::Create(profile_); 1641 Browser* browser = Browser::Create(profile_);
1639 new_contents = browser->AddTabWithURL(url, referrer, transition, true, 1642 new_contents = browser->AddTabWithURL(url, referrer, transition, true,
1640 instance); 1643 instance);
1641 browser->window()->Show(); 1644 browser->window()->Show();
1642 } else if ((disposition == CURRENT_TAB) && current_tab) { 1645 } else if ((disposition == CURRENT_TAB) && current_tab) {
1643 tabstrip_model_.TabNavigating(current_tab, transition); 1646 tabstrip_model_.TabNavigating(current_tab, transition);
1644 1647
1645 // TODO(beng): remove all this once there are no TabContents types. 1648 // TODO(beng): remove all this once there are no TabContents types.
1646 // It seems like under some circumstances current_tab can be dust after the 1649 // It seems like under some circumstances current_tab can be dust after the
1647 // call to LoadURL (perhaps related to TabContents type switching), so we 1650 // call to LoadURL (perhaps related to TabContents type switching), so we
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after
2509 2512
2510 // We need to register the window position pref. 2513 // We need to register the window position pref.
2511 std::wstring window_pref(prefs::kBrowserWindowPlacement); 2514 std::wstring window_pref(prefs::kBrowserWindowPlacement);
2512 window_pref.append(L"_"); 2515 window_pref.append(L"_");
2513 window_pref.append(app_name); 2516 window_pref.append(app_name);
2514 PrefService* prefs = g_browser_process->local_state(); 2517 PrefService* prefs = g_browser_process->local_state();
2515 DCHECK(prefs); 2518 DCHECK(prefs);
2516 2519
2517 prefs->RegisterDictionaryPref(window_pref.c_str()); 2520 prefs->RegisterDictionaryPref(window_pref.c_str());
2518 } 2521 }
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