| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/debugger/browser_list_tabcontents_provider.h" | 5 #include "chrome/browser/debugger/browser_list_tabcontents_provider.h" |
| 6 | 6 |
| 7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/browser/tabs/tab_strip_model.h" | 8 #include "chrome/browser/tabs/tab_strip_model.h" |
| 9 #include "chrome/browser/ui/browser_list.h" | 9 #include "chrome/browser/ui/browser_list.h" |
| 10 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 10 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 11 #include "grit/devtools_frontend_resources.h" | 11 #include "grit/devtools_frontend_resources.h" |
| 12 #include "net/url_request/url_request_context_getter.h" | 12 #include "net/url_request/url_request_context_getter.h" |
| 13 #include "ui/base/resource/resource_bundle.h" | 13 #include "ui/base/resource/resource_bundle.h" |
| 14 | 14 |
| 15 DevToolsHttpProtocolHandler::InspectableTabs | 15 using content::DevToolsHttpHandlerDelegate; |
| 16 |
| 17 DevToolsHttpHandlerDelegate::InspectableTabs |
| 16 BrowserListTabContentsProvider::GetInspectableTabs() { | 18 BrowserListTabContentsProvider::GetInspectableTabs() { |
| 17 DevToolsHttpProtocolHandler::InspectableTabs tabs; | 19 DevToolsHttpHandlerDelegate::InspectableTabs tabs; |
| 18 for (BrowserList::const_iterator it = BrowserList::begin(), | 20 for (BrowserList::const_iterator it = BrowserList::begin(), |
| 19 end = BrowserList::end(); it != end; ++it) { | 21 end = BrowserList::end(); it != end; ++it) { |
| 20 TabStripModel* model = (*it)->tabstrip_model(); | 22 TabStripModel* model = (*it)->tabstrip_model(); |
| 21 for (int i = 0, size = model->count(); i < size; ++i) | 23 for (int i = 0, size = model->count(); i < size; ++i) |
| 22 tabs.push_back(model->GetTabContentsAt(i)->tab_contents()); | 24 tabs.push_back(model->GetTabContentsAt(i)->tab_contents()); |
| 23 } | 25 } |
| 24 return tabs; | 26 return tabs; |
| 25 } | 27 } |
| 26 | 28 |
| 27 std::string BrowserListTabContentsProvider::GetDiscoveryPageHTML() { | 29 std::string BrowserListTabContentsProvider::GetDiscoveryPageHTML() { |
| 28 return ResourceBundle::GetSharedInstance().GetRawDataResource( | 30 return ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 29 IDR_DEVTOOLS_FRONTEND_HTML).as_string(); | 31 IDR_DEVTOOLS_FRONTEND_HTML).as_string(); |
| 30 } | 32 } |
| 31 | 33 |
| 32 net::URLRequestContext* | 34 net::URLRequestContext* |
| 33 BrowserListTabContentsProvider::GetURLRequestContext() { | 35 BrowserListTabContentsProvider::GetURLRequestContext() { |
| 34 net::URLRequestContextGetter* getter = | 36 net::URLRequestContextGetter* getter = |
| 35 Profile::Deprecated::GetDefaultRequestContext(); | 37 Profile::Deprecated::GetDefaultRequestContext(); |
| 36 return getter ? getter->GetURLRequestContext() : NULL; | 38 return getter ? getter->GetURLRequestContext() : NULL; |
| 37 } | 39 } |
| OLD | NEW |