Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Side by Side Diff: chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc

Issue 868503003: Enable RSSI proximity check by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698