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/tab_contents/tab_contents_wrapper.h" | 5 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 ProtocolHandler handler = | 582 ProtocolHandler handler = |
583 ProtocolHandler::CreateProtocolHandler(protocol, url, title); | 583 ProtocolHandler::CreateProtocolHandler(protocol, url, title); |
584 | 584 |
585 ProtocolHandlerRegistry* registry = profile()->GetProtocolHandlerRegistry(); | 585 ProtocolHandlerRegistry* registry = profile()->GetProtocolHandlerRegistry(); |
586 if (!registry->enabled() || registry->IsRegistered(handler) || | 586 if (!registry->enabled() || registry->IsRegistered(handler) || |
587 registry->IsIgnored(handler)) | 587 registry->IsIgnored(handler)) |
588 return; | 588 return; |
589 | 589 |
590 if (!handler.IsEmpty() && | 590 if (!handler.IsEmpty() && |
591 registry->CanSchemeBeOverridden(handler.protocol())) { | 591 registry->CanSchemeBeOverridden(handler.protocol())) { |
592 UserMetrics::RecordAction(UserMetricsAction( | 592 UserMetrics::RecordAction( |
593 "RegisterProtocolHandler.InfoBar_Shown")); | 593 UserMetricsAction("RegisterProtocolHandler.InfoBar_Shown")); |
594 AddInfoBar(new RegisterProtocolHandlerInfoBarDelegate(tab_contents(), | 594 AddInfoBar(new RegisterProtocolHandlerInfoBarDelegate(tab_contents(), |
595 registry, | 595 registry, |
596 handler)); | 596 handler)); |
597 } | 597 } |
598 } | 598 } |
599 | 599 |
600 void TabContentsWrapper::OnRegisterIntentHandler(const string16& action, | 600 void TabContentsWrapper::OnRegisterIntentHandler(const string16& action, |
601 const string16& type, | 601 const string16& type, |
602 const string16& href, | 602 const string16& href, |
603 const string16& title) { | 603 const string16& title) { |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 if (infobars_.empty()) { | 735 if (infobars_.empty()) { |
736 registrar_.Remove(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, | 736 registrar_.Remove(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, |
737 Source<NavigationController>(&tab_contents_->controller())); | 737 Source<NavigationController>(&tab_contents_->controller())); |
738 } | 738 } |
739 } | 739 } |
740 | 740 |
741 void TabContentsWrapper::RemoveAllInfoBars(bool animate) { | 741 void TabContentsWrapper::RemoveAllInfoBars(bool animate) { |
742 while (!infobars_.empty()) | 742 while (!infobars_.empty()) |
743 RemoveInfoBarInternal(GetInfoBarDelegateAt(infobar_count() - 1), animate); | 743 RemoveInfoBarInternal(GetInfoBarDelegateAt(infobar_count() - 1), animate); |
744 } | 744 } |
OLD | NEW |