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/extension_tab_util.h" | 5 #include "chrome/browser/extensions/extension_tab_util.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 result->SetString(keys::kStatusKey, GetTabStatusText(is_loading)); | 394 result->SetString(keys::kStatusKey, GetTabStatusText(is_loading)); |
395 result->SetBoolean(keys::kActiveKey, | 395 result->SetBoolean(keys::kActiveKey, |
396 tab_strip && tab_index == tab_strip->active_index()); | 396 tab_strip && tab_index == tab_strip->active_index()); |
397 result->SetBoolean(keys::kSelectedKey, | 397 result->SetBoolean(keys::kSelectedKey, |
398 tab_strip && tab_index == tab_strip->active_index()); | 398 tab_strip && tab_index == tab_strip->active_index()); |
399 result->SetBoolean(keys::kHighlightedKey, | 399 result->SetBoolean(keys::kHighlightedKey, |
400 tab_strip && tab_strip->IsTabSelected(tab_index)); | 400 tab_strip && tab_strip->IsTabSelected(tab_index)); |
401 result->SetBoolean(keys::kPinnedKey, | 401 result->SetBoolean(keys::kPinnedKey, |
402 tab_strip && tab_strip->IsTabPinned(tab_index)); | 402 tab_strip && tab_strip->IsTabPinned(tab_index)); |
403 result->SetBoolean(keys::kAudibleKey, contents->WasRecentlyAudible()); | 403 result->SetBoolean(keys::kAudibleKey, contents->WasRecentlyAudible()); |
404 result->Set(keys::kMutedInfoKey, CreateMutedInfo(contents).Pass()); | 404 result->Set(keys::kMutedInfoKey, CreateMutedInfo(contents)); |
405 result->SetBoolean(keys::kIncognitoKey, | 405 result->SetBoolean(keys::kIncognitoKey, |
406 contents->GetBrowserContext()->IsOffTheRecord()); | 406 contents->GetBrowserContext()->IsOffTheRecord()); |
407 result->SetInteger(keys::kWidthKey, | 407 result->SetInteger(keys::kWidthKey, |
408 contents->GetContainerBounds().size().width()); | 408 contents->GetContainerBounds().size().width()); |
409 result->SetInteger(keys::kHeightKey, | 409 result->SetInteger(keys::kHeightKey, |
410 contents->GetContainerBounds().size().height()); | 410 contents->GetContainerBounds().size().height()); |
411 | 411 |
412 // Privacy-sensitive fields: these should be stripped off by | 412 // Privacy-sensitive fields: these should be stripped off by |
413 // ScrubTabValueForExtension if the extension should not see them. | 413 // ScrubTabValueForExtension if the extension should not see them. |
414 result->SetString(keys::kUrlKey, contents->GetURL().spec()); | 414 result->SetString(keys::kUrlKey, contents->GetURL().spec()); |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 chrome::ShowSingletonTabOverwritingNTP(browser, params); | 676 chrome::ShowSingletonTabOverwritingNTP(browser, params); |
677 return true; | 677 return true; |
678 } | 678 } |
679 | 679 |
680 // static | 680 // static |
681 bool ExtensionTabUtil::BrowserSupportsTabs(Browser* browser) { | 681 bool ExtensionTabUtil::BrowserSupportsTabs(Browser* browser) { |
682 return browser && browser->tab_strip_model() && !browser->is_devtools(); | 682 return browser && browser->tab_strip_model() && !browser->is_devtools(); |
683 } | 683 } |
684 | 684 |
685 } // namespace extensions | 685 } // namespace extensions |
OLD | NEW |