web_prefrences() => dict()

Having property name being the same with class name is making code
harder to understand, and dict is much shorter.
This commit is contained in:
Cheng Zhao 2018-03-08 16:05:12 +09:00
parent d323ce2c42
commit 9772777919
6 changed files with 38 additions and 32 deletions

View file

@ -1125,8 +1125,8 @@ void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) {
WebContentsPreferences* web_preferences =
WebContentsPreferences::FromWebContents(web_contents());
std::string color_name;
if (web_preferences->web_preferences()->GetString(options::kBackgroundColor,
&color_name)) {
if (web_preferences->dict()->GetString(options::kBackgroundColor,
&color_name)) {
view->SetBackgroundColor(ParseHexColor(color_name));
} else {
view->SetBackgroundColor(SK_ColorTRANSPARENT);
@ -1844,7 +1844,7 @@ v8::Local<v8::Value> WebContents::GetWebPreferences(v8::Isolate* isolate) {
WebContentsPreferences::FromWebContents(web_contents());
if (!web_preferences)
return v8::Null(isolate);
return mate::ConvertToV8(isolate, *web_preferences->web_preferences());
return mate::ConvertToV8(isolate, *web_preferences->dict());
}
v8::Local<v8::Value> WebContents::GetLastWebPreferences(v8::Isolate* isolate) {
@ -1852,7 +1852,7 @@ v8::Local<v8::Value> WebContents::GetLastWebPreferences(v8::Isolate* isolate) {
WebContentsPreferences::FromWebContents(web_contents());
if (!web_preferences)
return v8::Null(isolate);
return mate::ConvertToV8(isolate, *web_preferences->last_web_preferences());
return mate::ConvertToV8(isolate, *web_preferences->last_dict());
}
v8::Local<v8::Value> WebContents::GetOwnerBrowserWindow() {