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

Side by Side Diff: chrome/browser/debugger/devtools_window.cc

Issue 7480028: Removal of Profile from content part 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 5 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) 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 <algorithm> 5 #include <algorithm>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 559
560 DevToolsClientHost* host = manager->GetDevToolsClientHostFor(inspected_rvh); 560 DevToolsClientHost* host = manager->GetDevToolsClientHostFor(inspected_rvh);
561 DevToolsWindow* window = AsDevToolsWindow(host); 561 DevToolsWindow* window = AsDevToolsWindow(host);
562 if (host != NULL && window == NULL) { 562 if (host != NULL && window == NULL) {
563 // Break remote debugging / extension debugging session. 563 // Break remote debugging / extension debugging session.
564 manager->UnregisterDevToolsClientHostFor(inspected_rvh); 564 manager->UnregisterDevToolsClientHostFor(inspected_rvh);
565 } 565 }
566 566
567 bool do_open = force_open; 567 bool do_open = force_open;
568 if (!window) { 568 if (!window) {
569 Profile* profile = inspected_rvh->process()->profile(); 569 Profile* profile = Profile::FromBrowserContext(
570 inspected_rvh->process()->browser_context());
570 bool docked = profile->GetPrefs()->GetBoolean(prefs::kDevToolsOpenDocked); 571 bool docked = profile->GetPrefs()->GetBoolean(prefs::kDevToolsOpenDocked);
571 window = new DevToolsWindow(profile, inspected_rvh, docked, false); 572 window = new DevToolsWindow(profile, inspected_rvh, docked, false);
572 manager->RegisterDevToolsClientHostFor(inspected_rvh, window); 573 manager->RegisterDevToolsClientHostFor(inspected_rvh, window);
573 do_open = true; 574 do_open = true;
574 } 575 }
575 576
576 // If window is docked and visible, we hide it on toggle. If window is 577 // If window is docked and visible, we hide it on toggle. If window is
577 // undocked, we show (activate) it. 578 // undocked, we show (activate) it.
578 if (!window->is_docked() || do_open) 579 if (!window->is_docked() || do_open)
579 window->Show(action); 580 window->Show(action);
(...skipping 13 matching lines...) Expand all
593 return NULL; 594 return NULL;
594 } 595 }
595 596
596 content::JavaScriptDialogCreator* DevToolsWindow::GetJavaScriptDialogCreator() { 597 content::JavaScriptDialogCreator* DevToolsWindow::GetJavaScriptDialogCreator() {
597 if (inspected_tab_ && inspected_tab_->tab_contents()->delegate()) { 598 if (inspected_tab_ && inspected_tab_->tab_contents()->delegate()) {
598 return inspected_tab_->tab_contents()->delegate()-> 599 return inspected_tab_->tab_contents()->delegate()->
599 GetJavaScriptDialogCreator(); 600 GetJavaScriptDialogCreator();
600 } 601 }
601 return TabContentsDelegate::GetJavaScriptDialogCreator(); 602 return TabContentsDelegate::GetJavaScriptDialogCreator();
602 } 603 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698