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

Unified Diff: chrome/browser/extensions/extension_tabs_module.cc

Issue 7134035: Make an inserted selected tab selected before calling TabInsertedAt on observers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rename foreground to active, and function style Created 9 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_tabs_module.cc
diff --git a/chrome/browser/extensions/extension_tabs_module.cc b/chrome/browser/extensions/extension_tabs_module.cc
index 44765bafd4468d99a4bf53f5e2ceef195b725176..498e8027e943ebc17de248b27d6c31e77b81bed8 100644
--- a/chrome/browser/extensions/extension_tabs_module.cc
+++ b/chrome/browser/extensions/extension_tabs_module.cc
@@ -78,7 +78,8 @@ Browser* GetBrowserInProfileWithId(Profile* profile,
// |error_message| can optionally be passed in and will be set with an
// appropriate message if the tab cannot be found by id.
-bool GetTabById(int tab_id, Profile* profile,
+bool GetTabById(int tab_id,
+ Profile* profile,
bool include_incognito,
Browser** browser,
TabStripModel** tab_strip,
@@ -164,8 +165,9 @@ ListValue* ExtensionTabUtil::CreateTabList(const Browser* browser) {
return tab_list;
}
-DictionaryValue* ExtensionTabUtil::CreateTabValue(
- const TabContents* contents, TabStripModel* tab_strip, int tab_index) {
+DictionaryValue* ExtensionTabUtil::CreateTabValue(const TabContents* contents,
+ TabStripModel* tab_strip,
+ int tab_index) {
DictionaryValue* result = new DictionaryValue();
result->SetInteger(keys::kIdKey, ExtensionTabUtil::GetTabId(contents));
result->SetInteger(keys::kIndexKey, tab_index);
@@ -192,6 +194,14 @@ DictionaryValue* ExtensionTabUtil::CreateTabValue(
return result;
}
+DictionaryValue* ExtensionTabUtil::CreateTabValueActive(
+ const TabContents* contents,
+ bool active) {
+ DictionaryValue* result = ExtensionTabUtil::CreateTabValue(contents);
+ result->SetBoolean(keys::kSelectedKey, active);
+ return result;
+}
+
// if |populate| is true, each window gets a list property |tabs| which contains
// fully populated tab objects.
DictionaryValue* ExtensionTabUtil::CreateWindowValue(const Browser* browser,
@@ -260,7 +270,8 @@ bool ExtensionTabUtil::GetDefaultTab(Browser* browser,
return false;
}
-bool ExtensionTabUtil::GetTabById(int tab_id, Profile* profile,
+bool ExtensionTabUtil::GetTabById(int tab_id,
+ Profile* profile,
bool include_incognito,
Browser** browser,
TabStripModel** tab_strip,
@@ -620,11 +631,11 @@ bool UpdateWindowFunction::RunImpl() {
if (set_bounds)
browser->window()->SetBounds(bounds);
- bool selected_val = false;
+ bool active_val = false;
if (update_props->HasKey(keys::kFocusedKey)) {
EXTENSION_FUNCTION_VALIDATE(update_props->GetBoolean(
- keys::kFocusedKey, &selected_val));
- if (selected_val)
+ keys::kFocusedKey, &active_val));
+ if (active_val)
browser->window()->Activate();
else
browser->window()->Deactivate();
« no previous file with comments | « chrome/browser/extensions/extension_tabs_module.h ('k') | chrome/test/data/extensions/api_test/tabs/basics/events.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698