Coding style fixes

This commit is contained in:
Cheng Zhao 2018-02-26 15:19:44 +09:00
parent 25f04d5b03
commit ccf30e0934

View file

@ -113,7 +113,7 @@ class FrameSpellChecker : public content::RenderFrameVisitor {
} // namespace
WebFrame::WebFrame(v8::Isolate* isolate)
: web_frame_(blink::WebLocalFrame::FrameForCurrentContext()) {
: web_frame_(blink::WebLocalFrame::FrameForCurrentContext()) {
Init(isolate);
}
@ -424,13 +424,12 @@ v8::Local<v8::Value> WebFrame::NextSibling() const {
return v8::Null(isolate());
}
v8::Local<v8::Value> WebFrame::GetFrameForSelector(const std::string& selector)
const {
blink::WebElement element =
web_frame_->GetDocument()
.QuerySelector(blink::WebString::FromUTF8(selector));
v8::Local<v8::Value> WebFrame::GetFrameForSelector(
const std::string& selector) const {
blink::WebElement element = web_frame_->GetDocument().QuerySelector(
blink::WebString::FromUTF8(selector));
blink::WebLocalFrame* element_frame =
blink::WebLocalFrame::FromFrameOwnerElement(element);
blink::WebLocalFrame::FromFrameOwnerElement(element);
if (element_frame)
return mate::CreateHandle(isolate(),
new WebFrame(isolate(), element_frame)).ToV8();
@ -439,10 +438,8 @@ const {
}
v8::Local<v8::Value> WebFrame::FindFrameByName(const std::string& name) const {
blink::WebLocalFrame* local_frame =
WebFrame::web_frame_
->FindFrameByName(blink::WebString::FromUTF8(name))
->ToWebLocalFrame();
blink::WebLocalFrame* local_frame = web_frame_->FindFrameByName(
blink::WebString::FromUTF8(name))->ToWebLocalFrame();
if (local_frame)
return mate::CreateHandle(isolate(),
new WebFrame(isolate(), local_frame)).ToV8();
@ -490,13 +487,13 @@ void WebFrame::BuildPrototype(
&WebFrame::SetIsolatedWorldHumanReadableName)
.SetMethod("getResourceUsage", &WebFrame::GetResourceUsage)
.SetMethod("clearCache", &WebFrame::ClearCache)
.SetMethod("getFrameForSelector", &WebFrame::GetFrameForSelector)
.SetMethod("findFrameByName", &WebFrame::FindFrameByName)
.SetProperty("opener", &WebFrame::Opener)
.SetProperty("parent", &WebFrame::Parent)
.SetProperty("top", &WebFrame::Top)
.SetProperty("firstChild", &WebFrame::FirstChild)
.SetProperty("nextSibling", &WebFrame::NextSibling)
.SetMethod("getFrameForSelector", &WebFrame::GetFrameForSelector)
.SetMethod("findFrameByName", &WebFrame::FindFrameByName);
.SetProperty("nextSibling", &WebFrame::NextSibling);
}
} // namespace api