diff options
author | mnaganov@chromium.org <mnaganov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-17 11:25:54 +0000 |
---|---|---|
committer | mnaganov@chromium.org <mnaganov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-17 11:25:54 +0000 |
commit | 35df00894d1fd025552dc3e864e8f5f5f1b42666 (patch) | |
tree | d3376ff5f71870bad0519ccf14238bad4022776a | |
parent | dfc59b9d8f6acd8ef770fff06249309ee453d430 (diff) | |
download | chromium_src-35df00894d1fd025552dc3e864e8f5f5f1b42666.zip chromium_src-35df00894d1fd025552dc3e864e8f5f5f1b42666.tar.gz chromium_src-35df00894d1fd025552dc3e864e8f5f5f1b42666.tar.bz2 |
Sort tabs by the last selected time on thr remote debugging landing page.
This puts MRU tabs first, virtually highlighting them.
R=pfeldman@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9022048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117886 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | content/browser/debugger/devtools_http_handler_impl.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/content/browser/debugger/devtools_http_handler_impl.cc b/content/browser/debugger/devtools_http_handler_impl.cc index ab023da..6661e94 100644 --- a/content/browser/debugger/devtools_http_handler_impl.cc +++ b/content/browser/debugger/devtools_http_handler_impl.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -268,9 +268,14 @@ struct PageInfo std::string title; std::string thumbnail_url; std::string favicon_url; + base::TimeTicks last_selected_time; }; typedef std::vector<PageInfo> PageList; +static bool SortPageListByTime(const PageInfo& info1, const PageInfo& info2) { + return info1.last_selected_time > info2.last_selected_time; +} + static PageList GeneratePageList( DevToolsHttpHandlerDelegate* delegate, int connection_id, @@ -301,8 +306,10 @@ static PageList GeneratePageList( page_info.title = UTF16ToUTF8(net::EscapeForHTML(entry->GetTitle())); page_info.thumbnail_url = "/thumb/" + entry->GetURL().spec(); page_info.favicon_url = entry->GetFavicon().url.spec(); + page_info.last_selected_time = web_contents->GetLastSelectedTime(); page_list.push_back(page_info); } + std::sort(page_list.begin(), page_list.end(), SortPageListByTime); return page_list; } |