| 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 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 static void AddURLProperty(base::DictionaryValue* dictionary, | 600 static void AddURLProperty(base::DictionaryValue* dictionary, |
| 601 const std::string& key, const GURL& url) { | 601 const std::string& key, const GURL& url) { |
| 602 if (!url.is_empty()) | 602 if (!url.is_empty()) |
| 603 dictionary->SetString(key, url.possibly_invalid_spec()); | 603 dictionary->SetString(key, url.possibly_invalid_spec()); |
| 604 } | 604 } |
| 605 | 605 |
| 606 void MenuManager::ExecuteCommand(Profile* profile, | 606 void MenuManager::ExecuteCommand(Profile* profile, |
| 607 WebContents* web_contents, | 607 WebContents* web_contents, |
| 608 const content::ContextMenuParams& params, | 608 const content::ContextMenuParams& params, |
| 609 const MenuItem::Id& menu_item_id) { | 609 const MenuItem::Id& menu_item_id) { |
| 610 EventRouter* event_router = extensions::ExtensionSystem::Get(profile)-> | 610 EventRouter* event_router = EventRouter::Get(profile); |
| 611 event_router(); | |
| 612 if (!event_router) | 611 if (!event_router) |
| 613 return; | 612 return; |
| 614 | 613 |
| 615 MenuItem* item = GetItemById(menu_item_id); | 614 MenuItem* item = GetItemById(menu_item_id); |
| 616 if (!item) | 615 if (!item) |
| 617 return; | 616 return; |
| 618 | 617 |
| 619 // ExtensionService/Extension can be NULL in unit tests :( | 618 // ExtensionService/Extension can be NULL in unit tests :( |
| 620 ExtensionService* service = | 619 ExtensionService* service = |
| 621 ExtensionSystem::Get(profile_)->extension_service(); | 620 ExtensionSystem::Get(profile_)->extension_service(); |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 952 if (uid < other.uid) | 951 if (uid < other.uid) |
| 953 return true; | 952 return true; |
| 954 if (uid == other.uid) | 953 if (uid == other.uid) |
| 955 return string_uid < other.string_uid; | 954 return string_uid < other.string_uid; |
| 956 } | 955 } |
| 957 } | 956 } |
| 958 return false; | 957 return false; |
| 959 } | 958 } |
| 960 | 959 |
| 961 } // namespace extensions | 960 } // namespace extensions |
| OLD | NEW |