OLD | NEW |
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_navigator.h" | 5 #include "chrome/browser/ui/browser_navigator.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/browser_list.h" | 8 #include "chrome/browser/browser_list.h" |
9 #include "chrome/browser/browser_url_handler.h" | 9 #include "chrome/browser/browser_url_handler.h" |
10 #include "chrome/browser/browser_window.h" | 10 #include "chrome/browser/browser_window.h" |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 params->target_contents->tab_contents()->WasHidden(); | 412 params->target_contents->tab_contents()->WasHidden(); |
413 } | 413 } |
414 } else { | 414 } else { |
415 // ... otherwise if we're loading in the current tab, the target is the | 415 // ... otherwise if we're loading in the current tab, the target is the |
416 // same as the source. | 416 // same as the source. |
417 params->target_contents = params->source_contents; | 417 params->target_contents = params->source_contents; |
418 DCHECK(params->target_contents); | 418 DCHECK(params->target_contents); |
419 } | 419 } |
420 | 420 |
421 if (user_initiated) { | 421 if (user_initiated) { |
422 RenderViewHostDelegate::BrowserIntegration* integration = | 422 static_cast<RenderViewHostDelegate*>(params->target_contents-> |
423 params->target_contents->tab_contents(); | 423 tab_contents())->OnUserGesture(); |
424 integration->OnUserGesture(); | |
425 } | 424 } |
426 | 425 |
427 // Perform the actual navigation. | 426 // Perform the actual navigation. |
428 GURL url = params->url.is_empty() ? params->browser->GetHomePage() | 427 GURL url = params->url.is_empty() ? params->browser->GetHomePage() |
429 : params->url; | 428 : params->url; |
430 params->target_contents->controller().LoadURL(url, params->referrer, | 429 params->target_contents->controller().LoadURL(url, params->referrer, |
431 params->transition); | 430 params->transition); |
432 } else { | 431 } else { |
433 // |target_contents| was specified non-NULL, and so we assume it has already | 432 // |target_contents| was specified non-NULL, and so we assume it has already |
434 // been navigated appropriately. We need to do nothing more other than | 433 // been navigated appropriately. We need to do nothing more other than |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 params->url, params->referrer, params->transition); | 467 params->url, params->referrer, params->transition); |
469 } | 468 } |
470 | 469 |
471 // If the singleton tab isn't already selected, select it. | 470 // If the singleton tab isn't already selected, select it. |
472 if (params->source_contents != params->target_contents) | 471 if (params->source_contents != params->target_contents) |
473 params->browser->SelectTabContentsAt(singleton_index, user_initiated); | 472 params->browser->SelectTabContentsAt(singleton_index, user_initiated); |
474 } | 473 } |
475 } | 474 } |
476 | 475 |
477 } // namespace browser | 476 } // namespace browser |
OLD | NEW |