Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: chrome/browser/extensions/extension_tab_id_map.cc

Issue 11038021: Implement Chrome Extension TabCapture API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Some tests, fixes Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/extensions/extension_tab_id_map.h" 5 #include "chrome/browser/extensions/extension_tab_id_map.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "chrome/browser/sessions/session_tab_helper.h" 9 #include "chrome/browser/sessions/session_tab_helper.h"
10 #include "chrome/browser/tab_contents/retargeting_details.h" 10 #include "chrome/browser/tab_contents/retargeting_details.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 179 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
180 RenderId render_id(render_process_host_id, routing_id); 180 RenderId render_id(render_process_host_id, routing_id);
181 TabAndWindowIdMap::iterator iter = map_.find(render_id); 181 TabAndWindowIdMap::iterator iter = map_.find(render_id);
182 if (iter != map_.end()) { 182 if (iter != map_.end()) {
183 *tab_id = iter->second.first; 183 *tab_id = iter->second.first;
184 *window_id = iter->second.second; 184 *window_id = iter->second.second;
185 return true; 185 return true;
186 } 186 }
187 return false; 187 return false;
188 } 188 }
189
190 bool ExtensionTabIdMap::GetProcessAndRoutingId(
191 int tab_id, int* render_process_host_id, int* routing_id) {
192 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
193 for (TabAndWindowIdMap::iterator iter = map_.begin(); iter != map_.end();
194 iter++) {
Alpha Left Google 2012/10/04 20:52:01 indentation is wrong here
justinlin 2012/10/08 09:58:31 Done.
195 if (iter->second.first == tab_id) {
196 *render_process_host_id = iter->first.first;
197 *routing_id = iter->first.second;
198 return true;
199 }
200 }
201 return false;
202 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698