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

Side by Side Diff: chrome/renderer/content_settings_observer.cc

Issue 78303005: ContentSettings API should not interact with <webview> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Jochen's remaining comments Created 7 years 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer/content_settings_observer.h" 5 #include "chrome/renderer/content_settings_observer.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/common/chrome_switches.h" 8 #include "chrome/common/chrome_switches.h"
9 #include "chrome/common/render_messages.h" 9 #include "chrome/common/render_messages.h"
10 #include "chrome/common/url_constants.h" 10 #include "chrome/common/url_constants.h"
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 358
359 if (EqualsASCII(origin.protocol(), chrome::kChromeDevToolsScheme)) 359 if (EqualsASCII(origin.protocol(), chrome::kChromeDevToolsScheme))
360 return true; // DevTools UI elements should still work. 360 return true; // DevTools UI elements should still work.
361 361
362 if (EqualsASCII(origin.protocol(), extensions::kExtensionScheme)) 362 if (EqualsASCII(origin.protocol(), extensions::kExtensionScheme))
363 return true; 363 return true;
364 364
365 if (EqualsASCII(origin.protocol(), chrome::kChromeInternalScheme)) 365 if (EqualsASCII(origin.protocol(), chrome::kChromeInternalScheme))
366 return true; 366 return true;
367 367
368 // TODO(creis, fsamuel): Remove this once the concept of swapped out
369 // RenderViews goes away.
370 if (document_url == GURL(content::kSwappedOutURL))
371 return true;
372
368 // If the scheme is file:, an empty file name indicates a directory listing, 373 // If the scheme is file:, an empty file name indicates a directory listing,
369 // which requires JavaScript to function properly. 374 // which requires JavaScript to function properly.
370 if (EqualsASCII(origin.protocol(), chrome::kFileScheme)) { 375 if (EqualsASCII(origin.protocol(), chrome::kFileScheme)) {
371 return document_url.SchemeIs(chrome::kFileScheme) && 376 return document_url.SchemeIs(chrome::kFileScheme) &&
372 document_url.ExtractFileName().empty(); 377 document_url.ExtractFileName().empty();
373 } 378 }
374 379
375 return false; 380 return false;
376 } 381 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698