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

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

Issue 2331153002: [Merge to 2840] Fix a bug where inactive windows would inappropriately take focus. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/test/base/web_ui_browser_test.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/macros.h" 10 #include "base/macros.h"
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 // omnibox. 547 // omnibox.
548 if (params->source_contents && 548 if (params->source_contents &&
549 (params->disposition == NEW_FOREGROUND_TAB || 549 (params->disposition == NEW_FOREGROUND_TAB ||
550 params->disposition == NEW_WINDOW) && 550 params->disposition == NEW_WINDOW) &&
551 (params->tabstrip_add_types & TabStripModel::ADD_INHERIT_OPENER)) 551 (params->tabstrip_add_types & TabStripModel::ADD_INHERIT_OPENER))
552 params->source_contents->Focus(); 552 params->source_contents->Focus();
553 553
554 if (params->source_contents == params->target_contents || 554 if (params->source_contents == params->target_contents ||
555 (swapped_in_prerender && params->disposition == CURRENT_TAB)) { 555 (swapped_in_prerender && params->disposition == CURRENT_TAB)) {
556 // The navigation occurred in the source tab. 556 // The navigation occurred in the source tab.
557 params->browser->UpdateUIForNavigationInTab(params->target_contents, 557 params->browser->UpdateUIForNavigationInTab(
558 params->transition, 558 params->target_contents, params->transition, params->window_action,
559 user_initiated); 559 user_initiated);
560 } else if (singleton_index == -1) { 560 } else if (singleton_index == -1) {
561 // If some non-default value is set for the index, we should tell the 561 // If some non-default value is set for the index, we should tell the
562 // TabStripModel to respect it. 562 // TabStripModel to respect it.
563 if (params->tabstrip_index != -1) 563 if (params->tabstrip_index != -1)
564 params->tabstrip_add_types |= TabStripModel::ADD_FORCE_INDEX; 564 params->tabstrip_add_types |= TabStripModel::ADD_FORCE_INDEX;
565 565
566 // The navigation should insert a new tab into the target Browser. 566 // The navigation should insert a new tab into the target Browser.
567 params->browser->tab_strip_model()->AddWebContents( 567 params->browser->tab_strip_model()->AddWebContents(
568 params->target_contents, 568 params->target_contents,
569 params->tabstrip_index, 569 params->tabstrip_index,
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 bool reverse_on_redirect = false; 651 bool reverse_on_redirect = false;
652 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( 652 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary(
653 &rewritten_url, browser_context, &reverse_on_redirect); 653 &rewritten_url, browser_context, &reverse_on_redirect);
654 654
655 // Some URLs are mapped to uber subpages. Do not allow them in incognito. 655 // Some URLs are mapped to uber subpages. Do not allow them in incognito.
656 return !(rewritten_url.scheme() == content::kChromeUIScheme && 656 return !(rewritten_url.scheme() == content::kChromeUIScheme &&
657 rewritten_url.host() == chrome::kChromeUIUberHost); 657 rewritten_url.host() == chrome::kChromeUIUberHost);
658 } 658 }
659 659
660 } // namespace chrome 660 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/test/base/web_ui_browser_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698