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

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

Issue 11232066: Remove GetExtensionEventRouter from Profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rerebase 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 | 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/menu_manager.h" 5 #include "chrome/browser/extensions/menu_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 static void AddURLProperty(DictionaryValue* dictionary, 583 static void AddURLProperty(DictionaryValue* dictionary,
584 const std::string& key, const GURL& url) { 584 const std::string& key, const GURL& url) {
585 if (!url.is_empty()) 585 if (!url.is_empty())
586 dictionary->SetString(key, url.possibly_invalid_spec()); 586 dictionary->SetString(key, url.possibly_invalid_spec());
587 } 587 }
588 588
589 void MenuManager::ExecuteCommand(Profile* profile, 589 void MenuManager::ExecuteCommand(Profile* profile,
590 WebContents* web_contents, 590 WebContents* web_contents,
591 const content::ContextMenuParams& params, 591 const content::ContextMenuParams& params,
592 const MenuItem::Id& menu_item_id) { 592 const MenuItem::Id& menu_item_id) {
593 EventRouter* event_router = profile->GetExtensionEventRouter(); 593 EventRouter* event_router = extensions::ExtensionSystem::Get(profile)->
594 event_router();
594 if (!event_router) 595 if (!event_router)
595 return; 596 return;
596 597
597 MenuItem* item = GetItemById(menu_item_id); 598 MenuItem* item = GetItemById(menu_item_id);
598 if (!item) 599 if (!item)
599 return; 600 return;
600 601
601 // ExtensionService/Extension can be NULL in unit tests :( 602 // ExtensionService/Extension can be NULL in unit tests :(
602 ExtensionService* service = 603 ExtensionService* service =
603 ExtensionSystem::Get(profile_)->extension_service(); 604 ExtensionSystem::Get(profile_)->extension_service();
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 if (uid < other.uid) 843 if (uid < other.uid)
843 return true; 844 return true;
844 if (uid == other.uid) 845 if (uid == other.uid)
845 return string_uid < other.string_uid; 846 return string_uid < other.string_uid;
846 } 847 }
847 } 848 }
848 return false; 849 return false;
849 } 850 }
850 851
851 } // namespace extensions 852 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_messages_apitest.cc ('k') | chrome/browser/extensions/menu_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698