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/debugger/browser_list_tabcontents_provider.h" | 5 #include "chrome/browser/debugger/browser_list_tabcontents_provider.h" |
6 | 6 |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "chrome/browser/history/top_sites.h" | 8 #include "chrome/browser/history/top_sites.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/profiles/profile_manager.h" | 10 #include "chrome/browser/profiles/profile_manager.h" |
11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
12 #include "chrome/browser/ui/browser_list.h" | 12 #include "chrome/browser/ui/browser_list.h" |
13 #include "chrome/browser/ui/browser_tabstrip.h" | |
14 #include "chrome/browser/ui/tab_contents/tab_contents.h" | |
13 #include "chrome/common/chrome_paths.h" | 15 #include "chrome/common/chrome_paths.h" |
14 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
17 #include "content/public/browser/web_contents.h" | |
15 #include "grit/devtools_discovery_page_resources.h" | 18 #include "grit/devtools_discovery_page_resources.h" |
16 #include "net/url_request/url_request_context_getter.h" | 19 #include "net/url_request/url_request_context_getter.h" |
17 #include "ui/base/layout.h" | 20 #include "ui/base/layout.h" |
18 #include "ui/base/resource/resource_bundle.h" | 21 #include "ui/base/resource/resource_bundle.h" |
19 | 22 |
20 using content::DevToolsHttpHandlerDelegate; | 23 using content::DevToolsHttpHandlerDelegate; |
24 using content::RenderViewHost; | |
21 | 25 |
22 BrowserListTabContentsProvider::BrowserListTabContentsProvider() { | 26 BrowserListTabContentsProvider::BrowserListTabContentsProvider() { |
23 } | 27 } |
24 | 28 |
25 BrowserListTabContentsProvider::~BrowserListTabContentsProvider() { | 29 BrowserListTabContentsProvider::~BrowserListTabContentsProvider() { |
26 } | 30 } |
27 | 31 |
28 std::string BrowserListTabContentsProvider::GetDiscoveryPageHTML() { | 32 std::string BrowserListTabContentsProvider::GetDiscoveryPageHTML() { |
29 std::set<Profile*> profiles; | 33 std::set<Profile*> profiles; |
30 for (BrowserList::const_iterator it = BrowserList::begin(), | 34 for (BrowserList::const_iterator it = BrowserList::begin(), |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
72 if (!top_sites) | 76 if (!top_sites) |
73 continue; | 77 continue; |
74 scoped_refptr<base::RefCountedMemory> data; | 78 scoped_refptr<base::RefCountedMemory> data; |
75 if (top_sites->GetPageThumbnail(url, &data)) | 79 if (top_sites->GetPageThumbnail(url, &data)) |
76 return std::string( | 80 return std::string( |
77 reinterpret_cast<const char*>(data->front()), data->size()); | 81 reinterpret_cast<const char*>(data->front()), data->size()); |
78 } | 82 } |
79 | 83 |
80 return std::string(); | 84 return std::string(); |
81 } | 85 } |
86 | |
87 RenderViewHost* BrowserListTabContentsProvider::CreateNewTarget() { | |
88 for (BrowserList::const_iterator it = BrowserList::begin(), | |
89 end = BrowserList::end(); it != end; ++it) { | |
90 TabContents* tab_contents = chrome::AddSelectedTabWithURL( | |
yurys
2012/10/05 14:29:49
Should we specify browser instance where to create
pfeldman
2012/10/05 14:36:47
There is not such term on the content level where
| |
91 *it, | |
92 GURL("about:blank"), | |
93 content::PAGE_TRANSITION_LINK); | |
94 return tab_contents->web_contents()->GetRenderViewHost(); | |
95 } | |
96 return NULL; | |
97 } | |
OLD | NEW |