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 "chrome/browser/ui/webui/inspect_ui.h" | 5 #include "chrome/browser/ui/webui/inspect_ui.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 | 355 |
356 InspectUI* discovery_ui_; | 356 InspectUI* discovery_ui_; |
357 }; | 357 }; |
358 | 358 |
359 InspectUI::InspectUI(content::WebUI* web_ui) | 359 InspectUI::InspectUI(content::WebUI* web_ui) |
360 : WebUIController(web_ui), | 360 : WebUIController(web_ui), |
361 observer_(new WorkerCreationDestructionListener(this)) { | 361 observer_(new WorkerCreationDestructionListener(this)) { |
362 web_ui->AddMessageHandler(new InspectMessageHandler()); | 362 web_ui->AddMessageHandler(new InspectMessageHandler()); |
363 | 363 |
364 Profile* profile = Profile::FromWebUI(web_ui); | 364 Profile* profile = Profile::FromWebUI(web_ui); |
365 ChromeURLDataManager::AddDataSource(profile, CreateInspectUIHTMLSource()); | 365 ChromeURLDataManager::AddDataSourceImpl(profile, CreateInspectUIHTMLSource()); |
366 | 366 |
367 registrar_.Add(this, | 367 registrar_.Add(this, |
368 content::NOTIFICATION_WEB_CONTENTS_CONNECTED, | 368 content::NOTIFICATION_WEB_CONTENTS_CONNECTED, |
369 content::NotificationService::AllSources()); | 369 content::NotificationService::AllSources()); |
370 registrar_.Add(this, | 370 registrar_.Add(this, |
371 content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, | 371 content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, |
372 content::NotificationService::AllSources()); | 372 content::NotificationService::AllSources()); |
373 registrar_.Add(this, | 373 registrar_.Add(this, |
374 content::NOTIFICATION_WEB_CONTENTS_DESTROYED, | 374 content::NOTIFICATION_WEB_CONTENTS_DESTROYED, |
375 content::NotificationService::AllSources()); | 375 content::NotificationService::AllSources()); |
(...skipping 17 matching lines...) Expand all Loading... |
393 } | 393 } |
394 | 394 |
395 void InspectUI::StopListeningNotifications() | 395 void InspectUI::StopListeningNotifications() |
396 { | 396 { |
397 if (!observer_) | 397 if (!observer_) |
398 return; | 398 return; |
399 observer_->InspectUIDestroyed(); | 399 observer_->InspectUIDestroyed(); |
400 observer_ = NULL; | 400 observer_ = NULL; |
401 registrar_.RemoveAll(); | 401 registrar_.RemoveAll(); |
402 } | 402 } |
OLD | NEW |