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

Side by Side Diff: chrome/browser/extensions/chrome_extension_web_contents_observer.cc

Issue 307623004: Move DetailedConsoleMessageAdded from ChromeRVO to ChromeRFO. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make tests pass Created 6 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/extensions/chrome_extension_web_contents_observer.h" 5 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h"
6 6
7 #include "chrome/browser/extensions/api/messaging/message_service.h" 7 #include "chrome/browser/extensions/api/messaging/message_service.h"
8 #include "chrome/browser/extensions/error_console/error_console.h" 8 #include "chrome/browser/extensions/error_console/error_console.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/common/render_messages.h" 10 #include "chrome/common/render_messages.h"
(...skipping 23 matching lines...) Expand all
34 content::RenderViewHost* render_view_host) { 34 content::RenderViewHost* render_view_host) {
35 ReloadIfTerminated(render_view_host); 35 ReloadIfTerminated(render_view_host);
36 ExtensionWebContentsObserver::RenderViewCreated(render_view_host); 36 ExtensionWebContentsObserver::RenderViewCreated(render_view_host);
37 } 37 }
38 38
39 bool ChromeExtensionWebContentsObserver::OnMessageReceived( 39 bool ChromeExtensionWebContentsObserver::OnMessageReceived(
40 const IPC::Message& message) { 40 const IPC::Message& message) {
41 bool handled = true; 41 bool handled = true;
42 IPC_BEGIN_MESSAGE_MAP(ChromeExtensionWebContentsObserver, message) 42 IPC_BEGIN_MESSAGE_MAP(ChromeExtensionWebContentsObserver, message)
43 IPC_MESSAGE_HANDLER(ExtensionHostMsg_PostMessage, OnPostMessage) 43 IPC_MESSAGE_HANDLER(ExtensionHostMsg_PostMessage, OnPostMessage)
44 IPC_MESSAGE_UNHANDLED(handled = false)
45 IPC_END_MESSAGE_MAP()
46 return handled;
47 }
48
49 bool ChromeExtensionWebContentsObserver::OnMessageReceived(
50 const IPC::Message& message,
51 content::RenderFrameHost* render_frame_host) {
52 bool handled = true;
53 IPC_BEGIN_MESSAGE_MAP(ChromeExtensionWebContentsObserver, message)
44 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_DetailedConsoleMessageAdded, 54 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_DetailedConsoleMessageAdded,
45 OnDetailedConsoleMessageAdded) 55 OnDetailedConsoleMessageAdded)
46 IPC_MESSAGE_UNHANDLED(handled = false) 56 IPC_MESSAGE_UNHANDLED(handled = false)
47 IPC_END_MESSAGE_MAP() 57 IPC_END_MESSAGE_MAP()
48 return handled; 58 return handled;
49 } 59 }
50 60
51 void ChromeExtensionWebContentsObserver::OnDetailedConsoleMessageAdded( 61 void ChromeExtensionWebContentsObserver::OnDetailedConsoleMessageAdded(
52 const base::string16& message, 62 const base::string16& message,
53 const base::string16& source, 63 const base::string16& source,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 // TODO(yoz): This reload doesn't happen synchronously for unpacked 105 // TODO(yoz): This reload doesn't happen synchronously for unpacked
96 // extensions. It seems to be fast enough, but there is a race. 106 // extensions. It seems to be fast enough, but there is a race.
97 // We should delay loading until the extension has reloaded. 107 // We should delay loading until the extension has reloaded.
98 if (registry->GetExtensionById(extension_id, ExtensionRegistry::TERMINATED)) { 108 if (registry->GetExtensionById(extension_id, ExtensionRegistry::TERMINATED)) {
99 ExtensionSystem::Get(browser_context())-> 109 ExtensionSystem::Get(browser_context())->
100 extension_service()->ReloadExtension(extension_id); 110 extension_service()->ReloadExtension(extension_id);
101 } 111 }
102 } 112 }
103 113
104 } // namespace extensions 114 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/chrome_extension_web_contents_observer.h ('k') | chrome/browser/extensions/tab_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698