// 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/renderer/web_frame_utils.h" #include "third_party/WebKit/public/platform/WebString.h" #include "third_party/WebKit/public/platform/WebVector.h" #include "third_party/WebKit/public/web/WebDocument.h" #include "third_party/WebKit/public/web/WebElement.h" #include "third_party/WebKit/public/web/WebElementCollection.h" #include "third_party/WebKit/public/web/WebInputElement.h" #include "third_party/WebKit/public/web/WebLocalFrame.h" #include "third_party/WebKit/public/web/WebNode.h" #include "third_party/WebKit/public/web/WebView.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(const WebFrame& web_frame, const WebElement& element) { if (web_frame.isWebLocalFrame()) { WebDocument doc = web_frame.document(); return doc.isHTMLDocument() || doc.isXHTMLDocument(); } // Cannot inspect contents of a remote frame, so we use a heuristic: // Assume that