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

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

Issue 105723002: Add the scheme chrome-distiller:// and hook up data source. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased 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 | Annotate | Revision Log
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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 352
353 if (origin.isUnique()) 353 if (origin.isUnique())
354 return false; // Uninitialized document? 354 return false; // Uninitialized document?
355 355
356 if (EqualsASCII(origin.protocol(), chrome::kChromeUIScheme)) 356 if (EqualsASCII(origin.protocol(), chrome::kChromeUIScheme))
357 return true; // Browser UI elements should still work. 357 return true; // Browser UI elements should still work.
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(), chrome::kDomDistillerScheme))
363 return true; // DOM Distiller viewer elements should still work.
364
362 if (EqualsASCII(origin.protocol(), extensions::kExtensionScheme)) 365 if (EqualsASCII(origin.protocol(), extensions::kExtensionScheme))
363 return true; 366 return true;
364 367
365 if (EqualsASCII(origin.protocol(), chrome::kChromeInternalScheme)) 368 if (EqualsASCII(origin.protocol(), chrome::kChromeInternalScheme))
366 return true; 369 return true;
367 370
368 // TODO(creis, fsamuel): Remove this once the concept of swapped out 371 // TODO(creis, fsamuel): Remove this once the concept of swapped out
369 // RenderViews goes away. 372 // RenderViews goes away.
370 if (document_url == GURL(content::kSwappedOutURL)) 373 if (document_url == GURL(content::kSwappedOutURL))
371 return true; 374 return true;
372 375
373 // If the scheme is file:, an empty file name indicates a directory listing, 376 // If the scheme is file:, an empty file name indicates a directory listing,
374 // which requires JavaScript to function properly. 377 // which requires JavaScript to function properly.
375 if (EqualsASCII(origin.protocol(), chrome::kFileScheme)) { 378 if (EqualsASCII(origin.protocol(), chrome::kFileScheme)) {
376 return document_url.SchemeIs(chrome::kFileScheme) && 379 return document_url.SchemeIs(chrome::kFileScheme) &&
377 document_url.ExtractFileName().empty(); 380 document_url.ExtractFileName().empty();
378 } 381 }
379 382
380 return false; 383 return false;
381 } 384 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698