| Index: chrome/browser/extensions/browser_event_router.cc
|
| diff --git a/chrome/browser/extensions/browser_event_router.cc b/chrome/browser/extensions/browser_event_router.cc
|
| index 7b701f2ef50a5f6a44134a713bc1021fcc6302fb..99965aef355d05ca6424e622dbc9beaacf6d00eb 100644
|
| --- a/chrome/browser/extensions/browser_event_router.cc
|
| +++ b/chrome/browser/extensions/browser_event_router.cc
|
| @@ -28,7 +28,6 @@
|
| #include "content/public/browser/notification_types.h"
|
| #include "content/public/browser/web_contents.h"
|
|
|
| -namespace events = extensions::event_names;
|
| namespace tab_keys = extensions::tabs_constants;
|
| namespace page_actions_keys = extension_page_actions_api_constants;
|
|
|
| @@ -170,7 +169,7 @@ void BrowserEventRouter::TabCreatedAt(WebContents* contents,
|
| bool active) {
|
| Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
|
| scoped_ptr<ListValue> args(new ListValue());
|
| - scoped_ptr<Event> event(new Event(events::kOnTabCreated, args.Pass()));
|
| + scoped_ptr<Event> event(new Event(event_names::kOnTabCreated, args.Pass()));
|
| event->restrict_to_profile = profile;
|
| event->user_gesture = EventRouter::USER_GESTURE_NOT_ENABLED;
|
| event->will_dispatch_callback =
|
| @@ -203,7 +202,7 @@ void BrowserEventRouter::TabInsertedAt(WebContents* contents,
|
| args->Append(object_args);
|
|
|
| Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
|
| - DispatchEvent(profile, events::kOnTabAttached, args.Pass(),
|
| + DispatchEvent(profile, event_names::kOnTabAttached, args.Pass(),
|
| EventRouter::USER_GESTURE_UNKNOWN);
|
| }
|
|
|
| @@ -224,7 +223,7 @@ void BrowserEventRouter::TabDetachedAt(WebContents* contents, int index) {
|
| args->Append(object_args);
|
|
|
| Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
|
| - DispatchEvent(profile, events::kOnTabDetached, args.Pass(),
|
| + DispatchEvent(profile, event_names::kOnTabDetached, args.Pass(),
|
| EventRouter::USER_GESTURE_UNKNOWN);
|
| }
|
|
|
| @@ -244,7 +243,7 @@ void BrowserEventRouter::TabClosingAt(TabStripModel* tab_strip_model,
|
| args->Append(object_args);
|
|
|
| Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
|
| - DispatchEvent(profile, events::kOnTabRemoved, args.Pass(),
|
| + DispatchEvent(profile, event_names::kOnTabRemoved, args.Pass(),
|
| EventRouter::USER_GESTURE_UNKNOWN);
|
|
|
| int removed_count = tab_entries_.erase(tab_id);
|
| @@ -272,15 +271,15 @@ void BrowserEventRouter::ActiveTabChanged(WebContents* old_contents,
|
| Profile::FromBrowserContext(new_contents->GetBrowserContext());
|
| EventRouter::UserGestureState gesture = user_gesture ?
|
| EventRouter::USER_GESTURE_ENABLED : EventRouter::USER_GESTURE_NOT_ENABLED;
|
| - DispatchEvent(profile, events::kOnTabSelectionChanged,
|
| + DispatchEvent(profile, event_names::kOnTabSelectionChanged,
|
| scoped_ptr<ListValue>(args->DeepCopy()), gesture);
|
| - DispatchEvent(profile, events::kOnTabActiveChanged,
|
| + DispatchEvent(profile, event_names::kOnTabActiveChanged,
|
| scoped_ptr<ListValue>(args->DeepCopy()), gesture);
|
|
|
| // The onActivated event takes one argument: {windowId, tabId}.
|
| args->Remove(0, NULL);
|
| object_args->Set(tab_keys::kTabIdKey, Value::CreateIntegerValue(tab_id));
|
| - DispatchEvent(profile, events::kOnTabActivated, args.Pass(), gesture);
|
| + DispatchEvent(profile, event_names::kOnTabActivated, args.Pass(), gesture);
|
| }
|
|
|
| void BrowserEventRouter::TabSelectionChanged(
|
| @@ -310,10 +309,10 @@ void BrowserEventRouter::TabSelectionChanged(
|
|
|
| // The onHighlighted event replaced onHighlightChanged.
|
| Profile* profile = tab_strip_model->profile();
|
| - DispatchEvent(profile, events::kOnTabHighlightChanged,
|
| + DispatchEvent(profile, event_names::kOnTabHighlightChanged,
|
| scoped_ptr<ListValue>(args->DeepCopy()),
|
| EventRouter::USER_GESTURE_UNKNOWN);
|
| - DispatchEvent(profile, events::kOnTabHighlighted, args.Pass(),
|
| + DispatchEvent(profile, event_names::kOnTabHighlighted, args.Pass(),
|
| EventRouter::USER_GESTURE_UNKNOWN);
|
| }
|
|
|
| @@ -333,7 +332,7 @@ void BrowserEventRouter::TabMoved(WebContents* contents,
|
| args->Append(object_args);
|
|
|
| Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
|
| - DispatchEvent(profile, events::kOnTabMoved, args.Pass(),
|
| + DispatchEvent(profile, event_names::kOnTabMoved, args.Pass(),
|
| EventRouter::USER_GESTURE_UNKNOWN);
|
| }
|
|
|
| @@ -435,7 +434,8 @@ void BrowserEventRouter::DispatchTabUpdatedEvent(
|
| // WillDispatchTabUpdatedEvent.
|
| Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
|
|
|
| - scoped_ptr<Event> event(new Event(events::kOnTabUpdated, args_base.Pass()));
|
| + scoped_ptr<Event> event(
|
| + new Event(event_names::kOnTabUpdated, args_base.Pass()));
|
| event->restrict_to_profile = profile;
|
| event->user_gesture = EventRouter::USER_GESTURE_NOT_ENABLED;
|
| event->will_dispatch_callback =
|
| @@ -491,7 +491,7 @@ void BrowserEventRouter::TabReplacedAt(TabStripModel* tab_strip_model,
|
| args->Append(Value::CreateIntegerValue(old_tab_id));
|
|
|
| DispatchEvent(Profile::FromBrowserContext(new_contents->GetBrowserContext()),
|
| - events::kOnTabReplaced,
|
| + event_names::kOnTabReplaced,
|
| args.Pass(),
|
| EventRouter::USER_GESTURE_UNKNOWN);
|
|
|
|
|