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

Side by Side Diff: third_party/WebKit/Source/core/editing/DOMSelection.cpp

Issue 2593983002: Replace DOMWindowProperty in core/ with ContextClient (Closed)
Patch Set: temp Created 3 years, 11 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) 2007, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 if (!node) 52 if (!node)
53 return 0; 53 return 0;
54 54
55 if (!node->isInShadowTree()) 55 if (!node->isInShadowTree())
56 return 0; 56 return 0;
57 57
58 return frame->document()->ancestorInThisScope(node); 58 return frame->document()->ancestorInThisScope(node);
59 } 59 }
60 60
61 DOMSelection::DOMSelection(const TreeScope* treeScope) 61 DOMSelection::DOMSelection(const TreeScope* treeScope)
62 : DOMWindowProperty(treeScope->rootNode().document().frame()), 62 : ContextClient(treeScope->rootNode().document().frame()),
63 m_treeScope(treeScope) {} 63 m_treeScope(treeScope) {}
64 64
65 void DOMSelection::clearTreeScope() { 65 void DOMSelection::clearTreeScope() {
66 m_treeScope = nullptr; 66 m_treeScope = nullptr;
67 } 67 }
68 68
69 bool DOMSelection::isAvailable() const { 69 bool DOMSelection::isAvailable() const {
70 return frame() && frame()->selection().isAvailable(); 70 return frame() && frame()->selection().isAvailable();
71 } 71 }
72 72
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 } 662 }
663 663
664 void DOMSelection::addConsoleError(const String& message) { 664 void DOMSelection::addConsoleError(const String& message) {
665 if (m_treeScope) 665 if (m_treeScope)
666 m_treeScope->document().addConsoleMessage( 666 m_treeScope->document().addConsoleMessage(
667 ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, message)); 667 ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, message));
668 } 668 }
669 669
670 DEFINE_TRACE(DOMSelection) { 670 DEFINE_TRACE(DOMSelection) {
671 visitor->trace(m_treeScope); 671 visitor->trace(m_treeScope);
672 DOMWindowProperty::trace(visitor); 672 ContextClient::trace(visitor);
673 } 673 }
674 674
675 } // namespace blink 675 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/DOMSelection.h ('k') | third_party/WebKit/Source/core/frame/History.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698