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

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

Issue 10804020: Introduce runtime.onSuspendCanceled() event. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add comments Created 8 years, 5 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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 if (!view() || !view()->browser()) 415 if (!view() || !view()->browser())
416 return; 416 return;
417 static_cast<content::WebContentsDelegate*>(view()->browser())-> 417 static_cast<content::WebContentsDelegate*>(view()->browser())->
418 OnStartDownload(source, download); 418 OnStartDownload(source, download);
419 } 419 }
420 420
421 void ExtensionHost::WillRunJavaScriptDialog() { 421 void ExtensionHost::WillRunJavaScriptDialog() {
422 ExtensionProcessManager* pm = 422 ExtensionProcessManager* pm =
423 ExtensionSystem::Get(profile_)->process_manager(); 423 ExtensionSystem::Get(profile_)->process_manager();
424 if (pm) 424 if (pm)
425 pm->IncrementLazyKeepaliveCount( 425 pm->IncrementLazyKeepaliveCount(extension());
426 extension(), ExtensionProcessManager::DONT_CANCEL_SUSPEND);
427 } 426 }
428 427
429 void ExtensionHost::DidCloseJavaScriptDialog() { 428 void ExtensionHost::DidCloseJavaScriptDialog() {
430 ExtensionProcessManager* pm = 429 ExtensionProcessManager* pm =
431 ExtensionSystem::Get(profile_)->process_manager(); 430 ExtensionSystem::Get(profile_)->process_manager();
432 if (pm) 431 if (pm)
433 pm->DecrementLazyKeepaliveCount(extension()); 432 pm->DecrementLazyKeepaliveCount(extension());
434 } 433 }
435 434
436 WebContents* ExtensionHost::OpenURLFromTab(WebContents* source, 435 WebContents* ExtensionHost::OpenURLFromTab(WebContents* source,
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 void ExtensionHost::OnEventAck() { 504 void ExtensionHost::OnEventAck() {
506 ExtensionEventRouter* router = ExtensionSystem::Get(profile_)->event_router(); 505 ExtensionEventRouter* router = ExtensionSystem::Get(profile_)->event_router();
507 if (router) 506 if (router)
508 router->OnEventAck(profile_, extension_id()); 507 router->OnEventAck(profile_, extension_id());
509 } 508 }
510 509
511 void ExtensionHost::OnIncrementLazyKeepaliveCount() { 510 void ExtensionHost::OnIncrementLazyKeepaliveCount() {
512 ExtensionProcessManager* pm = 511 ExtensionProcessManager* pm =
513 ExtensionSystem::Get(profile_)->process_manager(); 512 ExtensionSystem::Get(profile_)->process_manager();
514 if (pm) 513 if (pm)
515 pm->IncrementLazyKeepaliveCount( 514 pm->IncrementLazyKeepaliveCount(extension());
516 extension(), ExtensionProcessManager::DONT_CANCEL_SUSPEND);
517 } 515 }
518 516
519 void ExtensionHost::OnDecrementLazyKeepaliveCount() { 517 void ExtensionHost::OnDecrementLazyKeepaliveCount() {
520 ExtensionProcessManager* pm = 518 ExtensionProcessManager* pm =
521 ExtensionSystem::Get(profile_)->process_manager(); 519 ExtensionSystem::Get(profile_)->process_manager();
522 if (pm) 520 if (pm)
523 pm->DecrementLazyKeepaliveCount(extension()); 521 pm->DecrementLazyKeepaliveCount(extension());
524 } 522 }
525 523
526 void ExtensionHost::UnhandledKeyboardEvent( 524 void ExtensionHost::UnhandledKeyboardEvent(
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 ExtensionTabUtil::CreateTab(new_contents, extension_id_, disposition, 591 ExtensionTabUtil::CreateTab(new_contents, extension_id_, disposition,
594 initial_pos, user_gesture); 592 initial_pos, user_gesture);
595 } 593 }
596 594
597 void ExtensionHost::RenderViewReady() { 595 void ExtensionHost::RenderViewReady() {
598 content::NotificationService::current()->Notify( 596 content::NotificationService::current()->Notify(
599 chrome::NOTIFICATION_EXTENSION_HOST_CREATED, 597 chrome::NOTIFICATION_EXTENSION_HOST_CREATED,
600 content::Source<Profile>(profile_), 598 content::Source<Profile>(profile_),
601 content::Details<ExtensionHost>(this)); 599 content::Details<ExtensionHost>(this));
602 } 600 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698