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

Side by Side Diff: chrome/browser/android/dev_tools_server.cc

Issue 101653006: Remove GetDefaultProfile from various Android related code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed Created 6 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/android/signin/signin_manager_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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"
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 scoped_refptr<base::RefCountedMemory> data; 286 scoped_refptr<base::RefCountedMemory> data;
287 if (top_sites->GetPageThumbnail(url, false, &data)) 287 if (top_sites->GetPageThumbnail(url, false, &data))
288 return std::string(reinterpret_cast<const char*>(data->front()), 288 return std::string(reinterpret_cast<const char*>(data->front()),
289 data->size()); 289 data->size());
290 } 290 }
291 return ""; 291 return "";
292 } 292 }
293 293
294 virtual scoped_ptr<content::DevToolsTarget> CreateNewTarget( 294 virtual scoped_ptr<content::DevToolsTarget> CreateNewTarget(
295 const GURL& url) OVERRIDE { 295 const GURL& url) OVERRIDE {
296 Profile* profile = 296 Profile* profile = ProfileManager::GetActiveUserProfile();
297 g_browser_process->profile_manager()->GetDefaultProfile();
298 TabModel* tab_model = TabModelList::GetTabModelWithProfile(profile); 297 TabModel* tab_model = TabModelList::GetTabModelWithProfile(profile);
299 if (!tab_model) 298 if (!tab_model)
300 return scoped_ptr<content::DevToolsTarget>(); 299 return scoped_ptr<content::DevToolsTarget>();
301 WebContents* web_contents = tab_model->CreateNewTabForDevTools(url); 300 WebContents* web_contents = tab_model->CreateNewTabForDevTools(url);
302 if (!web_contents) 301 if (!web_contents)
303 return scoped_ptr<content::DevToolsTarget>(); 302 return scoped_ptr<content::DevToolsTarget>();
304 303
305 for (int i = 0; i < tab_model->GetTabCount(); ++i) { 304 for (int i = 0; i < tab_model->GetTabCount(); ++i) {
306 if (web_contents != tab_model->GetWebContentsAt(i)) 305 if (web_contents != tab_model->GetWebContentsAt(i))
307 continue; 306 continue;
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 jobject obj, 462 jobject obj,
464 jint server, 463 jint server,
465 jboolean enabled) { 464 jboolean enabled) {
466 DevToolsServer* devtools_server = reinterpret_cast<DevToolsServer*>(server); 465 DevToolsServer* devtools_server = reinterpret_cast<DevToolsServer*>(server);
467 if (enabled) { 466 if (enabled) {
468 devtools_server->Start(); 467 devtools_server->Start();
469 } else { 468 } else {
470 devtools_server->Stop(); 469 devtools_server->Stop();
471 } 470 }
472 } 471 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/signin/signin_manager_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698