| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/device/devtools_android_bridge.h" | 5 #include "chrome/browser/devtools/device/devtools_android_bridge.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #include "content/public/browser/devtools_external_agent_proxy_delegate.h" | 36 #include "content/public/browser/devtools_external_agent_proxy_delegate.h" |
| 37 #include "content/public/browser/user_metrics.h" | 37 #include "content/public/browser/user_metrics.h" |
| 38 #include "net/base/escape.h" | 38 #include "net/base/escape.h" |
| 39 | 39 |
| 40 using content::BrowserThread; | 40 using content::BrowserThread; |
| 41 | 41 |
| 42 namespace { | 42 namespace { |
| 43 | 43 |
| 44 const char kModelOffline[] = "Offline"; | 44 const char kModelOffline[] = "Offline"; |
| 45 | 45 |
| 46 const char kPageListRequest[] = "GET /json HTTP/1.1\r\n\r\n"; | 46 const char kPageListRequest[] = "/json"; |
| 47 const char kVersionRequest[] = "GET /json/version HTTP/1.1\r\n\r\n"; | 47 const char kVersionRequest[] = "/json/version"; |
| 48 const char kClosePageRequest[] = "GET /json/close/%s HTTP/1.1\r\n\r\n"; | 48 const char kClosePageRequest[] = "/json/close/%s"; |
| 49 const char kNewPageRequest[] = "GET /json/new HTTP/1.1\r\n\r\n"; | 49 const char kNewPageRequest[] = "/json/new"; |
| 50 const char kNewPageRequestWithURL[] = "GET /json/new?%s HTTP/1.1\r\n\r\n"; | 50 const char kNewPageRequestWithURL[] = "/json/new?%s"; |
| 51 const char kActivatePageRequest[] = | 51 const char kActivatePageRequest[] = "/json/activate/%s"; |
| 52 "GET /json/activate/%s HTTP/1.1\r\n\r\n"; | |
| 53 const char kBrowserTargetSocket[] = "/devtools/browser"; | 52 const char kBrowserTargetSocket[] = "/devtools/browser"; |
| 54 const int kAdbPollingIntervalMs = 1000; | 53 const int kAdbPollingIntervalMs = 1000; |
| 55 | 54 |
| 56 const char kUrlParam[] = "url"; | 55 const char kUrlParam[] = "url"; |
| 57 const char kPageReloadCommand[] = "Page.reload"; | 56 const char kPageReloadCommand[] = "Page.reload"; |
| 58 const char kPageNavigateCommand[] = "Page.navigate"; | 57 const char kPageNavigateCommand[] = "Page.navigate"; |
| 59 | 58 |
| 60 const int kMinVersionNewWithURL = 32; | 59 const int kMinVersionNewWithURL = 32; |
| 61 const int kNewPageNavigateDelayMs = 500; | 60 const int kNewPageNavigateDelayMs = 500; |
| 62 | 61 |
| (...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1002 PrefService* service = profile_->GetPrefs(); | 1001 PrefService* service = profile_->GetPrefs(); |
| 1003 const PrefService::Preference* pref = | 1002 const PrefService::Preference* pref = |
| 1004 service->FindPreference(prefs::kDevToolsDiscoverUsbDevicesEnabled); | 1003 service->FindPreference(prefs::kDevToolsDiscoverUsbDevicesEnabled); |
| 1005 const base::Value* pref_value = pref->GetValue(); | 1004 const base::Value* pref_value = pref->GetValue(); |
| 1006 | 1005 |
| 1007 bool enabled; | 1006 bool enabled; |
| 1008 if (pref_value->GetAsBoolean(&enabled) && enabled) { | 1007 if (pref_value->GetAsBoolean(&enabled) && enabled) { |
| 1009 device_providers_.push_back(new UsbDeviceProvider(profile_)); | 1008 device_providers_.push_back(new UsbDeviceProvider(profile_)); |
| 1010 } | 1009 } |
| 1011 } | 1010 } |
| OLD | NEW |