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

Side by Side Diff: third_party/WebKit/Source/core/html/ImageDocument.cpp

Issue 2786673002: Separate ContentSettingsClient out from LocalFrameClient (Closed)
Patch Set: added class-level comment Created 3 years, 8 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) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 12 matching lines...) Expand all
23 */ 23 */
24 24
25 #include "core/html/ImageDocument.h" 25 #include "core/html/ImageDocument.h"
26 26
27 #include <limits> 27 #include <limits>
28 #include "bindings/core/v8/ExceptionState.h" 28 #include "bindings/core/v8/ExceptionState.h"
29 #include "core/HTMLNames.h" 29 #include "core/HTMLNames.h"
30 #include "core/dom/RawDataDocumentParser.h" 30 #include "core/dom/RawDataDocumentParser.h"
31 #include "core/events/EventListener.h" 31 #include "core/events/EventListener.h"
32 #include "core/events/MouseEvent.h" 32 #include "core/events/MouseEvent.h"
33 #include "core/frame/ContentSettingsClient.h"
33 #include "core/frame/FrameView.h" 34 #include "core/frame/FrameView.h"
34 #include "core/frame/LocalDOMWindow.h" 35 #include "core/frame/LocalDOMWindow.h"
35 #include "core/frame/LocalFrame.h" 36 #include "core/frame/LocalFrame.h"
36 #include "core/frame/LocalFrameClient.h" 37 #include "core/frame/LocalFrameClient.h"
37 #include "core/frame/Settings.h" 38 #include "core/frame/Settings.h"
38 #include "core/frame/UseCounter.h" 39 #include "core/frame/UseCounter.h"
39 #include "core/frame/VisualViewport.h" 40 #include "core/frame/VisualViewport.h"
40 #include "core/html/HTMLBodyElement.h" 41 #include "core/html/HTMLBodyElement.h"
41 #include "core/html/HTMLContentElement.h" 42 #include "core/html/HTMLContentElement.h"
42 #include "core/html/HTMLDivElement.h" 43 #include "core/html/HTMLDivElement.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 LayoutObject::shouldRespectImageOrientation(element->layoutObject()), 136 LayoutObject::shouldRespectImageOrientation(element->layoutObject()),
136 1.0f); 137 1.0f);
137 } 138 }
138 139
139 void ImageDocumentParser::appendBytes(const char* data, size_t length) { 140 void ImageDocumentParser::appendBytes(const char* data, size_t length) {
140 if (!length) 141 if (!length)
141 return; 142 return;
142 143
143 LocalFrame* frame = document()->frame(); 144 LocalFrame* frame = document()->frame();
144 Settings* settings = frame->settings(); 145 Settings* settings = frame->settings();
145 if (!frame->loader().client()->allowImage( 146 if (!frame->contentSettingsClient()->allowImage(
146 !settings || settings->getImagesEnabled(), document()->url())) 147 !settings || settings->getImagesEnabled(), document()->url()))
147 return; 148 return;
148 149
149 if (document()->cachedImageResourceDeprecated()) { 150 if (document()->cachedImageResourceDeprecated()) {
150 CHECK_LE(length, std::numeric_limits<unsigned>::max()); 151 CHECK_LE(length, std::numeric_limits<unsigned>::max());
151 // If decoding has already failed, there's no point in sending additional 152 // If decoding has already failed, there's no point in sending additional
152 // data to the ImageResource. 153 // data to the ImageResource.
153 if (document()->cachedImageResourceDeprecated()->getStatus() != 154 if (document()->cachedImageResourceDeprecated()->getStatus() !=
154 ResourceStatus::DecodeError) 155 ResourceStatus::DecodeError)
155 document()->cachedImageResourceDeprecated()->appendData(data, length); 156 document()->cachedImageResourceDeprecated()->appendData(data, length);
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 } 623 }
623 624
624 bool ImageEventListener::operator==(const EventListener& listener) const { 625 bool ImageEventListener::operator==(const EventListener& listener) const {
625 if (const ImageEventListener* imageEventListener = 626 if (const ImageEventListener* imageEventListener =
626 ImageEventListener::cast(&listener)) 627 ImageEventListener::cast(&listener))
627 return m_doc == imageEventListener->m_doc; 628 return m_doc == imageEventListener->m_doc;
628 return false; 629 return false;
629 } 630 }
630 631
631 } // namespace blink 632 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLMediaElement.cpp ('k') | third_party/WebKit/Source/core/loader/EmptyClients.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698