Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(678)

Side by Side Diff: chrome/browser/extensions/extension_host.cc

Issue 11640007: Make the UI an observer of downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Android clang build Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_host.h ('k') | chrome/browser/prerender/prerender_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698