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/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 Loading... |
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 Loading... |
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 |
OLD | NEW |