OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/app_list/start_page_service.h" | 5 #include "chrome/browser/ui/app_list/start_page_service.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/json/json_string_value_serializer.h" | 11 #include "base/json/json_string_value_serializer.h" |
12 #include "base/memory/singleton.h" | 12 #include "base/memory/singleton.h" |
13 #include "base/metrics/user_metrics.h" | 13 #include "base/metrics/user_metrics.h" |
14 #include "base/prefs/pref_service.h" | 14 #include "base/prefs/pref_service.h" |
15 #include "base/strings/string_piece.h" | 15 #include "base/strings/string_piece.h" |
16 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
17 #include "chrome/browser/chrome_notification_types.h" | 17 #include "chrome/browser/chrome_notification_types.h" |
18 #include "chrome/browser/media/media_stream_infobar_delegate.h" | 18 #include "chrome/browser/media/media_stream_devices_controller.h" |
19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
20 #include "chrome/browser/search/hotword_service.h" | 20 #include "chrome/browser/search/hotword_service.h" |
21 #include "chrome/browser/search/hotword_service_factory.h" | 21 #include "chrome/browser/search/hotword_service_factory.h" |
22 #include "chrome/browser/search_engines/template_url_service_factory.h" | 22 #include "chrome/browser/search_engines/template_url_service_factory.h" |
23 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" | 23 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" |
24 #include "chrome/browser/ui/app_list/speech_auth_helper.h" | 24 #include "chrome/browser/ui/app_list/speech_auth_helper.h" |
25 #include "chrome/browser/ui/app_list/speech_recognizer.h" | 25 #include "chrome/browser/ui/app_list/speech_recognizer.h" |
26 #include "chrome/browser/ui/app_list/start_page_observer.h" | 26 #include "chrome/browser/ui/app_list/start_page_observer.h" |
27 #include "chrome/browser/ui/app_list/start_page_service_factory.h" | 27 #include "chrome/browser/ui/app_list/start_page_service_factory.h" |
28 #include "chrome/browser/ui/browser_navigator.h" | 28 #include "chrome/browser/ui/browser_navigator.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 class StartPageService::StartPageWebContentsDelegate | 149 class StartPageService::StartPageWebContentsDelegate |
150 : public content::WebContentsDelegate { | 150 : public content::WebContentsDelegate { |
151 public: | 151 public: |
152 explicit StartPageWebContentsDelegate(Profile* profile) : profile_(profile) {} | 152 explicit StartPageWebContentsDelegate(Profile* profile) : profile_(profile) {} |
153 ~StartPageWebContentsDelegate() override {} | 153 ~StartPageWebContentsDelegate() override {} |
154 | 154 |
155 void RequestMediaAccessPermission( | 155 void RequestMediaAccessPermission( |
156 content::WebContents* web_contents, | 156 content::WebContents* web_contents, |
157 const content::MediaStreamRequest& request, | 157 const content::MediaStreamRequest& request, |
158 const content::MediaResponseCallback& callback) override { | 158 const content::MediaResponseCallback& callback) override { |
159 if (MediaStreamInfoBarDelegate::Create(web_contents, request, callback)) | 159 MediaStreamDevicesController controller(web_contents, request, callback); |
| 160 if (controller.IsAskingForVideo() || controller.IsAskingForAudio()) |
160 NOTREACHED() << "Media stream not allowed for WebUI"; | 161 NOTREACHED() << "Media stream not allowed for WebUI"; |
161 } | 162 } |
162 | 163 |
163 bool CheckMediaAccessPermission(content::WebContents* web_contents, | 164 bool CheckMediaAccessPermission(content::WebContents* web_contents, |
164 const GURL& security_origin, | 165 const GURL& security_origin, |
165 content::MediaStreamType type) override { | 166 content::MediaStreamType type) override { |
166 return MediaCaptureDevicesDispatcher::GetInstance() | 167 return MediaCaptureDevicesDispatcher::GetInstance() |
167 ->CheckMediaAccessPermission(web_contents, security_origin, type); | 168 ->CheckMediaAccessPermission(web_contents, security_origin, type); |
168 } | 169 } |
169 | 170 |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 | 690 |
690 // Check for a new doodle. | 691 // Check for a new doodle. |
691 content::BrowserThread::PostDelayedTask( | 692 content::BrowserThread::PostDelayedTask( |
692 content::BrowserThread::UI, FROM_HERE, | 693 content::BrowserThread::UI, FROM_HERE, |
693 base::Bind(&StartPageService::FetchDoodleJson, | 694 base::Bind(&StartPageService::FetchDoodleJson, |
694 weak_factory_.GetWeakPtr()), | 695 weak_factory_.GetWeakPtr()), |
695 recheck_delay); | 696 recheck_delay); |
696 } | 697 } |
697 | 698 |
698 } // namespace app_list | 699 } // namespace app_list |
OLD | NEW |