OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/extensions/extension_host.h" | 5 #include "chrome/browser/extensions/extension_host.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 // TODO(mpcomplete): is this check really necessary? | 407 // TODO(mpcomplete): is this check really necessary? |
408 if (extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_POPUP || | 408 if (extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_POPUP || |
409 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_DIALOG || | 409 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_DIALOG || |
410 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE || | 410 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE || |
411 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_INFOBAR || | 411 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_INFOBAR || |
412 extension_host_type_ == chrome::VIEW_TYPE_PANEL) { | 412 extension_host_type_ == chrome::VIEW_TYPE_PANEL) { |
413 Close(); | 413 Close(); |
414 } | 414 } |
415 } | 415 } |
416 | 416 |
417 void ExtensionHost::OnStartDownload( | |
418 content::WebContents* source, content::DownloadItem* download) { | |
419 // If |source| is in the context of a Browser, show the DownloadShelf on that | |
420 // Browser. | |
421 if (!view() || !view()->browser()) | |
422 return; | |
423 static_cast<content::WebContentsDelegate*>(view()->browser())-> | |
424 OnStartDownload(source, download); | |
425 } | |
426 | |
427 void ExtensionHost::WebIntentDispatch( | 417 void ExtensionHost::WebIntentDispatch( |
428 content::WebContents* web_contents, | 418 content::WebContents* web_contents, |
429 content::WebIntentsDispatcher* intents_dispatcher) { | 419 content::WebIntentsDispatcher* intents_dispatcher) { |
430 #if !defined(OS_ANDROID) | 420 #if !defined(OS_ANDROID) |
431 scoped_ptr<content::WebIntentsDispatcher> dispatcher(intents_dispatcher); | 421 scoped_ptr<content::WebIntentsDispatcher> dispatcher(intents_dispatcher); |
432 | 422 |
433 Browser* browser = view() ? view()->browser() | 423 Browser* browser = view() ? view()->browser() |
434 : chrome::FindBrowserWithWebContents(web_contents); | 424 : chrome::FindBrowserWithWebContents(web_contents); |
435 | 425 |
436 // For background scripts/pages, there will be no view(). In this case, we | 426 // For background scripts/pages, there will be no view(). In this case, we |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 content::IsAudioMediaType(request->audio_type), | 647 content::IsAudioMediaType(request->audio_type), |
658 content::IsVideoMediaType(request->video_type), | 648 content::IsVideoMediaType(request->video_type), |
659 &devices); | 649 &devices); |
660 | 650 |
661 // For tab capture device, we require the tabCapture permission. | 651 // For tab capture device, we require the tabCapture permission. |
662 RequestMediaAccessPermissionHelper::AuthorizeRequest( | 652 RequestMediaAccessPermissionHelper::AuthorizeRequest( |
663 devices, request, callback, extension(), false); | 653 devices, request, callback, extension(), false); |
664 } | 654 } |
665 | 655 |
666 } // namespace extensions | 656 } // namespace extensions |
OLD | NEW |