| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 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 | 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 "app/l10n_util.h" | 5 #include "app/l10n_util.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "chrome/browser/browser.h" | 7 #include "chrome/browser/browser.h" |
| 8 #include "chrome/browser/browser_list.h" | 8 #include "chrome/browser/browser_list.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/browser_window.h" | 10 #include "chrome/browser/browser_window.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 } | 120 } |
| 121 | 121 |
| 122 if (!browser_) { | 122 if (!browser_) { |
| 123 CreateDevToolsBrowser(); | 123 CreateDevToolsBrowser(); |
| 124 } | 124 } |
| 125 browser_->window()->Show(); | 125 browser_->window()->Show(); |
| 126 tab_contents_->view()->SetInitialFocus(); | 126 tab_contents_->view()->SetInitialFocus(); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void DevToolsWindow::Activate() { | 129 void DevToolsWindow::Activate() { |
| 130 if (!docked_ && !browser_->window()->IsActive()) { | 130 if (!docked_) { |
| 131 browser_->window()->Activate(); | 131 if (!browser_->window()->IsActive()) { |
| 132 browser_->window()->Activate(); |
| 133 } |
| 134 } else { |
| 135 inspected_window_->FocusDevTools(); |
| 132 } | 136 } |
| 133 } | 137 } |
| 134 | 138 |
| 135 void DevToolsWindow::SetDocked(bool docked) { | 139 void DevToolsWindow::SetDocked(bool docked) { |
| 136 if (docked_ == docked) { | 140 if (docked_ == docked) { |
| 137 return; | 141 return; |
| 138 } | 142 } |
| 139 docked_ = docked; | 143 docked_ = docked; |
| 140 | 144 |
| 141 if (docked) { | 145 if (docked) { |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 &tab_contents_->controller()) { | 216 &tab_contents_->controller()) { |
| 213 // This happens when browser closes all of its tabs as a result | 217 // This happens when browser closes all of its tabs as a result |
| 214 // of window.Close event. | 218 // of window.Close event. |
| 215 // Notify manager that this DevToolsClientHost no longer exists and | 219 // Notify manager that this DevToolsClientHost no longer exists and |
| 216 // initiate self-destuct here. | 220 // initiate self-destuct here. |
| 217 NotifyCloseListener(); | 221 NotifyCloseListener(); |
| 218 delete this; | 222 delete this; |
| 219 } | 223 } |
| 220 } | 224 } |
| 221 } | 225 } |
| OLD | NEW |