| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/win/settings_app_monitor.h" | 5 #include "chrome/browser/win/settings_app_monitor.h" |
| 6 | 6 |
| 7 #include <atlbase.h> | 7 #include <atlbase.h> |
| 8 #include <atlcom.h> | 8 #include <atlcom.h> |
| 9 #include <oleauto.h> | 9 #include <oleauto.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 662 if (FAILED(result)) | 662 if (FAILED(result)) |
| 663 delete this; | 663 delete this; |
| 664 } | 664 } |
| 665 | 665 |
| 666 SettingsAppMonitor::Context::Context() : weak_ptr_factory_(this) {} | 666 SettingsAppMonitor::Context::Context() : weak_ptr_factory_(this) {} |
| 667 | 667 |
| 668 SettingsAppMonitor::Context::~Context() { | 668 SettingsAppMonitor::Context::~Context() { |
| 669 DCHECK(task_runner_->BelongsToCurrentThread()); | 669 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 670 | 670 |
| 671 if (event_handler_) { | 671 if (event_handler_) { |
| 672 event_handler_.Release(); | 672 event_handler_.Reset(); |
| 673 automation_->RemoveAllEventHandlers(); | 673 automation_->RemoveAllEventHandlers(); |
| 674 } | 674 } |
| 675 } | 675 } |
| 676 | 676 |
| 677 void SettingsAppMonitor::Context::HandleFocusChangedEvent( | 677 void SettingsAppMonitor::Context::HandleFocusChangedEvent( |
| 678 base::win::ScopedComPtr<IUIAutomationElement> sender) { | 678 base::win::ScopedComPtr<IUIAutomationElement> sender) { |
| 679 DCHECK(task_runner_->BelongsToCurrentThread()); | 679 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 680 | 680 |
| 681 // Duplicate focus changed events are suppressed. | 681 // Duplicate focus changed events are suppressed. |
| 682 ElementType element_type = DetectElementType(automation_.get(), sender.get()); | 682 ElementType element_type = DetectElementType(automation_.get(), sender.get()); |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 delegate_->OnPromoFocused(); | 833 delegate_->OnPromoFocused(); |
| 834 } | 834 } |
| 835 | 835 |
| 836 void SettingsAppMonitor::OnPromoChoiceMade(bool accept_promo) { | 836 void SettingsAppMonitor::OnPromoChoiceMade(bool accept_promo) { |
| 837 DCHECK(thread_checker_.CalledOnValidThread()); | 837 DCHECK(thread_checker_.CalledOnValidThread()); |
| 838 delegate_->OnPromoChoiceMade(accept_promo); | 838 delegate_->OnPromoChoiceMade(accept_promo); |
| 839 } | 839 } |
| 840 | 840 |
| 841 } // namespace win | 841 } // namespace win |
| 842 } // namespace shell_integration | 842 } // namespace shell_integration |
| OLD | NEW |