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

Side by Side Diff: chrome/browser/extensions/extension_tab_util.cc

Issue 987583004: Add audible, muted to Tab, c.t.query, c.t.update, and c.t.onUpdated where relevant (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@patch1
Patch Set: rebase Created 5 years, 5 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 unified diff | Download patch
OLDNEW
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 "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "chrome/browser/extensions/api/tabs/tabs_constants.h" 9 #include "chrome/browser/extensions/api/tabs/tabs_constants.h"
10 #include "chrome/browser/extensions/chrome_extension_function.h" 10 #include "chrome/browser/extensions/chrome_extension_function.h"
11 #include "chrome/browser/extensions/chrome_extension_function_details.h" 11 #include "chrome/browser/extensions/chrome_extension_function_details.h"
12 #include "chrome/browser/extensions/tab_helper.h" 12 #include "chrome/browser/extensions/tab_helper.h"
13 #include "chrome/browser/extensions/window_controller.h" 13 #include "chrome/browser/extensions/window_controller.h"
14 #include "chrome/browser/extensions/window_controller_list.h" 14 #include "chrome/browser/extensions/window_controller_list.h"
15 #include "chrome/browser/profiles/profile.h" 15 #include "chrome/browser/profiles/profile.h"
16 #include "chrome/browser/sessions/session_tab_helper.h" 16 #include "chrome/browser/sessions/session_tab_helper.h"
17 #include "chrome/browser/ui/browser.h" 17 #include "chrome/browser/ui/browser.h"
18 #include "chrome/browser/ui/browser_finder.h" 18 #include "chrome/browser/ui/browser_finder.h"
19 #include "chrome/browser/ui/browser_iterator.h" 19 #include "chrome/browser/ui/browser_iterator.h"
20 #include "chrome/browser/ui/browser_window.h" 20 #include "chrome/browser/ui/browser_window.h"
21 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" 21 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
22 #include "chrome/browser/ui/singleton_tabs.h" 22 #include "chrome/browser/ui/singleton_tabs.h"
23 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" 23 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h"
24 #include "chrome/browser/ui/tabs/tab_strip_model.h" 24 #include "chrome/browser/ui/tabs/tab_strip_model.h"
25 #include "chrome/browser/ui/tabs/tab_utils.h"
25 #include "chrome/common/extensions/api/tabs.h" 26 #include "chrome/common/extensions/api/tabs.h"
26 #include "chrome/common/url_constants.h" 27 #include "chrome/common/url_constants.h"
27 #include "components/url_fixer/url_fixer.h" 28 #include "components/url_fixer/url_fixer.h"
28 #include "content/public/browser/favicon_status.h" 29 #include "content/public/browser/favicon_status.h"
29 #include "content/public/browser/navigation_entry.h" 30 #include "content/public/browser/navigation_entry.h"
30 #include "content/public/browser/web_contents.h" 31 #include "content/public/browser/web_contents.h"
31 #include "extensions/browser/app_window/app_window.h" 32 #include "extensions/browser/app_window/app_window.h"
32 #include "extensions/browser/app_window/app_window_registry.h" 33 #include "extensions/browser/app_window/app_window_registry.h"
33 #include "extensions/common/constants.h" 34 #include "extensions/common/constants.h"
34 #include "extensions/common/error_utils.h" 35 #include "extensions/common/error_utils.h"
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 result->SetInteger(keys::kWindowIdKey, GetWindowIdOfTab(contents)); 380 result->SetInteger(keys::kWindowIdKey, GetWindowIdOfTab(contents));
380 result->SetString(keys::kStatusKey, GetTabStatusText(is_loading)); 381 result->SetString(keys::kStatusKey, GetTabStatusText(is_loading));
381 result->SetBoolean(keys::kActiveKey, 382 result->SetBoolean(keys::kActiveKey,
382 tab_strip && tab_index == tab_strip->active_index()); 383 tab_strip && tab_index == tab_strip->active_index());
383 result->SetBoolean(keys::kSelectedKey, 384 result->SetBoolean(keys::kSelectedKey,
384 tab_strip && tab_index == tab_strip->active_index()); 385 tab_strip && tab_index == tab_strip->active_index());
385 result->SetBoolean(keys::kHighlightedKey, 386 result->SetBoolean(keys::kHighlightedKey,
386 tab_strip && tab_strip->IsTabSelected(tab_index)); 387 tab_strip && tab_strip->IsTabSelected(tab_index));
387 result->SetBoolean(keys::kPinnedKey, 388 result->SetBoolean(keys::kPinnedKey,
388 tab_strip && tab_strip->IsTabPinned(tab_index)); 389 tab_strip && tab_strip->IsTabPinned(tab_index));
390 result->SetBoolean(keys::kAudibleKey,
391 tab_strip && chrome::IsPlayingAudio(contents));
392 result->SetBoolean(keys::kMutedKey,
393 tab_strip && chrome::IsTabAudioMuted(contents));
394 result->SetString(keys::kMutedCauseKey,
395 chrome::GetTabAudioMutedCause(contents));
389 result->SetBoolean(keys::kIncognitoKey, 396 result->SetBoolean(keys::kIncognitoKey,
390 contents->GetBrowserContext()->IsOffTheRecord()); 397 contents->GetBrowserContext()->IsOffTheRecord());
391 result->SetInteger(keys::kWidthKey, 398 result->SetInteger(keys::kWidthKey,
392 contents->GetContainerBounds().size().width()); 399 contents->GetContainerBounds().size().width());
393 result->SetInteger(keys::kHeightKey, 400 result->SetInteger(keys::kHeightKey,
394 contents->GetContainerBounds().size().height()); 401 contents->GetContainerBounds().size().height());
395 402
396 // Privacy-sensitive fields: these should be stripped off by 403 // Privacy-sensitive fields: these should be stripped off by
397 // ScrubTabValueForExtension if the extension should not see them. 404 // ScrubTabValueForExtension if the extension should not see them.
398 result->SetString(keys::kUrlKey, contents->GetURL().spec()); 405 result->SetString(keys::kUrlKey, contents->GetURL().spec());
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 618
612 chrome::NavigateParams params( 619 chrome::NavigateParams params(
613 chrome::GetSingletonTabNavigateParams(browser, url_to_navigate)); 620 chrome::GetSingletonTabNavigateParams(browser, url_to_navigate));
614 params.path_behavior = chrome::NavigateParams::IGNORE_AND_NAVIGATE; 621 params.path_behavior = chrome::NavigateParams::IGNORE_AND_NAVIGATE;
615 params.url = url_to_navigate; 622 params.url = url_to_navigate;
616 chrome::ShowSingletonTabOverwritingNTP(browser, params); 623 chrome::ShowSingletonTabOverwritingNTP(browser, params);
617 return true; 624 return true;
618 } 625 }
619 626
620 } // namespace extensions 627 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs_event_router.cc ('k') | chrome/browser/extensions/extension_tabs_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698