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

Side by Side Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 1407163002: Add feature use counting for window.external.AddSearchProvider (Blink side). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: usecounter Created 5 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 #include "core/editing/iterators/TextIterator.h" 112 #include "core/editing/iterators/TextIterator.h"
113 #include "core/editing/serializers/Serialization.h" 113 #include "core/editing/serializers/Serialization.h"
114 #include "core/editing/spellcheck/SpellChecker.h" 114 #include "core/editing/spellcheck/SpellChecker.h"
115 #include "core/fetch/ResourceFetcher.h" 115 #include "core/fetch/ResourceFetcher.h"
116 #include "core/fetch/SubstituteData.h" 116 #include "core/fetch/SubstituteData.h"
117 #include "core/frame/Console.h" 117 #include "core/frame/Console.h"
118 #include "core/frame/LocalDOMWindow.h" 118 #include "core/frame/LocalDOMWindow.h"
119 #include "core/frame/FrameHost.h" 119 #include "core/frame/FrameHost.h"
120 #include "core/frame/FrameView.h" 120 #include "core/frame/FrameView.h"
121 #include "core/frame/Settings.h" 121 #include "core/frame/Settings.h"
122 #include "core/frame/UseCounter.h"
122 #include "core/html/HTMLAnchorElement.h" 123 #include "core/html/HTMLAnchorElement.h"
123 #include "core/html/HTMLCollection.h" 124 #include "core/html/HTMLCollection.h"
124 #include "core/html/HTMLFormElement.h" 125 #include "core/html/HTMLFormElement.h"
125 #include "core/html/HTMLFrameElementBase.h" 126 #include "core/html/HTMLFrameElementBase.h"
126 #include "core/html/HTMLFrameOwnerElement.h" 127 #include "core/html/HTMLFrameOwnerElement.h"
127 #include "core/html/HTMLHeadElement.h" 128 #include "core/html/HTMLHeadElement.h"
128 #include "core/html/HTMLImageElement.h" 129 #include "core/html/HTMLImageElement.h"
129 #include "core/html/HTMLInputElement.h" 130 #include "core/html/HTMLInputElement.h"
130 #include "core/html/HTMLLinkElement.h" 131 #include "core/html/HTMLLinkElement.h"
131 #include "core/html/PluginDocument.h" 132 #include "core/html/PluginDocument.h"
(...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after
1633 } 1634 }
1634 1635
1635 WebString WebLocalFrameImpl::layerTreeAsText(bool showDebugInfo) const 1636 WebString WebLocalFrameImpl::layerTreeAsText(bool showDebugInfo) const
1636 { 1637 {
1637 if (!frame()) 1638 if (!frame())
1638 return WebString(); 1639 return WebString();
1639 1640
1640 return WebString(frame()->layerTreeAsText(showDebugInfo ? LayerTreeIncludesD ebugInfo : LayerTreeNormal)); 1641 return WebString(frame()->layerTreeAsText(showDebugInfo ? LayerTreeIncludesD ebugInfo : LayerTreeNormal));
1641 } 1642 }
1642 1643
1644 void WebLocalFrameImpl::countFeatureUse(WebFrame::Feature feature)
1645 {
1646 UseCounter::Feature internalFeature = UseCounter::NumberOfFeatures;
1647 switch (feature) {
1648 case ExternalAddSearchProvider:
1649 internalFeature = UseCounter::ExternalAddSearchProvider;
1650 break;
1651 case ExternalIsSearchProviderInstalled:
1652 internalFeature = UseCounter::ExternalIsSearchProviderInstalled;
1653 break;
1654 }
1655 UseCounter::count(frame(), internalFeature);
1656 }
1657
1643 // WebLocalFrameImpl public ---------------------------------------------------- ----- 1658 // WebLocalFrameImpl public ---------------------------------------------------- -----
1644 1659
1645 WebLocalFrame* WebLocalFrame::create(WebTreeScopeType scope, WebFrameClient* cli ent) 1660 WebLocalFrame* WebLocalFrame::create(WebTreeScopeType scope, WebFrameClient* cli ent)
1646 { 1661 {
1647 return WebLocalFrameImpl::create(scope, client); 1662 return WebLocalFrameImpl::create(scope, client);
1648 } 1663 }
1649 1664
1650 WebLocalFrameImpl* WebLocalFrameImpl::create(WebTreeScopeType scope, WebFrameCli ent* client) 1665 WebLocalFrameImpl* WebLocalFrameImpl::create(WebTreeScopeType scope, WebFrameCli ent* client)
1651 { 1666 {
1652 WebLocalFrameImpl* frame = new WebLocalFrameImpl(scope, client); 1667 WebLocalFrameImpl* frame = new WebLocalFrameImpl(scope, client);
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
2198 } 2213 }
2199 2214
2200 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const 2215 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const
2201 { 2216 {
2202 if (!frame()) 2217 if (!frame())
2203 return WebSandboxFlags::None; 2218 return WebSandboxFlags::None;
2204 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( )); 2219 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( ));
2205 } 2220 }
2206 2221
2207 } // namespace blink 2222 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698