// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "content/renderer/savable_resources.h" #include #include "base/compiler_specific.h" #include "base/logging.h" #include "base/strings/string_util.h" #include "content/public/common/url_utils.h" #include "content/renderer/render_frame_impl.h" #include "third_party/blink/public/platform/web_string.h" #include "third_party/blink/public/platform/web_vector.h" #include "third_party/blink/public/web/web_document.h" #include "third_party/blink/public/web/web_element.h" #include "third_party/blink/public/web/web_element_collection.h" #include "third_party/blink/public/web/web_input_element.h" #include "third_party/blink/public/web/web_local_frame.h" #include "third_party/blink/public/web/web_node.h" #include "third_party/blink/public/web/web_view.h" using blink::WebDocument; using blink::WebElement; using blink::WebElementCollection; using blink::WebFrame; using blink::WebInputElement; using blink::WebLocalFrame; using blink::WebNode; using blink::WebString; using blink::WebVector; using blink::WebView; namespace content { namespace { // Returns |true| if |web_frame| contains (or should be assumed to contain) // a html document. bool DoesFrameContainHtmlDocument(WebFrame* web_frame, const WebElement& element) { if (web_frame->IsWebLocalFrame()) { WebDocument doc = web_frame->ToWebLocalFrame()->GetDocument(); return doc.IsHTMLDocument() || doc.IsXHTMLDocument(); } // Cannot inspect contents of a remote frame, so we use a heuristic: // Assume that