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
3 // found in the LICENSE file.
5 chrome.commands.onCommand.addListener(function(command) {
6 if (command == "toggle-pin") {
7 // Get the currently selected tab
8 chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
9 // Toggle the pinned status
11 chrome.tabs.update(current.id, {'pinned': !current.pinned});