OLD | NEW |
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/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 | 372 |
373 void Navigate(NavigateParams* params) { | 373 void Navigate(NavigateParams* params) { |
374 Browser* source_browser = params->browser; | 374 Browser* source_browser = params->browser; |
375 if (source_browser) | 375 if (source_browser) |
376 params->initiating_profile = source_browser->profile(); | 376 params->initiating_profile = source_browser->profile(); |
377 DCHECK(params->initiating_profile); | 377 DCHECK(params->initiating_profile); |
378 | 378 |
379 if (!AdjustNavigateParamsForURL(params)) | 379 if (!AdjustNavigateParamsForURL(params)) |
380 return; | 380 return; |
381 | 381 |
| 382 ExtensionService* service = params->initiating_profile->GetExtensionService(); |
| 383 if (service) |
| 384 service->ShouldBlockUrlInBrowserTab(¶ms->url); |
| 385 |
382 // The browser window may want to adjust the disposition. | 386 // The browser window may want to adjust the disposition. |
383 if (params->disposition == NEW_POPUP && | 387 if (params->disposition == NEW_POPUP && |
384 source_browser && | 388 source_browser && |
385 source_browser->window()) { | 389 source_browser->window()) { |
386 params->disposition = | 390 params->disposition = |
387 source_browser->window()->GetDispositionForPopupBounds( | 391 source_browser->window()->GetDispositionForPopupBounds( |
388 params->window_bounds); | 392 params->window_bounds); |
389 } | 393 } |
390 | 394 |
391 params->browser = GetBrowserForDisposition(params); | 395 params->browser = GetBrowserForDisposition(params); |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 bool reverse_on_redirect = false; | 585 bool reverse_on_redirect = false; |
582 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( | 586 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( |
583 &rewritten_url, browser_context, &reverse_on_redirect); | 587 &rewritten_url, browser_context, &reverse_on_redirect); |
584 | 588 |
585 // Some URLs are mapped to uber subpages. Do not allow them in incognito. | 589 // Some URLs are mapped to uber subpages. Do not allow them in incognito. |
586 return !(rewritten_url.scheme() == chrome::kChromeUIScheme && | 590 return !(rewritten_url.scheme() == chrome::kChromeUIScheme && |
587 rewritten_url.host() == chrome::kChromeUIUberHost); | 591 rewritten_url.host() == chrome::kChromeUIUberHost); |
588 } | 592 } |
589 | 593 |
590 } // namespace chrome | 594 } // namespace chrome |
OLD | NEW |