| 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/browser_event_router.h" | 5 #include "chrome/browser/extensions/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 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 } | 468 } |
| 469 } | 469 } |
| 470 | 470 |
| 471 void BrowserEventRouter::TabChangedAt(WebContents* contents, | 471 void BrowserEventRouter::TabChangedAt(WebContents* contents, |
| 472 int index, | 472 int index, |
| 473 TabChangeType change_type) { | 473 TabChangeType change_type) { |
| 474 TabUpdated(contents, false); | 474 TabUpdated(contents, false); |
| 475 } | 475 } |
| 476 | 476 |
| 477 void BrowserEventRouter::TabReplacedAt(TabStripModel* tab_strip_model, | 477 void BrowserEventRouter::TabReplacedAt(TabStripModel* tab_strip_model, |
| 478 TabContents* old_contents, | 478 WebContents* old_contents, |
| 479 TabContents* new_contents, | 479 WebContents* new_contents, |
| 480 int index) { | 480 int index) { |
| 481 TabClosingAt(tab_strip_model, old_contents->web_contents(), index); | 481 TabClosingAt(tab_strip_model, old_contents, index); |
| 482 TabInsertedAt(new_contents->web_contents(), | 482 TabInsertedAt(new_contents, index, tab_strip_model->active_index() == index); |
| 483 index, | |
| 484 tab_strip_model->active_index() == index); | |
| 485 } | 483 } |
| 486 | 484 |
| 487 void BrowserEventRouter::TabPinnedStateChanged(WebContents* contents, | 485 void BrowserEventRouter::TabPinnedStateChanged(WebContents* contents, |
| 488 int index) { | 486 int index) { |
| 489 TabStripModel* tab_strip = NULL; | 487 TabStripModel* tab_strip = NULL; |
| 490 int tab_index; | 488 int tab_index; |
| 491 | 489 |
| 492 if (ExtensionTabUtil::GetTabStripModel(contents, &tab_strip, &tab_index)) { | 490 if (ExtensionTabUtil::GetTabStripModel(contents, &tab_strip, &tab_index)) { |
| 493 DictionaryValue* changed_properties = new DictionaryValue(); | 491 DictionaryValue* changed_properties = new DictionaryValue(); |
| 494 changed_properties->SetBoolean(tab_keys::kPinnedKey, | 492 changed_properties->SetBoolean(tab_keys::kPinnedKey, |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 | 594 |
| 597 DispatchEventToExtension(profile, | 595 DispatchEventToExtension(profile, |
| 598 extension_action.extension_id(), | 596 extension_action.extension_id(), |
| 599 event_name, | 597 event_name, |
| 600 args.Pass(), | 598 args.Pass(), |
| 601 EventRouter::USER_GESTURE_ENABLED); | 599 EventRouter::USER_GESTURE_ENABLED); |
| 602 } | 600 } |
| 603 } | 601 } |
| 604 | 602 |
| 605 } // namespace extensions | 603 } // namespace extensions |
| OLD | NEW |