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

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

Issue 11226037: Incognito-allowed package apps produce duplicate items in context menu (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: BrowserTest Added Created 8 years, 1 month 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
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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 } 615 }
616 616
617 case content::NOTIFICATION_WEB_CONTENTS_CONNECTED: { 617 case content::NOTIFICATION_WEB_CONTENTS_CONNECTED: {
618 content::WebContents* contents = 618 content::WebContents* contents =
619 content::Source<content::WebContents>(source).ptr(); 619 content::Source<content::WebContents>(source).ptr();
620 UpdateRegisteredRenderView(contents->GetRenderViewHost()); 620 UpdateRegisteredRenderView(contents->GetRenderViewHost());
621 break; 621 break;
622 } 622 }
623 623
624 case chrome::NOTIFICATION_PROFILE_DESTROYED: { 624 case chrome::NOTIFICATION_PROFILE_DESTROYED: {
625 // Remove "incognito" "split" mode context menu items.
626 Profile* profile = content::Source<Profile>(source).ptr();
Yoyo Zhou 2012/10/29 21:26:51 Note that only the incognito profile's ExtensionPr
627 if (profile->IsOffTheRecord()) {
628 ExtensionService* service =
629 extensions::ExtensionSystem::Get(profile)->extension_service();
630 service->menu_manager()->RemoveAllIncognitoContextItems();
631 }
625 // Close background hosts when the last browser is closed so that they 632 // Close background hosts when the last browser is closed so that they
626 // have time to shutdown various objects on different threads. Our 633 // have time to shutdown various objects on different threads. Our
627 // destructor is called too late in the shutdown sequence. 634 // destructor is called too late in the shutdown sequence.
628 CloseBackgroundHosts(); 635 CloseBackgroundHosts();
629 break; 636 break;
630 } 637 }
631 638
632 case content::NOTIFICATION_DEVTOOLS_AGENT_ATTACHED: { 639 case content::NOTIFICATION_DEVTOOLS_AGENT_ATTACHED: {
633 RenderViewHost* render_view_host = 640 RenderViewHost* render_view_host =
634 content::Details<RenderViewHost>(details).ptr(); 641 content::Details<RenderViewHost>(details).ptr();
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 CreateBackgroundHostsForProfileStartup(GetProfile(), 822 CreateBackgroundHostsForProfileStartup(GetProfile(),
816 this, service->extensions()); 823 this, service->extensions());
817 } 824 }
818 break; 825 break;
819 } 826 }
820 default: 827 default:
821 ExtensionProcessManager::Observe(type, source, details); 828 ExtensionProcessManager::Observe(type, source, details);
822 break; 829 break;
823 } 830 }
824 } 831 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_context_menu_browsertest.cc ('k') | chrome/browser/extensions/menu_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698