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

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

Issue 273048: Allow extensions to pin tabs:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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
===================================================================
--- chrome/browser/extensions/extension_tabs_module.cc (revision 28937)
+++ chrome/browser/extensions/extension_tabs_module.cc (working copy)
@@ -115,6 +115,8 @@
result->SetString(keys::kStatusKey, GetTabStatusText(status));
result->SetBoolean(keys::kSelectedKey,
tab_strip && tab_index == tab_strip->selected_index());
+ result->SetBoolean(keys::kPinnedKey,
+ tab_strip && tab_strip->IsTabPinned(tab_index));
if (status != TAB_LOADING) {
result->SetString(keys::kTitleKey, UTF16ToWide(contents->GetTitle()));
@@ -522,6 +524,13 @@
PageTransition::LINK, selected, index, true, NULL);
index = tab_strip->GetIndexOfTabContents(contents);
+ if (args->HasKey(keys::kPinnedKey)) {
+ bool pinned = false;
+ EXTENSION_FUNCTION_VALIDATE(args->GetBoolean(keys::kPinnedKey,
+ &pinned));
+ tab_strip->SetTabPinned(index, pinned);
Aaron Boodman 2010/10/14 18:04:17 This part of the code has changed since you wrote
+ }
+
// Return data about the newly created tab.
if (has_callback())
result_.reset(ExtensionTabUtil::CreateTabValue(contents, tab_strip, index));
@@ -618,6 +627,14 @@
}
}
+ if (update_props->HasKey(keys::kPinnedKey)) {
+ bool pinned = false;
+ EXTENSION_FUNCTION_VALIDATE(update_props->GetBoolean(
+ keys::kPinnedKey,
+ &pinned));
+ tab_strip->SetTabPinned(tab_index, pinned);
Aaron Boodman 2010/10/14 18:04:17 Same here.
+ }
+
if (has_callback())
result_.reset(ExtensionTabUtil::CreateTabValue(contents, tab_strip,
tab_index));

Powered by Google App Engine
This is Rietveld 408576698