| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "apps/custom_launcher_page_contents.h" | 5 #include "apps/custom_launcher_page_contents.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> |
| 8 | 9 |
| 9 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" | 11 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" |
| 11 #include "content/public/browser/render_view_host.h" | 12 #include "content/public/browser/render_view_host.h" |
| 12 #include "content/public/browser/site_instance.h" | 13 #include "content/public/browser/site_instance.h" |
| 13 #include "content/public/browser/web_contents.h" | 14 #include "content/public/browser/web_contents.h" |
| 14 #include "content/public/common/renderer_preferences.h" | 15 #include "content/public/common/renderer_preferences.h" |
| 15 #include "extensions/browser/app_window/app_delegate.h" | 16 #include "extensions/browser/app_window/app_delegate.h" |
| 16 #include "extensions/browser/app_window/app_web_contents_helper.h" | 17 #include "extensions/browser/app_window/app_web_contents_helper.h" |
| 17 #include "extensions/browser/view_type_utils.h" | 18 #include "extensions/browser/view_type_utils.h" |
| 18 #include "extensions/common/extension_messages.h" | 19 #include "extensions/common/extension_messages.h" |
| 19 | 20 |
| 20 namespace apps { | 21 namespace apps { |
| 21 | 22 |
| 22 CustomLauncherPageContents::CustomLauncherPageContents( | 23 CustomLauncherPageContents::CustomLauncherPageContents( |
| 23 scoped_ptr<extensions::AppDelegate> app_delegate, | 24 scoped_ptr<extensions::AppDelegate> app_delegate, |
| 24 const std::string& extension_id) | 25 const std::string& extension_id) |
| 25 : app_delegate_(app_delegate.Pass()), extension_id_(extension_id) { | 26 : app_delegate_(std::move(app_delegate)), extension_id_(extension_id) {} |
| 26 } | |
| 27 | 27 |
| 28 CustomLauncherPageContents::~CustomLauncherPageContents() { | 28 CustomLauncherPageContents::~CustomLauncherPageContents() { |
| 29 } | 29 } |
| 30 | 30 |
| 31 void CustomLauncherPageContents::Initialize(content::BrowserContext* context, | 31 void CustomLauncherPageContents::Initialize(content::BrowserContext* context, |
| 32 const GURL& url) { | 32 const GURL& url) { |
| 33 web_contents_.reset( | 33 web_contents_.reset( |
| 34 content::WebContents::Create(content::WebContents::CreateParams( | 34 content::WebContents::Create(content::WebContents::CreateParams( |
| 35 context, content::SiteInstance::CreateForURL(context, url)))); | 35 context, content::SiteInstance::CreateForURL(context, url)))); |
| 36 | 36 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 125 |
| 126 bool CustomLauncherPageContents::CheckMediaAccessPermission( | 126 bool CustomLauncherPageContents::CheckMediaAccessPermission( |
| 127 content::WebContents* web_contents, | 127 content::WebContents* web_contents, |
| 128 const GURL& security_origin, | 128 const GURL& security_origin, |
| 129 content::MediaStreamType type) { | 129 content::MediaStreamType type) { |
| 130 DCHECK_EQ(web_contents_.get(), web_contents); | 130 DCHECK_EQ(web_contents_.get(), web_contents); |
| 131 return helper_->CheckMediaAccessPermission(security_origin, type); | 131 return helper_->CheckMediaAccessPermission(security_origin, type); |
| 132 } | 132 } |
| 133 | 133 |
| 134 } // namespace apps | 134 } // namespace apps |
| OLD | NEW |