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

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

Issue 22944002: Implementation of the "Redirect URLs to Packaged Apps" feature. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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
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/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 void Navigate(NavigateParams* params) { 451 void Navigate(NavigateParams* params) {
452 Browser* source_browser = params->browser; 452 Browser* source_browser = params->browser;
453 if (source_browser) 453 if (source_browser)
454 params->initiating_profile = source_browser->profile(); 454 params->initiating_profile = source_browser->profile();
455 DCHECK(params->initiating_profile); 455 DCHECK(params->initiating_profile);
456 456
457 if (!AdjustNavigateParamsForURL(params)) 457 if (!AdjustNavigateParamsForURL(params))
458 return; 458 return;
459 459
460 ExtensionService* service = params->initiating_profile->GetExtensionService(); 460 ExtensionService* service = params->initiating_profile->GetExtensionService();
461 if (service) 461 if (service) {
462 // TODO(sergeygs): Shouldn't we return from here if this returns true?
462 service->ShouldBlockUrlInBrowserTab(&params->url); 463 service->ShouldBlockUrlInBrowserTab(&params->url);
463 464
465 if (service->MaybeRedirectUrlToApp(params->url, params->referrer.url))
466 return;
467 }
468
464 // The browser window may want to adjust the disposition. 469 // The browser window may want to adjust the disposition.
465 if (params->disposition == NEW_POPUP && 470 if (params->disposition == NEW_POPUP &&
466 source_browser && 471 source_browser &&
467 source_browser->window()) { 472 source_browser->window()) {
468 params->disposition = 473 params->disposition =
469 source_browser->window()->GetDispositionForPopupBounds( 474 source_browser->window()->GetDispositionForPopupBounds(
470 params->window_bounds); 475 params->window_bounds);
471 } 476 }
472 477
473 params->browser = GetBrowserForDisposition(params); 478 params->browser = GetBrowserForDisposition(params);
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 bool reverse_on_redirect = false; 662 bool reverse_on_redirect = false;
658 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( 663 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary(
659 &rewritten_url, browser_context, &reverse_on_redirect); 664 &rewritten_url, browser_context, &reverse_on_redirect);
660 665
661 // Some URLs are mapped to uber subpages. Do not allow them in incognito. 666 // Some URLs are mapped to uber subpages. Do not allow them in incognito.
662 return !(rewritten_url.scheme() == chrome::kChromeUIScheme && 667 return !(rewritten_url.scheme() == chrome::kChromeUIScheme &&
663 rewritten_url.host() == chrome::kChromeUIUberHost); 668 rewritten_url.host() == chrome::kChromeUIUberHost);
664 } 669 }
665 670
666 } // namespace chrome 671 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698