OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/automation_provider.h" | 5 #include "chrome/browser/automation/automation_provider.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/message_box_flags.h" | 8 #include "app/message_box_flags.h" |
9 #include "base/file_version_info.h" | 9 #include "base/file_version_info.h" |
10 #include "base/json_reader.h" | 10 #include "base/json_reader.h" |
(...skipping 2712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2723 LOG(WARNING) << "No browser event name specified through automation"; | 2723 LOG(WARNING) << "No browser event name specified through automation"; |
2724 return false; | 2724 return false; |
2725 } | 2725 } |
2726 | 2726 |
2727 std::string json_args; | 2727 std::string json_args; |
2728 if (!args->GetString(1, &json_args)) { | 2728 if (!args->GetString(1, &json_args)) { |
2729 LOG(WARNING) << "No browser event args specified through automation"; | 2729 LOG(WARNING) << "No browser event args specified through automation"; |
2730 return false; | 2730 return false; |
2731 } | 2731 } |
2732 | 2732 |
2733 ExtensionMessageService::GetInstance(profile()->GetRequestContext())-> | 2733 if (profile()->GetExtensionMessageService()) { |
2734 DispatchEventToRenderers(event_name.c_str(), json_args); | 2734 profile()->GetExtensionMessageService()-> |
| 2735 DispatchEventToRenderers(event_name.c_str(), json_args); |
| 2736 } |
2735 | 2737 |
2736 return true; | 2738 return true; |
2737 } | 2739 } |
2738 #endif // defined(OS_WIN) || defined(OS_LINUX) | 2740 #endif // defined(OS_WIN) || defined(OS_LINUX) |
2739 | 2741 |
2740 TabContents* AutomationProvider::GetTabContentsForHandle( | 2742 TabContents* AutomationProvider::GetTabContentsForHandle( |
2741 int handle, NavigationController** tab) { | 2743 int handle, NavigationController** tab) { |
2742 if (tab_tracker_->ContainsHandle(handle)) { | 2744 if (tab_tracker_->ContainsHandle(handle)) { |
2743 NavigationController* nav_controller = tab_tracker_->GetResource(handle); | 2745 NavigationController* nav_controller = tab_tracker_->GetResource(handle); |
2744 if (tab) | 2746 if (tab) |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3028 if (container) { | 3030 if (container) { |
3029 *count = static_cast<int>(container->GetBlockedPopupCount()); | 3031 *count = static_cast<int>(container->GetBlockedPopupCount()); |
3030 } else { | 3032 } else { |
3031 // If we don't have a container, we don't have any blocked popups to | 3033 // If we don't have a container, we don't have any blocked popups to |
3032 // contain! | 3034 // contain! |
3033 *count = 0; | 3035 *count = 0; |
3034 } | 3036 } |
3035 } | 3037 } |
3036 } | 3038 } |
3037 } | 3039 } |
OLD | NEW |