Chromium Code Reviews| 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 <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/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 636 window = Create(profile, inspected_rvh, docked, false); | 636 window = Create(profile, inspected_rvh, docked, false); |
| 637 manager->RegisterDevToolsClientHostFor(agent, window->frontend_host_); | 637 manager->RegisterDevToolsClientHostFor(agent, window->frontend_host_); |
| 638 do_open = true; | 638 do_open = true; |
| 639 } | 639 } |
| 640 | 640 |
| 641 // Update toolbar to reflect DevTools changes. | 641 // Update toolbar to reflect DevTools changes. |
| 642 window->UpdateBrowserToolbar(); | 642 window->UpdateBrowserToolbar(); |
| 643 | 643 |
| 644 // If window is docked and visible, we hide it on toggle. If window is | 644 // If window is docked and visible, we hide it on toggle. If window is |
| 645 // undocked, we show (activate) it. | 645 // undocked, we show (activate) it. |
| 646 if (!window->is_docked() || do_open) | 646 if (!window->is_docked() || do_open) { |
|
yurys
2012/08/21 19:52:55
Revert this? As I remember style guide doesn't req
Matt Perry
2012/08/21 20:13:46
Oops, leftover change. Reverted.
| |
| 647 window->Show(action); | 647 window->Show(action); |
| 648 else | 648 } else { |
| 649 manager->UnregisterDevToolsClientHostFor(agent); | 649 manager->UnregisterDevToolsClientHostFor(agent); |
| 650 } | |
| 650 | 651 |
| 651 return window; | 652 return window; |
| 652 } | 653 } |
| 653 | 654 |
| 654 // static | 655 // static |
| 655 DevToolsWindow* DevToolsWindow::AsDevToolsWindow( | 656 DevToolsWindow* DevToolsWindow::AsDevToolsWindow( |
| 656 DevToolsClientHost* client_host) { | 657 DevToolsClientHost* client_host) { |
| 657 if (!client_host || g_instances == NULL) | 658 if (!client_host || g_instances == NULL) |
| 658 return NULL; | 659 return NULL; |
| 659 DevToolsWindowList& instances = g_instances.Get(); | 660 DevToolsWindowList& instances = g_instances.Get(); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 765 FileSelectHelper::RunFileChooser(web_contents, params); | 766 FileSelectHelper::RunFileChooser(web_contents, params); |
| 766 } | 767 } |
| 767 | 768 |
| 768 void DevToolsWindow::UpdateBrowserToolbar() { | 769 void DevToolsWindow::UpdateBrowserToolbar() { |
| 769 if (!inspected_tab_) | 770 if (!inspected_tab_) |
| 770 return; | 771 return; |
| 771 BrowserWindow* inspected_window = GetInspectedBrowserWindow(); | 772 BrowserWindow* inspected_window = GetInspectedBrowserWindow(); |
| 772 if (inspected_window) | 773 if (inspected_window) |
| 773 inspected_window->UpdateToolbar(inspected_tab_, false); | 774 inspected_window->UpdateToolbar(inspected_tab_, false); |
| 774 } | 775 } |
| OLD | NEW |