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:
parent
d323ce2c42
commit
9772777919
6 changed files with 38 additions and 32 deletions
|
@ -118,11 +118,10 @@ BrowserWindow::BrowserWindow(v8::Isolate* isolate,
|
|||
WebContentsPreferences::FromWebContents(web_contents->web_contents());
|
||||
base::DictionaryValue web_preferences_dict;
|
||||
if (mate::ConvertFromV8(isolate, web_preferences.GetHandle(),
|
||||
&web_preferences_dict)) {
|
||||
existing_preferences->web_preferences()->Clear();
|
||||
&web_preferences_dict)) {
|
||||
existing_preferences->dict()->Clear();
|
||||
existing_preferences->Merge(web_preferences_dict);
|
||||
}
|
||||
|
||||
} else {
|
||||
// Creates the WebContents used by BrowserWindow.
|
||||
web_contents = WebContents::Create(isolate, web_preferences);
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue