OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/debugger/dev_tools_window.h" |
| 6 |
| 7 #include "chrome/browser/debugger/dev_tools_view.h" |
| 8 #include "chrome/views/window.h" |
| 9 |
| 10 DevToolsWindow::DevToolsWindow() : window_(NULL), tools_view_(NULL) { |
| 11 } |
| 12 |
| 13 DevToolsWindow::~DevToolsWindow() { |
| 14 } |
| 15 |
| 16 void DevToolsWindow::Show(int inspected_process_id, |
| 17 int inspected_view_id) { |
| 18 if (window_) { |
| 19 window_->Show(); |
| 20 return; |
| 21 } |
| 22 |
| 23 tools_view_ = new DevToolsView(inspected_process_id, inspected_view_id); |
| 24 window_ = views::Window::CreateChromeWindow(NULL, gfx::Rect(), this); |
| 25 window_->Show(); |
| 26 } |
| 27 |
| 28 void DevToolsWindow::SendDevToolsClientMessage(const IPC::Message& message) { |
| 29 if (!tools_view_) |
| 30 return; |
| 31 tools_view_->SendDevToolsClientMessage(message); |
| 32 } |
| 33 |
| 34 std::wstring DevToolsWindow::GetWindowTitle() const { |
| 35 return L"Developer Tools"; |
| 36 } |
| 37 |
| 38 void DevToolsWindow::WindowClosing() { |
| 39 if (tools_view_) { |
| 40 tools_view_->OnWindowClosing(); |
| 41 tools_view_ = NULL; |
| 42 window_ = NULL; |
| 43 } |
| 44 } |
| 45 |
| 46 bool DevToolsWindow::CanResize() const { |
| 47 return true; |
| 48 } |
| 49 |
| 50 views::View* DevToolsWindow::GetContentsView() { |
| 51 return tools_view_; |
| 52 } |
| 53 |
OLD | NEW |