mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
This CL generated by |sed -i '/sky\/engine\/config.h/d'| and a manual sweep to catch some oddballs. TBR=eseidel@chromium.org Review URL: https://codereview.chromium.org/1206763002.
43 lines
1.3 KiB
C++
43 lines
1.3 KiB
C++
// Copyright 2014 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "sky/engine/bindings/builtin_sky.h"
|
|
|
|
#include "sky/engine/bindings/builtin.h"
|
|
#include "sky/engine/core/frame/LocalDOMWindow.h"
|
|
#include "sky/engine/core/script/dom_dart_state.h"
|
|
#include "sky/engine/core/view/View.h"
|
|
#include "sky/engine/tonic/dart_error.h"
|
|
|
|
namespace blink {
|
|
|
|
BuiltinSky::BuiltinSky(DOMDartState* dart_state) {
|
|
Builtin::SetNativeResolver(Builtin::kSkyLibrary);
|
|
library_.Set(dart_state, Builtin::LoadAndCheckLibrary(Builtin::kSkyLibrary));
|
|
}
|
|
|
|
BuiltinSky::~BuiltinSky() {
|
|
}
|
|
|
|
void BuiltinSky::InstallWindow(DOMDartState* dart_state) {
|
|
CHECK(!LogIfError(Dart_SetField(library_.value(),
|
|
ToDart("window"),
|
|
ToDart(dart_state->CurrentWindow()))));
|
|
// TODO(abarth): Retain the document wrapper.
|
|
}
|
|
|
|
void BuiltinSky::InstallView(View* view) {
|
|
CHECK(!LogIfError(
|
|
Dart_SetField(library_.value(), ToDart("view"), ToDart(view))));
|
|
}
|
|
|
|
Dart_Handle BuiltinSky::GetClassByName(const char* class_name) {
|
|
Dart_Handle name_handle = ToDart(class_name);
|
|
Dart_Handle class_handle = Dart_GetType(library_.value(), name_handle, 0, nullptr);
|
|
DCHECK(!Dart_IsError(class_handle)) << class_name;
|
|
return class_handle;
|
|
}
|
|
|
|
} // namespace blink
|