]> khamidou — GitHub mirrors - electron.git/commitdiff
Remove duplicate def of is_guest
authorCheng Zhao <zcbenz@gmail.com>
Fri, 5 Jun 2015 07:18:15 +0000 (15:18 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Fri, 5 Jun 2015 07:18:15 +0000 (15:18 +0800)
atom/browser/api/atom_api_web_contents.cc
atom/browser/api/atom_api_web_contents.h

index bc5aba2f36b618ca8429dd109a5459557363a2ac..e3b86572d9f43a09f691c5f443f0c9319fef1abb 100644 (file)
@@ -384,15 +384,11 @@ void WebContents::RenderViewReady() {
   // WebContents::GetRenderWidgetHostView will return the RWHV of an
   // interstitial page if one is showing at this time. We only want opacity
   // to apply to web pages.
-  if (guest_opaque_) {
-    web_contents()
-        ->GetRenderViewHost()
-        ->GetView()
-        ->SetBackgroundColorToDefault();
-  } else {
-    web_contents()->GetRenderViewHost()->GetView()->SetBackgroundColor(
-        SK_ColorTRANSPARENT);
-  }
+  auto render_view_host_view = web_contents()->GetRenderViewHost()->GetView();
+  if (guest_opaque_)
+    render_view_host_view->SetBackgroundColorToDefault();
+  else
+    render_view_host_view->SetBackgroundColor(SK_ColorTRANSPARENT);
 }
 
 void WebContents::WebContentsDestroyed() {
@@ -669,6 +665,10 @@ void WebContents::SetAllowTransparency(bool allow) {
   }
 }
 
+bool WebContents::IsGuest() const {
+  return is_guest();
+}
+
 void WebContents::HasServiceWorker(
     const base::Callback<void(bool)>& callback) {
   auto context = GetServiceWorkerContext(web_contents());
@@ -740,7 +740,7 @@ mate::ObjectTemplateBuilder WebContents::GetObjectTemplateBuilder(
         .SetMethod("_send", &WebContents::SendIPCMessage)
         .SetMethod("setSize", &WebContents::SetSize)
         .SetMethod("setAllowTransparency", &WebContents::SetAllowTransparency)
-        .SetMethod("isGuest", &WebContents::is_guest)
+        .SetMethod("isGuest", &WebContents::IsGuest)
         .SetMethod("hasServiceWorker", &WebContents::HasServiceWorker)
         .SetMethod("unregisterServiceWorker",
                    &WebContents::UnregisterServiceWorker)
index 42ce299a462152870776f57aefa32c55b0cf820b..278426e735993d9100af9c38b463a5f606017c35 100644 (file)
@@ -108,8 +108,7 @@ class WebContents : public mate::EventEmitter,
   // Sets the transparency of the guest.
   void SetAllowTransparency(bool allow);
 
-  // Returns whether this is a guest view.
-  bool is_guest() const { return guest_instance_id_ != -1; }
+  bool IsGuest() const;
 
   // Returns whether this guest has an associated embedder.
   bool attached() const { return !!embedder_web_contents_; }