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/ui/browser.cc

Issue 6155003: Changes instant so that the newly created tab has a new id. Doing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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 | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/cocoa/tab_strip_model_observer_bridge.h » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <shellapi.h> 8 #include <shellapi.h>
9 #include <windows.h> 9 #include <windows.h>
10 #endif // OS_WIN 10 #endif // OS_WIN
(...skipping 2654 matching lines...) Expand 10 before | Expand all | Expand 10 after
2665 } 2665 }
2666 2666
2667 void Browser::TabMoved(TabContentsWrapper* contents, 2667 void Browser::TabMoved(TabContentsWrapper* contents,
2668 int from_index, 2668 int from_index,
2669 int to_index) { 2669 int to_index) {
2670 DCHECK(from_index >= 0 && to_index >= 0); 2670 DCHECK(from_index >= 0 && to_index >= 0);
2671 // Notify the history service. 2671 // Notify the history service.
2672 SyncHistoryWithTabs(std::min(from_index, to_index)); 2672 SyncHistoryWithTabs(std::min(from_index, to_index));
2673 } 2673 }
2674 2674
2675 void Browser::TabReplacedAt(TabContentsWrapper* old_contents, 2675 void Browser::TabReplacedAt(TabStripModel* tab_strip_model,
2676 TabContentsWrapper* old_contents,
2676 TabContentsWrapper* new_contents, 2677 TabContentsWrapper* new_contents,
2677 int index) { 2678 int index) {
2678 TabDetachedAtImpl(old_contents, index, DETACH_TYPE_REPLACE); 2679 TabDetachedAtImpl(old_contents, index, DETACH_TYPE_REPLACE);
2679 TabInsertedAt(new_contents, index, 2680 TabInsertedAt(new_contents, index,
2680 (index == tab_handler_->GetTabStripModel()->selected_index())); 2681 (index == tab_handler_->GetTabStripModel()->selected_index()));
2681 2682
2682 int entry_count = new_contents->controller().entry_count(); 2683 int entry_count = new_contents->controller().entry_count();
2683 if (entry_count > 0) { 2684 if (entry_count > 0) {
2684 // Send out notification so that observers are updated appropriately. 2685 // Send out notification so that observers are updated appropriately.
2685 new_contents->controller().NotifyEntryChanged( 2686 new_contents->controller().NotifyEntryChanged(
(...skipping 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after
4235 // The page transition below is only for the purpose of inserting the tab. 4236 // The page transition below is only for the purpose of inserting the tab.
4236 browser->AddTab(view_source_contents, PageTransition::LINK); 4237 browser->AddTab(view_source_contents, PageTransition::LINK);
4237 } 4238 }
4238 4239
4239 if (profile_->HasSessionService()) { 4240 if (profile_->HasSessionService()) {
4240 SessionService* session_service = profile_->GetSessionService(); 4241 SessionService* session_service = profile_->GetSessionService();
4241 if (session_service) 4242 if (session_service)
4242 session_service->TabRestored(&view_source_contents->controller(), false); 4243 session_service->TabRestored(&view_source_contents->controller(), false);
4243 } 4244 }
4244 } 4245 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/cocoa/tab_strip_model_observer_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698