| 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/automation/automation_provider_observers.h" | 5 #include "chrome/browser/automation/automation_provider_observers.h" |
| 6 | 6 |
| 7 #include <deque> | 7 #include <deque> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 3004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3015 } | 3015 } |
| 3016 | 3016 |
| 3017 ExtensionHost* host = content::Details<ExtensionHost>(details).ptr(); | 3017 ExtensionHost* host = content::Details<ExtensionHost>(details).ptr(); |
| 3018 if (host->extension_id() == extension_id_ && | 3018 if (host->extension_id() == extension_id_ && |
| 3019 host->extension_host_type() == chrome::VIEW_TYPE_EXTENSION_POPUP) { | 3019 host->extension_host_type() == chrome::VIEW_TYPE_EXTENSION_POPUP) { |
| 3020 AutomationJSONReply(automation_, reply_message_.release()) | 3020 AutomationJSONReply(automation_, reply_message_.release()) |
| 3021 .SendSuccess(NULL); | 3021 .SendSuccess(NULL); |
| 3022 delete this; | 3022 delete this; |
| 3023 } | 3023 } |
| 3024 } | 3024 } |
| 3025 |
| 3026 #if defined(OS_LINUX) |
| 3027 WindowMaximizedObserver::WindowMaximizedObserver( |
| 3028 AutomationProvider* automation, |
| 3029 IPC::Message* reply_message) |
| 3030 : automation_(automation->AsWeakPtr()), |
| 3031 reply_message_(reply_message) { |
| 3032 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_WINDOW_MAXIMIZED, |
| 3033 content::NotificationService::AllSources()); |
| 3034 } |
| 3035 |
| 3036 WindowMaximizedObserver::~WindowMaximizedObserver() {} |
| 3037 |
| 3038 void WindowMaximizedObserver::Observe( |
| 3039 int type, |
| 3040 const content::NotificationSource& source, |
| 3041 const content::NotificationDetails& details) { |
| 3042 DCHECK_EQ(chrome::NOTIFICATION_BROWSER_WINDOW_MAXIMIZED, type); |
| 3043 |
| 3044 if (automation_) { |
| 3045 AutomationJSONReply(automation_, reply_message_.release()) |
| 3046 .SendSuccess(NULL); |
| 3047 } |
| 3048 delete this; |
| 3049 } |
| 3050 #endif // defined(OS_LINUX) |
| 3051 |
| OLD | NEW |