OLD | NEW |
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.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 2482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2493 ChildProcessSecurityPolicy* policy = | 2493 ChildProcessSecurityPolicy* policy = |
2494 ChildProcessSecurityPolicy::GetInstance(); | 2494 ChildProcessSecurityPolicy::GetInstance(); |
2495 if (policy->IsPseudoScheme(protocol) || policy->IsDisabledScheme(protocol)) | 2495 if (policy->IsPseudoScheme(protocol) || policy->IsDisabledScheme(protocol)) |
2496 return; | 2496 return; |
2497 | 2497 |
2498 ProtocolHandler handler = | 2498 ProtocolHandler handler = |
2499 ProtocolHandler::CreateProtocolHandler(protocol, url, title); | 2499 ProtocolHandler::CreateProtocolHandler(protocol, url, title); |
2500 | 2500 |
2501 ProtocolHandlerRegistry* registry = | 2501 ProtocolHandlerRegistry* registry = |
2502 tcw->profile()->GetProtocolHandlerRegistry(); | 2502 tcw->profile()->GetProtocolHandlerRegistry(); |
2503 if (!registry->enabled() || registry->HasRegisteredEquivalent(handler) || | |
2504 registry->HasIgnoredEquivalent(handler)) | |
2505 return; | |
2506 | 2503 |
2507 if (!handler.IsEmpty() && | 2504 if (!registry->SilentlyHandleRegisterHandlerRequest(handler)) { |
2508 registry->CanSchemeBeOverridden(handler.protocol())) { | |
2509 // We don't need to show an infobar if we can silently update the handler | |
2510 if (registry->AttemptReplace(handler)) | |
2511 return; | |
2512 UserMetrics::RecordAction( | 2505 UserMetrics::RecordAction( |
2513 UserMetricsAction("RegisterProtocolHandler.InfoBar_Shown")); | 2506 UserMetricsAction("RegisterProtocolHandler.InfoBar_Shown")); |
2514 InfoBarTabHelper* infobar_helper = tcw->infobar_tab_helper(); | 2507 InfoBarTabHelper* infobar_helper = tcw->infobar_tab_helper(); |
2515 infobar_helper->AddInfoBar( | 2508 infobar_helper->AddInfoBar( |
2516 new RegisterProtocolHandlerInfoBarDelegate(infobar_helper, | 2509 new RegisterProtocolHandlerInfoBarDelegate(infobar_helper, |
2517 registry, | 2510 registry, |
2518 handler)); | 2511 handler)); |
2519 } | 2512 } |
2520 } | 2513 } |
2521 | 2514 |
(...skipping 3012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5534 } | 5527 } |
5535 | 5528 |
5536 void Browser::UpdateFullscreenExitBubbleContent() { | 5529 void Browser::UpdateFullscreenExitBubbleContent() { |
5537 GURL url; | 5530 GURL url; |
5538 if (fullscreened_tab_) | 5531 if (fullscreened_tab_) |
5539 url = fullscreened_tab_->tab_contents()->GetURL(); | 5532 url = fullscreened_tab_->tab_contents()->GetURL(); |
5540 | 5533 |
5541 window_->UpdateFullscreenExitBubbleContent( | 5534 window_->UpdateFullscreenExitBubbleContent( |
5542 url, GetFullscreenExitBubbleType()); | 5535 url, GetFullscreenExitBubbleType()); |
5543 } | 5536 } |
OLD | NEW |