| 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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 // TODO(mpcomplete): is this check really necessary? | 406 // TODO(mpcomplete): is this check really necessary? |
| 407 if (extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_POPUP || | 407 if (extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_POPUP || |
| 408 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_DIALOG || | 408 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_DIALOG || |
| 409 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE || | 409 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE || |
| 410 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_INFOBAR || | 410 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_INFOBAR || |
| 411 extension_host_type_ == chrome::VIEW_TYPE_PANEL) { | 411 extension_host_type_ == chrome::VIEW_TYPE_PANEL) { |
| 412 Close(); | 412 Close(); |
| 413 } | 413 } |
| 414 } | 414 } |
| 415 | 415 |
| 416 void ExtensionHost::OnStartDownload( | |
| 417 content::WebContents* source, content::DownloadItem* download) { | |
| 418 // If |source| is in the context of a Browser, show the DownloadShelf on that | |
| 419 // Browser. | |
| 420 if (!view() || !view()->browser()) | |
| 421 return; | |
| 422 static_cast<content::WebContentsDelegate*>(view()->browser())-> | |
| 423 OnStartDownload(source, download); | |
| 424 } | |
| 425 | |
| 426 void ExtensionHost::WillRunJavaScriptDialog() { | 416 void ExtensionHost::WillRunJavaScriptDialog() { |
| 427 ExtensionProcessManager* pm = | 417 ExtensionProcessManager* pm = |
| 428 ExtensionSystem::Get(profile_)->process_manager(); | 418 ExtensionSystem::Get(profile_)->process_manager(); |
| 429 if (pm) | 419 if (pm) |
| 430 pm->IncrementLazyKeepaliveCount(extension()); | 420 pm->IncrementLazyKeepaliveCount(extension()); |
| 431 } | 421 } |
| 432 | 422 |
| 433 void ExtensionHost::DidCloseJavaScriptDialog() { | 423 void ExtensionHost::DidCloseJavaScriptDialog() { |
| 434 ExtensionProcessManager* pm = | 424 ExtensionProcessManager* pm = |
| 435 ExtensionSystem::Get(profile_)->process_manager(); | 425 ExtensionSystem::Get(profile_)->process_manager(); |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 content::IsAudioMediaType(request.audio_type), | 624 content::IsAudioMediaType(request.audio_type), |
| 635 content::IsVideoMediaType(request.video_type), | 625 content::IsVideoMediaType(request.video_type), |
| 636 &devices); | 626 &devices); |
| 637 | 627 |
| 638 // For tab capture device, we require the tabCapture permission. | 628 // For tab capture device, we require the tabCapture permission. |
| 639 RequestMediaAccessPermissionHelper::AuthorizeRequest( | 629 RequestMediaAccessPermissionHelper::AuthorizeRequest( |
| 640 devices, request, callback, extension(), false); | 630 devices, request, callback, extension(), false); |
| 641 } | 631 } |
| 642 | 632 |
| 643 } // namespace extensions | 633 } // namespace extensions |
| OLD | NEW |