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

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

Issue 28202: Fix for several application mode focus related issues (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 10 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/browser.cc ('k') | chrome/browser/views/frame/browser_view.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/sessions/session_restore.h" 5 #include "chrome/browser/sessions/session_restore.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/scoped_ptr.h" 9 #include "base/scoped_ptr.h"
10 #include "chrome/browser/browser.h" 10 #include "chrome/browser/browser.h"
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 browser->SelectTabContentsAt(browser->tab_count() - 1, true); 352 browser->SelectTabContentsAt(browser->tab_count() - 1, true);
353 return; 353 return;
354 } 354 }
355 355
356 DCHECK(browser); 356 DCHECK(browser);
357 DCHECK(browser->tab_count()); 357 DCHECK(browser->tab_count());
358 browser->SelectTabContentsAt( 358 browser->SelectTabContentsAt(
359 std::min(initial_tab_count + std::max(0, selected_session_index), 359 std::min(initial_tab_count + std::max(0, selected_session_index),
360 browser->tab_count() - 1), true); 360 browser->tab_count() - 1), true);
361 browser->window()->Show(); 361 browser->window()->Show();
362 // Showing the browser focuses the location bar, let the tab decide where 362 // TODO(jcampan): http://crbug.com/8123 we should not need to set the
363 // it wants the focus to be. 363 // initial focus explicitly.
364 browser->GetSelectedTabContents()->SetInitialFocus(); 364 browser->GetSelectedTabContents()->SetInitialFocus();
365 } 365 }
366 366
367 void AppendURLsToBrowser(Browser* browser, const std::vector<GURL>& urls) { 367 void AppendURLsToBrowser(Browser* browser, const std::vector<GURL>& urls) {
368 for (size_t i = 0; i < urls.size(); ++i) { 368 for (size_t i = 0; i < urls.size(); ++i) {
369 browser->AddTabWithURL(urls[i], GURL(), PageTransition::START_PAGE, 369 browser->AddTabWithURL(urls[i], GURL(), PageTransition::START_PAGE,
370 (i == 0), NULL); 370 (i == 0), NULL);
371 } 371 }
372 } 372 }
373 373
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 Restore(profile, browser, false, clobber_existing_window, 447 Restore(profile, browser, false, clobber_existing_window,
448 always_create_tabbed_browser, urls_to_open); 448 always_create_tabbed_browser, urls_to_open);
449 } 449 }
450 450
451 // static 451 // static
452 void SessionRestore::RestoreSessionSynchronously( 452 void SessionRestore::RestoreSessionSynchronously(
453 Profile* profile, 453 Profile* profile,
454 const std::vector<GURL>& urls_to_open) { 454 const std::vector<GURL>& urls_to_open) {
455 Restore(profile, NULL, true, false, true, urls_to_open); 455 Restore(profile, NULL, true, false, true, urls_to_open);
456 } 456 }
OLDNEW
« no previous file with comments | « chrome/browser/browser.cc ('k') | chrome/browser/views/frame/browser_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698