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" |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
16 #include "base/files/file_path.h" | 16 #include "base/files/file_path.h" |
17 #include "base/logging.h" | 17 #include "base/logging.h" |
18 #include "base/strings/string_number_conversions.h" | 18 #include "base/strings/string_number_conversions.h" |
19 #include "base/strings/stringprintf.h" | 19 #include "base/strings/stringprintf.h" |
20 #include "base/strings/utf_string_conversions.h" | 20 #include "base/strings/utf_string_conversions.h" |
21 #include "chrome/browser/android/tab_android.h" | 21 #include "chrome/browser/android/tab_android.h" |
22 #include "chrome/browser/browser_process.h" | 22 #include "chrome/browser/browser_process.h" |
23 #include "chrome/browser/history/top_sites.h" | 23 #include "chrome/browser/history/top_sites.h" |
| 24 #include "chrome/browser/history/top_sites_factory.h" |
24 #include "chrome/browser/profiles/profile_manager.h" | 25 #include "chrome/browser/profiles/profile_manager.h" |
25 #include "chrome/browser/ui/android/tab_model/tab_model.h" | 26 #include "chrome/browser/ui/android/tab_model/tab_model.h" |
26 #include "chrome/browser/ui/android/tab_model/tab_model_list.h" | 27 #include "chrome/browser/ui/android/tab_model/tab_model_list.h" |
27 #include "content/public/browser/android/devtools_auth.h" | 28 #include "content/public/browser/android/devtools_auth.h" |
28 #include "content/public/browser/browser_thread.h" | 29 #include "content/public/browser/browser_thread.h" |
29 #include "content/public/browser/devtools_agent_host.h" | 30 #include "content/public/browser/devtools_agent_host.h" |
30 #include "content/public/browser/devtools_http_handler.h" | 31 #include "content/public/browser/devtools_http_handler.h" |
31 #include "content/public/browser/devtools_http_handler_delegate.h" | 32 #include "content/public/browser/devtools_http_handler_delegate.h" |
32 #include "content/public/browser/devtools_target.h" | 33 #include "content/public/browser/devtools_target.h" |
33 #include "content/public/browser/favicon_status.h" | 34 #include "content/public/browser/favicon_status.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 } | 102 } |
102 | 103 |
103 base::FilePath GetDebugFrontendDir() override { | 104 base::FilePath GetDebugFrontendDir() override { |
104 return base::FilePath(); | 105 return base::FilePath(); |
105 } | 106 } |
106 | 107 |
107 private: | 108 private: |
108 static void PopulatePageThumbnails() { | 109 static void PopulatePageThumbnails() { |
109 Profile* profile = | 110 Profile* profile = |
110 ProfileManager::GetLastUsedProfile()->GetOriginalProfile(); | 111 ProfileManager::GetLastUsedProfile()->GetOriginalProfile(); |
111 history::TopSites* top_sites = profile->GetTopSites(); | 112 scoped_refptr<history::TopSites> top_sites = |
| 113 TopSitesFactory::GetForProfile(profile); |
112 if (top_sites) | 114 if (top_sites) |
113 top_sites->SyncWithHistory(); | 115 top_sites->SyncWithHistory(); |
114 } | 116 } |
115 | 117 |
116 DISALLOW_COPY_AND_ASSIGN(DevToolsServerDelegate); | 118 DISALLOW_COPY_AND_ASSIGN(DevToolsServerDelegate); |
117 }; | 119 }; |
118 | 120 |
119 // Factory for UnixDomainServerSocket. It tries a fallback socket when | 121 // Factory for UnixDomainServerSocket. It tries a fallback socket when |
120 // original socket doesn't work. | 122 // original socket doesn't work. |
121 class UnixDomainServerSocketFactory | 123 class UnixDomainServerSocketFactory |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 jlong server, | 238 jlong server, |
237 jboolean enabled, | 239 jboolean enabled, |
238 jboolean allow_debug_permission) { | 240 jboolean allow_debug_permission) { |
239 DevToolsServer* devtools_server = reinterpret_cast<DevToolsServer*>(server); | 241 DevToolsServer* devtools_server = reinterpret_cast<DevToolsServer*>(server); |
240 if (enabled) { | 242 if (enabled) { |
241 devtools_server->Start(allow_debug_permission); | 243 devtools_server->Start(allow_debug_permission); |
242 } else { | 244 } else { |
243 devtools_server->Stop(); | 245 devtools_server->Stop(); |
244 } | 246 } |
245 } | 247 } |
OLD | NEW |