| 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/android/dev_tools_server.h" | 5 #include "chrome/browser/android/dev_tools_server.h" |
| 6 | 6 |
| 7 #include <pwd.h> | 7 #include <pwd.h> |
| 8 #include <cstring> | 8 #include <cstring> |
| 9 | 9 |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 virtual base::FilePath GetDebugFrontendDir() OVERRIDE { | 68 virtual base::FilePath GetDebugFrontendDir() OVERRIDE { |
| 69 return base::FilePath(); | 69 return base::FilePath(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 virtual std::string GetPageThumbnailData(const GURL& url) OVERRIDE { | 72 virtual std::string GetPageThumbnailData(const GURL& url) OVERRIDE { |
| 73 Profile* profile = | 73 Profile* profile = |
| 74 ProfileManager::GetLastUsedProfile()->GetOriginalProfile(); | 74 ProfileManager::GetLastUsedProfile()->GetOriginalProfile(); |
| 75 history::TopSites* top_sites = profile->GetTopSites(); | 75 history::TopSites* top_sites = profile->GetTopSites(); |
| 76 if (top_sites) { | 76 if (top_sites) { |
| 77 scoped_refptr<base::RefCountedMemory> data; | 77 scoped_refptr<base::RefCountedMemory> data; |
| 78 if (top_sites->GetPageThumbnail(url, &data)) | 78 if (top_sites->GetPageThumbnail(url, false, &data)) |
| 79 return std::string(reinterpret_cast<const char*>(data->front()), | 79 return std::string(reinterpret_cast<const char*>(data->front()), |
| 80 data->size()); | 80 data->size()); |
| 81 } | 81 } |
| 82 return ""; | 82 return ""; |
| 83 } | 83 } |
| 84 | 84 |
| 85 virtual content::RenderViewHost* CreateNewTarget() OVERRIDE { | 85 virtual content::RenderViewHost* CreateNewTarget() OVERRIDE { |
| 86 Profile* profile = | 86 Profile* profile = |
| 87 g_browser_process->profile_manager()->GetDefaultProfile(); | 87 g_browser_process->profile_manager()->GetDefaultProfile(); |
| 88 TabModel* tab_model = TabModelList::GetTabModelWithProfile(profile); | 88 TabModel* tab_model = TabModelList::GetTabModelWithProfile(profile); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 jobject obj, | 213 jobject obj, |
| 214 jint server, | 214 jint server, |
| 215 jboolean enabled) { | 215 jboolean enabled) { |
| 216 DevToolsServer* devtools_server = reinterpret_cast<DevToolsServer*>(server); | 216 DevToolsServer* devtools_server = reinterpret_cast<DevToolsServer*>(server); |
| 217 if (enabled) { | 217 if (enabled) { |
| 218 devtools_server->Start(); | 218 devtools_server->Start(); |
| 219 } else { | 219 } else { |
| 220 devtools_server->Stop(); | 220 devtools_server->Stop(); |
| 221 } | 221 } |
| 222 } | 222 } |
| OLD | NEW |