OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <string> | 10 #include <string> |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 #include "chrome/browser/extensions/extension_ui_util.h" | 54 #include "chrome/browser/extensions/extension_ui_util.h" |
55 #include "chrome/browser/extensions/extension_util.h" | 55 #include "chrome/browser/extensions/extension_util.h" |
56 #include "chrome/browser/extensions/tab_helper.h" | 56 #include "chrome/browser/extensions/tab_helper.h" |
57 #include "chrome/browser/file_select_helper.h" | 57 #include "chrome/browser/file_select_helper.h" |
58 #include "chrome/browser/first_run/first_run.h" | 58 #include "chrome/browser/first_run/first_run.h" |
59 #include "chrome/browser/infobars/infobar_service.h" | 59 #include "chrome/browser/infobars/infobar_service.h" |
60 #include "chrome/browser/lifetime/application_lifetime.h" | 60 #include "chrome/browser/lifetime/application_lifetime.h" |
61 #include "chrome/browser/lifetime/keep_alive_registry.h" | 61 #include "chrome/browser/lifetime/keep_alive_registry.h" |
62 #include "chrome/browser/lifetime/keep_alive_types.h" | 62 #include "chrome/browser/lifetime/keep_alive_types.h" |
63 #include "chrome/browser/lifetime/scoped_keep_alive.h" | 63 #include "chrome/browser/lifetime/scoped_keep_alive.h" |
| 64 #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" |
64 #include "chrome/browser/memory/tab_manager_web_contents_data.h" | 65 #include "chrome/browser/memory/tab_manager_web_contents_data.h" |
65 #include "chrome/browser/notifications/notification_ui_manager.h" | 66 #include "chrome/browser/notifications/notification_ui_manager.h" |
66 #include "chrome/browser/pepper_broker_infobar_delegate.h" | 67 #include "chrome/browser/pepper_broker_infobar_delegate.h" |
67 #include "chrome/browser/permissions/permission_request_manager.h" | 68 #include "chrome/browser/permissions/permission_request_manager.h" |
68 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 69 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
69 #include "chrome/browser/profiles/profile.h" | 70 #include "chrome/browser/profiles/profile.h" |
70 #include "chrome/browser/profiles/profile_destroyer.h" | 71 #include "chrome/browser/profiles/profile_destroyer.h" |
71 #include "chrome/browser/profiles/profile_metrics.h" | 72 #include "chrome/browser/profiles/profile_metrics.h" |
72 #include "chrome/browser/profiles/profiles_state.h" | 73 #include "chrome/browser/profiles/profiles_state.h" |
73 #include "chrome/browser/repost_form_warning_controller.h" | 74 #include "chrome/browser/repost_form_warning_controller.h" |
(...skipping 1748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1822 const content::MediaResponseCallback& callback) { | 1823 const content::MediaResponseCallback& callback) { |
1823 ::RequestMediaAccessPermission(web_contents, profile_, request, callback); | 1824 ::RequestMediaAccessPermission(web_contents, profile_, request, callback); |
1824 } | 1825 } |
1825 | 1826 |
1826 bool Browser::CheckMediaAccessPermission(content::WebContents* web_contents, | 1827 bool Browser::CheckMediaAccessPermission(content::WebContents* web_contents, |
1827 const GURL& security_origin, | 1828 const GURL& security_origin, |
1828 content::MediaStreamType type) { | 1829 content::MediaStreamType type) { |
1829 return ::CheckMediaAccessPermission(web_contents, security_origin, type); | 1830 return ::CheckMediaAccessPermission(web_contents, security_origin, type); |
1830 } | 1831 } |
1831 | 1832 |
| 1833 std::string Browser::GetDefaultMediaDeviceID(content::WebContents* web_contents, |
| 1834 content::MediaStreamType type) { |
| 1835 Profile* profile = |
| 1836 Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
| 1837 return MediaCaptureDevicesDispatcher::GetInstance() |
| 1838 ->GetDefaultDeviceIDForProfile(profile, type); |
| 1839 } |
| 1840 |
1832 bool Browser::RequestPpapiBrokerPermission( | 1841 bool Browser::RequestPpapiBrokerPermission( |
1833 WebContents* web_contents, | 1842 WebContents* web_contents, |
1834 const GURL& url, | 1843 const GURL& url, |
1835 const base::FilePath& plugin_path, | 1844 const base::FilePath& plugin_path, |
1836 const base::Callback<void(bool)>& callback) { | 1845 const base::Callback<void(bool)>& callback) { |
1837 PepperBrokerInfoBarDelegate::Create(web_contents, url, plugin_path, callback); | 1846 PepperBrokerInfoBarDelegate::Create(web_contents, url, plugin_path, callback); |
1838 return true; | 1847 return true; |
1839 } | 1848 } |
1840 | 1849 |
1841 gfx::Size Browser::GetSizeForNewRenderView(WebContents* web_contents) const { | 1850 gfx::Size Browser::GetSizeForNewRenderView(WebContents* web_contents) const { |
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2585 // new window later, thus we need to navigate the window now. | 2594 // new window later, thus we need to navigate the window now. |
2586 if (contents) { | 2595 if (contents) { |
2587 contents->web_contents()->GetController().LoadURL( | 2596 contents->web_contents()->GetController().LoadURL( |
2588 target_url, content::Referrer(), ui::PAGE_TRANSITION_LINK, | 2597 target_url, content::Referrer(), ui::PAGE_TRANSITION_LINK, |
2589 std::string()); // No extra headers. | 2598 std::string()); // No extra headers. |
2590 } | 2599 } |
2591 } | 2600 } |
2592 | 2601 |
2593 return contents != NULL; | 2602 return contents != NULL; |
2594 } | 2603 } |
OLD | NEW |