| 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/extension_browser_event_router.h" | 5 #include "chrome/browser/extensions/extension_browser_event_router.h" |
| 6 | 6 |
| 7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/extensions/api/extension_action/extension_page_actions_
api_constants.h" | 9 #include "chrome/browser/extensions/api/extension_action/extension_page_actions_
api_constants.h" |
| 10 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" | 10 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 const char* event_name = NULL; | 682 const char* event_name = NULL; |
| 683 switch (extension->declared_action_type()) { | 683 switch (extension->declared_action_type()) { |
| 684 case ExtensionAction::TYPE_NONE: | 684 case ExtensionAction::TYPE_NONE: |
| 685 break; | 685 break; |
| 686 case ExtensionAction::TYPE_BROWSER: | 686 case ExtensionAction::TYPE_BROWSER: |
| 687 event_name = "browserAction.onClicked"; | 687 event_name = "browserAction.onClicked"; |
| 688 break; | 688 break; |
| 689 case ExtensionAction::TYPE_PAGE: | 689 case ExtensionAction::TYPE_PAGE: |
| 690 event_name = "pageAction.onClicked"; | 690 event_name = "pageAction.onClicked"; |
| 691 break; | 691 break; |
| 692 case ExtensionAction::TYPE_SCRIPT_BADGE: |
| 693 event_name = "scriptBadge.onClicked"; |
| 694 break; |
| 692 } | 695 } |
| 693 | 696 |
| 694 if (event_name) { | 697 if (event_name) { |
| 695 DispatchEventWithTab(profile, | 698 DispatchEventWithTab(profile, |
| 696 extension_id, | 699 extension_id, |
| 697 event_name, | 700 event_name, |
| 698 tab_contents->web_contents(), | 701 tab_contents->web_contents(), |
| 699 true); | 702 true); |
| 700 } | 703 } |
| 701 } | 704 } |
| OLD | NEW |