Moved parseSrcAttribute() into the SrcAttribute object as parse()

Imported from:
3bc15760f9%5E%21/
This commit is contained in:
Cheng Zhao 2014-12-08 21:35:10 -08:00
parent cbafac774e
commit 9fcb6b2cd1
2 changed files with 22 additions and 20 deletions

View file

@ -134,22 +134,6 @@ class WebViewImpl
# changed.
@dispatchEvent webViewEvent
parseSrcAttribute: ->
if not @attributes[webViewConstants.ATTRIBUTE_PARTITION].validPartitionId or
not @attributes[webViewConstants.ATTRIBUTE_SRC].getValue()
return
unless @guestInstanceId?
if @beforeFirstNavigation
@beforeFirstNavigation = false
@createGuest()
return
# Navigate to |this.src|.
httpreferrer = @attributes[webViewConstants.ATTRIBUTE_HTTPREFERRER].getValue()
urlOptions = if httpreferrer then {httpreferrer} else {}
remote.getGuestWebContents(@guestInstanceId).loadUrl @attributes[webViewConstants.ATTRIBUTE_SRC].getValue(), urlOptions
createGuest: ->
return if @pendingGuestCreation
params =
@ -272,7 +256,7 @@ registerWebViewElement = ->
return unless internal
unless internal.elementAttached
internal.elementAttached = true
internal.parseSrcAttribute()
internal.attributes[webViewConstants.ATTRIBUTE_SRC].parse()
# Public-facing API methods.
methods = [