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

Side by Side Diff: sky/engine/core/app/AbstractModule.h

Issue 1223783002: Remove sky/engine/core/app (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « no previous file | sky/engine/core/app/AbstractModule.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef SKY_ENGINE_CORE_APP_ABSTRACTMODULE_H_
6 #define SKY_ENGINE_CORE_APP_ABSTRACTMODULE_H_
7
8 #include "sky/engine/core/dom/ContextLifecycleObserver.h"
9 #include "sky/engine/core/dom/Document.h"
10 #include "sky/engine/core/events/EventTarget.h"
11 #include "sky/engine/wtf/RefCounted.h"
12
13 namespace blink {
14 class Application;
15
16 class LibraryEntry {
17 public:
18 LibraryEntry(PassRefPtr<DartValue> library, TextPosition position)
19 : dart_library_(library), text_position_(position) {}
20
21 DartValue* library() const { return dart_library_.get(); }
22 const TextPosition& position() const { return text_position_; }
23
24 private:
25 RefPtr<DartValue> dart_library_;
26 TextPosition text_position_;
27 };
28
29 class AbstractModule : public RefCounted<AbstractModule>,
30 public EventTargetWithInlineData,
31 public ContextLifecycleObserver {
32 REFCOUNTED_EVENT_TARGET(AbstractModule);
33 public:
34 virtual ~AbstractModule();
35
36 Document* document() const { return document_.get(); }
37 const String& url() const { return url_; }
38
39 virtual bool isApplication() const { return false; }
40
41 String UrlForLibraryAt(TextPosition);
42
43 void AddLibrary(RefPtr<DartValue> library, TextPosition position);
44 const Vector<LibraryEntry>& libraries() const { return libraries_; }
45
46 protected:
47 AbstractModule(ExecutionContext*, PassRefPtr<Document>, const String& url);
48
49 virtual Application* GetApplication() = 0;
50
51 private:
52 ExecutionContext* executionContext() const override;
53
54 RefPtr<Document> document_;
55 String url_;
56 Vector<LibraryEntry> libraries_;
57 };
58
59 } // namespace blink
60
61 #endif // SKY_ENGINE_CORE_APP_ABSTRACTMODULE_H_
OLDNEW
« no previous file with comments | « no previous file | sky/engine/core/app/AbstractModule.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698