OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/automation/chrome_frame_automation_provider.h" | 5 #include "chrome/browser/automation/chrome_frame_automation_provider.h" |
6 #include "chrome/browser/profiles/profile.h" | 6 #include "chrome/browser/profiles/profile.h" |
7 #include "chrome/browser/profiles/profile_manager.h" | 7 #include "chrome/browser/profiles/profile_manager.h" |
8 #include "chrome/common/automation_messages.h" | 8 #include "chrome/common/automation_messages.h" |
9 #include "ipc/ipc_message.h" | 9 #include "ipc/ipc_message.h" |
10 #include "ipc/ipc_channel.h" | 10 #include "ipc/ipc_channel.h" |
11 | 11 |
12 ChromeFrameAutomationProvider::ChromeFrameAutomationProvider(Profile* profile) | 12 ChromeFrameAutomationProvider::ChromeFrameAutomationProvider(Profile* profile) |
13 : AutomationProvider(profile) {} | 13 : AutomationProvider(profile) {} |
14 | 14 |
15 void ChromeFrameAutomationProvider::OnMessageReceived( | 15 bool ChromeFrameAutomationProvider::OnMessageReceived( |
16 const IPC::Message& message) { | 16 const IPC::Message& message) { |
17 if (IsValidMessage(message.type())) { | 17 if (IsValidMessage(message.type())) |
18 AutomationProvider::OnMessageReceived(message); | 18 return AutomationProvider::OnMessageReceived(message); |
19 } else { | 19 |
20 OnUnhandledMessage(message); | 20 OnUnhandledMessage(message); |
21 } | 21 return false; |
22 } | 22 } |
23 | 23 |
24 void ChromeFrameAutomationProvider::OnUnhandledMessage( | 24 void ChromeFrameAutomationProvider::OnUnhandledMessage( |
25 const IPC::Message& message) { | 25 const IPC::Message& message) { |
26 NOTREACHED() << __FUNCTION__ | 26 NOTREACHED() << __FUNCTION__ |
27 << " Unhandled message type: " | 27 << " Unhandled message type: " |
28 << message.type(); | 28 << message.type(); |
29 } | 29 } |
30 | 30 |
31 bool ChromeFrameAutomationProvider::IsValidMessage(uint32 type) { | 31 bool ChromeFrameAutomationProvider::IsValidMessage(uint32 type) { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 break; | 71 break; |
72 } | 72 } |
73 | 73 |
74 default: | 74 default: |
75 break; | 75 break; |
76 } | 76 } |
77 | 77 |
78 return is_valid_message; | 78 return is_valid_message; |
79 } | 79 } |
80 | 80 |
OLD | NEW |