OLD | NEW |
---|---|
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/api/easy_unlock_private/easy_unlock_private_ api.h" | 5 #include "chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_ api.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
693 EasyUnlockPrivateGetConnectionInfoFunction:: | 693 EasyUnlockPrivateGetConnectionInfoFunction:: |
694 EasyUnlockPrivateGetConnectionInfoFunction() { | 694 EasyUnlockPrivateGetConnectionInfoFunction() { |
695 } | 695 } |
696 | 696 |
697 EasyUnlockPrivateGetConnectionInfoFunction:: | 697 EasyUnlockPrivateGetConnectionInfoFunction:: |
698 ~EasyUnlockPrivateGetConnectionInfoFunction() { | 698 ~EasyUnlockPrivateGetConnectionInfoFunction() { |
699 } | 699 } |
700 | 700 |
701 bool EasyUnlockPrivateGetConnectionInfoFunction::DoWork( | 701 bool EasyUnlockPrivateGetConnectionInfoFunction::DoWork( |
702 scoped_refptr<device::BluetoothAdapter> adapter) { | 702 scoped_refptr<device::BluetoothAdapter> adapter) { |
703 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | |
704 proximity_auth::switches::kEnableProximityDetection)) { | |
705 SetError("Turn on 'enable-easy-unlock-proximity-detection' flag."); | |
706 SendResponse(false); | |
707 return true; | |
708 } | |
Ilya Sherman
2015/02/05 23:59:41
Please remove the flag as well. Or, if we're not
Tim Song
2015/02/06 00:43:01
I'll do that in another CL. Basically, I want to d
| |
709 | |
710 scoped_ptr<easy_unlock_private::GetConnectionInfo::Params> params = | 703 scoped_ptr<easy_unlock_private::GetConnectionInfo::Params> params = |
711 easy_unlock_private::GetConnectionInfo::Params::Create(*args_); | 704 easy_unlock_private::GetConnectionInfo::Params::Create(*args_); |
712 EXTENSION_FUNCTION_VALIDATE(params); | 705 EXTENSION_FUNCTION_VALIDATE(params); |
713 | 706 |
714 device::BluetoothDevice* device = adapter->GetDevice(params->device_address); | 707 device::BluetoothDevice* device = adapter->GetDevice(params->device_address); |
715 | 708 |
716 std::string error; | 709 std::string error; |
717 if (!device) | 710 if (!device) |
718 error = "Invalid Bluetooth device."; | 711 error = "Invalid Bluetooth device."; |
719 else if (!device->IsConnected()) | 712 else if (!device->IsConnected()) |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
778 gfx::Range(params->link_range.start, params->link_range.end), | 771 gfx::Range(params->link_range.start, params->link_range.end), |
779 GURL(params->link_target), anchor_rect, web_contents); | 772 GURL(params->link_target), anchor_rect, web_contents); |
780 #else | 773 #else |
781 SetError("Not supported on non-Views platforms."); | 774 SetError("Not supported on non-Views platforms."); |
782 #endif | 775 #endif |
783 return true; | 776 return true; |
784 } | 777 } |
785 | 778 |
786 } // namespace api | 779 } // namespace api |
787 } // namespace extensions | 780 } // namespace extensions |
OLD | NEW |