From: Kevin Sawicki Date: Tue, 14 Jun 2016 17:05:25 +0000 (-0700) Subject: :art: X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4e896565387f712fa663a0c036558b0fd4bdec92;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git :art: --- diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 4f168c1cd..82c048d9a 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -191,35 +191,28 @@ template<> struct Converter { static v8::Local ToV8(v8::Isolate* isolate, atom::api::WebContents::Type val) { + using Type = atom::api::WebContents::Type; std::string type = ""; switch (val) { - case atom::api::WebContents::Type::BACKGROUND_PAGE: - type = "backgroundPage"; - break; - case atom::api::WebContents::Type::BROWSER_WINDOW: - type = "window"; - break; - case atom::api::WebContents::Type::REMOTE: - type = "remote"; - break; - case atom::api::WebContents::Type::WEB_VIEW: - type = "webview"; - break; - default: - break; + case Type::BACKGROUND_PAGE: type = "backgroundPage"; break; + case Type::BROWSER_WINDOW: type = "window"; break; + case Type::REMOTE: type = "remote"; break; + case Type::WEB_VIEW: type = "webview"; break; + default: break; } return mate::ConvertToV8(isolate, type); } static bool FromV8(v8::Isolate* isolate, v8::Local val, atom::api::WebContents::Type* out) { + using Type = atom::api::WebContents::Type; std::string type; if (!ConvertFromV8(isolate, val, &type)) return false; if (type == "webview") { - *out = atom::api::WebContents::Type::WEB_VIEW; + *out = Type::WEB_VIEW; } else if (type == "backgroundPage") { - *out = atom::api::WebContents::Type::BACKGROUND_PAGE; + *out = Type::BACKGROUND_PAGE; } else { return false; }