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

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

Issue 2807033: Add support for omnibox.onInputStarted and onInputCancelled. (Closed)
Patch Set: fix Stop Created 10 years, 5 months 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/browser.h" 9 #include "chrome/browser/browser.h"
10 #include "chrome/browser/profile.h" 10 #include "chrome/browser/profile.h"
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 int tab_id, 447 int tab_id,
448 const std::string& url, 448 const std::string& url,
449 int button) { 449 int button) {
450 DispatchOldPageActionEvent(profile, extension_id, page_action_id, tab_id, url, 450 DispatchOldPageActionEvent(profile, extension_id, page_action_id, tab_id, url,
451 button); 451 button);
452 TabContents* tab_contents = NULL; 452 TabContents* tab_contents = NULL;
453 if (!ExtensionTabUtil::GetTabById(tab_id, profile, profile->IsOffTheRecord(), 453 if (!ExtensionTabUtil::GetTabById(tab_id, profile, profile->IsOffTheRecord(),
454 NULL, NULL, &tab_contents, NULL)) { 454 NULL, NULL, &tab_contents, NULL)) {
455 return; 455 return;
456 } 456 }
457 std::string event_name = std::string("pageAction/") + extension_id; 457 std::string event_name = ExtensionMessageService::GetPerExtensionEventName(
458 "pageAction.onClicked", extension_id);
458 DispatchEventWithTab(profile, event_name.c_str(), tab_contents); 459 DispatchEventWithTab(profile, event_name.c_str(), tab_contents);
459 } 460 }
460 461
461 void ExtensionBrowserEventRouter::BrowserActionExecuted( 462 void ExtensionBrowserEventRouter::BrowserActionExecuted(
462 Profile* profile, const std::string& extension_id, Browser* browser) { 463 Profile* profile, const std::string& extension_id, Browser* browser) {
463 TabContents* tab_contents = NULL; 464 TabContents* tab_contents = NULL;
464 int tab_id = 0; 465 int tab_id = 0;
465 if (!ExtensionTabUtil::GetDefaultTab(browser, &tab_contents, &tab_id)) 466 if (!ExtensionTabUtil::GetDefaultTab(browser, &tab_contents, &tab_id))
466 return; 467 return;
467 std::string event_name = std::string("browserAction/") + extension_id; 468 std::string event_name = ExtensionMessageService::GetPerExtensionEventName(
469 "browserAction.onClicked", extension_id);
468 DispatchEventWithTab(profile, event_name.c_str(), tab_contents); 470 DispatchEventWithTab(profile, event_name.c_str(), tab_contents);
469 } 471 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/keyword_provider.cc ('k') | chrome/browser/extensions/extension_message_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698