Index: chrome/browser/extensions/api/tabs/tabs_api.cc |
diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc |
index 9f91fd7307931da384bd1c2146776e1abc69694b..c9dffec1b3bcb0d9b11796cba0bd56902f5a67a7 100644 |
--- a/chrome/browser/extensions/api/tabs/tabs_api.cc |
+++ b/chrome/browser/extensions/api/tabs/tabs_api.cc |
@@ -1098,8 +1098,7 @@ bool TabsCreateFunction::RunImpl() { |
index = std::min(std::max(index, -1), tab_strip->count()); |
- int add_types = active ? TabStripModel::ADD_ACTIVE : |
- TabStripModel::ADD_NONE; |
+ int add_types = active ? TabStripModel::ADD_ACTIVE : TabStripModel::ADD_NONE; |
add_types |= TabStripModel::ADD_FORCE_INDEX; |
if (pinned) |
add_types |= TabStripModel::ADD_PINNED; |
@@ -1116,8 +1115,11 @@ bool TabsCreateFunction::RunImpl() { |
if (opener) |
tab_strip->SetOpenerOfWebContentsAt(new_index, opener); |
- if (active) |
+ if (active) { |
params.target_contents->GetView()->SetInitialFocus(); |
+ params.target_contents->GetDelegate()->ActivateContents( |
+ params.target_contents); |
not at google - send to devlin
2013/02/13 01:28:11
here and below if you activate it does it automati
Matt Perry
2013/02/13 01:38:52
Good call, it does. I've removed the extraneous ca
|
+ } |
// Return data about the newly created tab. |
if (has_callback()) { |
@@ -1306,6 +1308,7 @@ bool TabsUpdateFunction::RunImpl() { |
DCHECK_EQ(contents, tab_strip->GetActiveWebContents()); |
} |
web_contents_->Focus(); |
+ web_contents_->GetDelegate()->ActivateContents(web_contents_); |
} |
if (update_props->HasKey(keys::kHighlightedKey)) { |