Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(487)

Side by Side Diff: chrome/browser/extensions/api/debugger/debugger_api.cc

Issue 211273007: Split InfoBarService core code into InfoBarManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + comments Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 // Implements the Chrome Extensions Debugger API. 5 // Implements the Chrome Extensions Debugger API.
6 6
7 #include "chrome/browser/extensions/api/debugger/debugger_api.h" 7 #include "chrome/browser/extensions/api/debugger/debugger_api.h"
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
11 11
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/json/json_reader.h" 13 #include "base/json/json_reader.h"
14 #include "base/json/json_writer.h" 14 #include "base/json/json_writer.h"
15 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
16 #include "base/memory/singleton.h" 16 #include "base/memory/singleton.h"
17 #include "base/stl_util.h" 17 #include "base/stl_util.h"
18 #include "base/strings/string_number_conversions.h" 18 #include "base/strings/string_number_conversions.h"
19 #include "base/strings/utf_string_conversions.h" 19 #include "base/strings/utf_string_conversions.h"
20 #include "base/values.h" 20 #include "base/values.h"
21 #include "chrome/browser/chrome_notification_types.h" 21 #include "chrome/browser/chrome_notification_types.h"
22 #include "chrome/browser/devtools/devtools_target_impl.h" 22 #include "chrome/browser/devtools/devtools_target_impl.h"
23 #include "chrome/browser/extensions/api/debugger/debugger_api_constants.h" 23 #include "chrome/browser/extensions/api/debugger/debugger_api_constants.h"
24 #include "chrome/browser/extensions/extension_service.h" 24 #include "chrome/browser/extensions/extension_service.h"
25 #include "chrome/browser/extensions/extension_tab_util.h" 25 #include "chrome/browser/extensions/extension_tab_util.h"
26 #include "chrome/browser/infobars/confirm_infobar_delegate.h" 26 #include "chrome/browser/infobars/confirm_infobar_delegate.h"
27 #include "chrome/browser/infobars/infobar.h" 27 #include "chrome/browser/infobars/infobar.h"
28 #include "chrome/browser/infobars/infobar_manager.h"
28 #include "chrome/browser/infobars/infobar_service.h" 29 #include "chrome/browser/infobars/infobar_service.h"
29 #include "chrome/browser/profiles/profile.h" 30 #include "chrome/browser/profiles/profile.h"
30 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" 31 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h"
31 #include "chrome/common/chrome_switches.h" 32 #include "chrome/common/chrome_switches.h"
32 #include "content/public/browser/devtools_agent_host.h" 33 #include "content/public/browser/devtools_agent_host.h"
33 #include "content/public/browser/devtools_client_host.h" 34 #include "content/public/browser/devtools_client_host.h"
34 #include "content/public/browser/devtools_http_handler.h" 35 #include "content/public/browser/devtools_http_handler.h"
35 #include "content/public/browser/devtools_manager.h" 36 #include "content/public/browser/devtools_manager.h"
36 #include "content/public/browser/notification_service.h" 37 #include "content/public/browser/notification_service.h"
37 #include "content/public/browser/notification_source.h" 38 #include "content/public/browser/notification_source.h"
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 } 333 }
333 334
334 ExtensionDevToolsClientHost::~ExtensionDevToolsClientHost() { 335 ExtensionDevToolsClientHost::~ExtensionDevToolsClientHost() {
335 // Ensure calling RemoveInfoBar() below won't result in Observe() trying to 336 // Ensure calling RemoveInfoBar() below won't result in Observe() trying to
336 // Close() us. 337 // Close() us.
337 registrar_.RemoveAll(); 338 registrar_.RemoveAll();
338 339
339 if (infobar_) { 340 if (infobar_) {
340 static_cast<ExtensionDevToolsInfoBarDelegate*>( 341 static_cast<ExtensionDevToolsInfoBarDelegate*>(
341 infobar_->delegate())->set_client_host(NULL); 342 infobar_->delegate())->set_client_host(NULL);
342 InfoBarService::FromWebContents(WebContents::FromRenderViewHost( 343 InfoBarService* infobar_service = InfoBarService::FromWebContents(
343 agent_host_->GetRenderViewHost()))->RemoveInfoBar(infobar_); 344 WebContents::FromRenderViewHost(agent_host_->GetRenderViewHost()));
345 infobar_service->infobar_manager()->RemoveInfoBar(infobar_);
344 } 346 }
345 AttachedClientHosts::GetInstance()->Remove(this); 347 AttachedClientHosts::GetInstance()->Remove(this);
346 } 348 }
347 349
348 // DevToolsClientHost interface 350 // DevToolsClientHost interface
349 void ExtensionDevToolsClientHost::InspectedContentsClosing() { 351 void ExtensionDevToolsClientHost::InspectedContentsClosing() {
350 SendDetachedEvent(); 352 SendDetachedEvent();
351 delete this; 353 delete this;
352 } 354 }
353 355
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 712
711 void DebuggerGetTargetsFunction::SendTargetList( 713 void DebuggerGetTargetsFunction::SendTargetList(
712 const std::vector<DevToolsTargetImpl*>& target_list) { 714 const std::vector<DevToolsTargetImpl*>& target_list) {
713 scoped_ptr<base::ListValue> result(new base::ListValue()); 715 scoped_ptr<base::ListValue> result(new base::ListValue());
714 for (size_t i = 0; i < target_list.size(); ++i) 716 for (size_t i = 0; i < target_list.size(); ++i)
715 result->Append(SerializeTarget(*target_list[i])); 717 result->Append(SerializeTarget(*target_list[i]));
716 STLDeleteContainerPointers(target_list.begin(), target_list.end()); 718 STLDeleteContainerPointers(target_list.begin(), target_list.end());
717 SetResult(result.release()); 719 SetResult(result.release());
718 SendResponse(true); 720 SendResponse(true);
719 } 721 }
OLDNEW
« no previous file with comments | « chrome/browser/download/download_browsertest.cc ('k') | chrome/browser/extensions/extension_install_ui_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698