| 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/devtools/browser_list_tabcontents_provider.h" | 5 #include "chrome/browser/devtools/browser_list_tabcontents_provider.h" |
| 6 | 6 |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "chrome/browser/devtools/devtools_target_impl.h" | 9 #include "chrome/browser/devtools/devtools_target_impl.h" |
| 10 #include "chrome/browser/history/top_sites.h" | 10 #include "chrome/browser/history/top_sites.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 std::string BrowserListTabContentsProvider::GetPageThumbnailData( | 72 std::string BrowserListTabContentsProvider::GetPageThumbnailData( |
| 73 const GURL& url) { | 73 const GURL& url) { |
| 74 for (chrome::BrowserIterator it; !it.done(); it.Next()) { | 74 for (chrome::BrowserIterator it; !it.done(); it.Next()) { |
| 75 Profile* profile = (*it)->profile(); | 75 Profile* profile = (*it)->profile(); |
| 76 history::TopSites* top_sites = profile->GetTopSites(); | 76 history::TopSites* top_sites = profile->GetTopSites(); |
| 77 if (!top_sites) | 77 if (!top_sites) |
| 78 continue; | 78 continue; |
| 79 scoped_refptr<base::RefCountedMemory> data; | 79 scoped_refptr<base::RefCountedMemory> data; |
| 80 if (top_sites->GetPageThumbnail(url, false, &data)) | 80 if (top_sites->GetPageThumbnail(url, false, &data)) |
| 81 return std::string( | 81 return std::string(data->front_as<char>(), data->size()); |
| 82 reinterpret_cast<const char*>(data->front()), data->size()); | |
| 83 } | 82 } |
| 84 | 83 |
| 85 return std::string(); | 84 return std::string(); |
| 86 } | 85 } |
| 87 | 86 |
| 88 scoped_ptr<DevToolsTarget> | 87 scoped_ptr<DevToolsTarget> |
| 89 BrowserListTabContentsProvider::CreateNewTarget(const GURL& url) { | 88 BrowserListTabContentsProvider::CreateNewTarget(const GURL& url) { |
| 90 const BrowserList* browser_list = | 89 const BrowserList* browser_list = |
| 91 BrowserList::GetInstance(host_desktop_type_); | 90 BrowserList::GetInstance(host_desktop_type_); |
| 92 WebContents* web_contents; | 91 WebContents* web_contents; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 .PassAs<net::StreamListenSocket>(); | 131 .PassAs<net::StreamListenSocket>(); |
| 133 } | 132 } |
| 134 #else | 133 #else |
| 135 scoped_ptr<net::StreamListenSocket> | 134 scoped_ptr<net::StreamListenSocket> |
| 136 BrowserListTabContentsProvider::CreateSocketForTethering( | 135 BrowserListTabContentsProvider::CreateSocketForTethering( |
| 137 net::StreamListenSocket::Delegate* delegate, | 136 net::StreamListenSocket::Delegate* delegate, |
| 138 std::string* name) { | 137 std::string* name) { |
| 139 return scoped_ptr<net::StreamListenSocket>(); | 138 return scoped_ptr<net::StreamListenSocket>(); |
| 140 } | 139 } |
| 141 #endif // defined(DEBUG_DEVTOOLS) | 140 #endif // defined(DEBUG_DEVTOOLS) |
| OLD | NEW |