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

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

Issue 7014032: Reload a crashed singleton tab when trying to navigate to it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add a browser test Created 9 years, 7 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/ui/browser_navigator_browsertest.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_navigator.h" 5 #include "chrome/browser/ui/browser_navigator.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "chrome/browser/browser_url_handler.h" 10 #include "chrome/browser/browser_url_handler.h"
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 params->transition, 502 params->transition,
503 params->tabstrip_add_types); 503 params->tabstrip_add_types);
504 // Now that the |params->target_contents| is safely owned by the target 504 // Now that the |params->target_contents| is safely owned by the target
505 // Browser's TabStripModel, we can release ownership. 505 // Browser's TabStripModel, we can release ownership.
506 target_contents_owner.ReleaseOwnership(); 506 target_contents_owner.ReleaseOwnership();
507 } 507 }
508 508
509 if (singleton_index >= 0) { 509 if (singleton_index >= 0) {
510 TabContents* target = params->browser->GetTabContentsAt(singleton_index); 510 TabContents* target = params->browser->GetTabContentsAt(singleton_index);
511 511
512 if (params->path_behavior == NavigateParams::IGNORE_AND_NAVIGATE && 512 if (target->is_crashed()) {
513 target->controller().Reload(true);
514 } else if (params->path_behavior == NavigateParams::IGNORE_AND_NAVIGATE &&
513 target->GetURL() != params->url) { 515 target->GetURL() != params->url) {
514 target->controller().LoadURL( 516 target->controller().LoadURL(
515 params->url, params->referrer, params->transition); 517 params->url, params->referrer, params->transition);
516 } 518 }
517 519
518 // If the singleton tab isn't already selected, select it. 520 // If the singleton tab isn't already selected, select it.
519 if (params->source_contents != params->target_contents) 521 if (params->source_contents != params->target_contents)
520 params->browser->ActivateTabAt(singleton_index, user_initiated); 522 params->browser->ActivateTabAt(singleton_index, user_initiated);
521 } 523 }
522 } 524 }
523 525
524 } // namespace browser 526 } // namespace browser
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/browser_navigator_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698