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/devtools_server.h" | 5 #include "chrome/browser/android/devtools_server.h" |
6 | 6 |
7 #include <cstring> | 7 #include <cstring> |
8 #include <pwd.h> | 8 #include <pwd.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 history::TopSites* top_sites = profile->GetTopSites(); | 63 history::TopSites* top_sites = profile->GetTopSites(); |
64 if (top_sites) { | 64 if (top_sites) { |
65 scoped_refptr<base::RefCountedMemory> data; | 65 scoped_refptr<base::RefCountedMemory> data; |
66 if (top_sites->GetPageThumbnail(url, &data)) | 66 if (top_sites->GetPageThumbnail(url, &data)) |
67 return std::string(reinterpret_cast<const char*>(data->front()), | 67 return std::string(reinterpret_cast<const char*>(data->front()), |
68 data->size()); | 68 data->size()); |
69 } | 69 } |
70 return ""; | 70 return ""; |
71 } | 71 } |
72 | 72 |
| 73 content::RenderViewHost* CreateNewTarget() { |
| 74 return NULL; |
| 75 } |
| 76 |
73 private: | 77 private: |
74 static void PopulatePageThumbnails() { | 78 static void PopulatePageThumbnails() { |
75 Profile* profile = | 79 Profile* profile = |
76 ProfileManager::GetLastUsedProfile()->GetOriginalProfile(); | 80 ProfileManager::GetLastUsedProfile()->GetOriginalProfile(); |
77 history::TopSites* top_sites = profile->GetTopSites(); | 81 history::TopSites* top_sites = profile->GetTopSites(); |
78 if (top_sites) | 82 if (top_sites) |
79 top_sites->SyncWithHistory(); | 83 top_sites->SyncWithHistory(); |
80 } | 84 } |
81 | 85 |
82 DISALLOW_COPY_AND_ASSIGN(DevToolsServerDelegate); | 86 DISALLOW_COPY_AND_ASSIGN(DevToolsServerDelegate); |
(...skipping 27 matching lines...) Expand all Loading... |
110 return; | 114 return; |
111 // Note that the call to Stop() below takes care of |protocol_handler_| | 115 // Note that the call to Stop() below takes care of |protocol_handler_| |
112 // deletion. | 116 // deletion. |
113 protocol_handler_->Stop(); | 117 protocol_handler_->Stop(); |
114 protocol_handler_ = NULL; | 118 protocol_handler_ = NULL; |
115 } | 119 } |
116 | 120 |
117 bool DevToolsServer::IsStarted() const { | 121 bool DevToolsServer::IsStarted() const { |
118 return protocol_handler_; | 122 return protocol_handler_; |
119 } | 123 } |
OLD | NEW |