OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/dom_ui/dom_ui_contents.h" | 5 #include "chrome/browser/dom_ui/dom_ui_contents.h" |
6 | 6 |
7 #include "chrome/browser/debugger/debugger_contents.h" | 7 #include "chrome/browser/debugger/debugger_contents.h" |
8 #include "chrome/browser/dom_ui/dev_tools_ui.h" | 8 #include "chrome/browser/dom_ui/dev_tools_ui.h" |
9 #include "chrome/browser/dom_ui/dom_ui.h" | 9 #include "chrome/browser/dom_ui/dom_ui.h" |
10 #include "chrome/browser/dom_ui/downloads_ui.h" | 10 #include "chrome/browser/dom_ui/downloads_ui.h" |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 | 239 |
240 bool DOMUIContents::InitCurrentUI(bool reload) { | 240 bool DOMUIContents::InitCurrentUI(bool reload) { |
241 if (!controller()->GetActiveEntry()) | 241 if (!controller()->GetActiveEntry()) |
242 return false; | 242 return false; |
243 | 243 |
244 GURL url = controller()->GetActiveEntry()->url(); | 244 GURL url = controller()->GetActiveEntry()->url(); |
245 | 245 |
246 if (url.is_empty() || !url.is_valid()) | 246 if (url.is_empty() || !url.is_valid()) |
247 return false; | 247 return false; |
248 | 248 |
249 if (reload || url != current_url_) { | 249 if (reload || url.host() != current_url_.host()) { |
250 // Shut down our existing DOMUI. | 250 // Shut down our existing DOMUI. |
251 delete current_ui_; | 251 delete current_ui_; |
252 current_ui_ = NULL; | 252 current_ui_ = NULL; |
253 | 253 |
254 // Set up a new DOMUI. | 254 // Set up a new DOMUI. |
255 current_ui_ = GetDOMUIForURL(url); | 255 current_ui_ = GetDOMUIForURL(url); |
256 if (current_ui_) { | 256 if (current_ui_) { |
257 current_ui_->Init(); | 257 current_ui_->Init(); |
258 current_url_ = url; | 258 current_url_ = url; |
259 return true; | 259 return true; |
(...skipping 30 matching lines...) Expand all Loading... |
290 return new DebuggerContents(this); | 290 return new DebuggerContents(this); |
291 } | 291 } |
292 if (url.host() == DevToolsUI::GetBaseURL().host()) { | 292 if (url.host() == DevToolsUI::GetBaseURL().host()) { |
293 return new DevToolsUI(this); | 293 return new DevToolsUI(this); |
294 } | 294 } |
295 #else | 295 #else |
296 NOTIMPLEMENTED(); | 296 NOTIMPLEMENTED(); |
297 #endif | 297 #endif |
298 return NULL; | 298 return NULL; |
299 } | 299 } |
OLD | NEW |