diff options
author | mnaganov@chromium.org <mnaganov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-13 16:23:19 +0000 |
---|---|---|
committer | mnaganov@chromium.org <mnaganov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-13 16:23:19 +0000 |
commit | 2a0cac15d43c297d397e59b004f035092766392e (patch) | |
tree | 16f47c681892512aa7eadddc50183918625ce828 /chrome | |
parent | 38bce4d8810d1a44881167263f23e18441209c9e (diff) | |
download | chromium_src-2a0cac15d43c297d397e59b004f035092766392e.zip chromium_src-2a0cac15d43c297d397e59b004f035092766392e.tar.gz chromium_src-2a0cac15d43c297d397e59b004f035092766392e.tar.bz2 |
Synchronize page thumbnails before serving remote debugging landing page.
Thumbnails for freshly opened tabs are stored as "temporaries"
in TopSites, thus they are not available via chrome://thumb query.
NTP's "most visited" handler first invokes history synchronization,
which promotes temporary entries into regular ones, making their
thumbnails accessible.
For remote debugging handler, we need to do the same.
BUG=117997
TEST=none
Review URL: https://chromiumcodereview.appspot.com/9695045
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126400 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/debugger/browser_list_tabcontents_provider.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/chrome/browser/debugger/browser_list_tabcontents_provider.cc b/chrome/browser/debugger/browser_list_tabcontents_provider.cc index 0bb8990..ca37cd5 100644 --- a/chrome/browser/debugger/browser_list_tabcontents_provider.cc +++ b/chrome/browser/debugger/browser_list_tabcontents_provider.cc @@ -4,10 +4,12 @@ #include "chrome/browser/debugger/browser_list_tabcontents_provider.h" +#include "chrome/browser/history/top_sites.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" +#include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_source.h" #include "content/public/browser/notification_types.h" @@ -54,6 +56,24 @@ BrowserListTabContentsProvider::GetInspectableTabs() { } std::string BrowserListTabContentsProvider::GetDiscoveryPageHTML() { + std::set<Profile*> profiles; + for (BrowserList::const_iterator it = BrowserList::begin(), + end = BrowserList::end(); it != end; ++it) { + profiles.insert((*it)->GetProfile()); + } + for (std::set<Profile*>::iterator it = profiles.begin(); + it != profiles.end(); ++it) { + history::TopSites* ts = (*it)->GetTopSites(); + if (ts) { + // TopSites updates itself after a delay. Ask TopSites to update itself + // when we're about to show the remote debugging landing page. + content::BrowserThread::PostTask( + content::BrowserThread::UI, + FROM_HERE, + base::Bind(&history::TopSites::SyncWithHistory, + base::Unretained(ts))); + } + } return ResourceBundle::GetSharedInstance().GetRawDataResource( IDR_DEVTOOLS_DISCOVERY_PAGE_HTML).as_string(); } |