OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/public/browser/bluetooth_chooser.h" | 5 #include "content/public/browser/bluetooth_chooser.h" |
6 | 6 |
| 7 #include "content/public/browser/web_contents_delegate.h" |
| 8 #include "ui/base/page_transition_types.h" |
| 9 |
| 10 namespace { |
| 11 |
| 12 // TODO(finnur): These need to be actual HC article links. |
| 13 const char kOverviewURL[] = "https://www.google.com/?gws_rd=ssl#q=overview"; |
| 14 const char kPairingURL[] = "https://www.google.com/?gws_rd=ssl#q=pairing"; |
| 15 const char kAdapterOffURL[] = "https://www.google.com/?gws_rd=ssl#q=adapteroff"; |
| 16 |
| 17 void ShowLink(content::WebContents* web_contents, const GURL& link) { |
| 18 content::OpenURLParams params = content::OpenURLParams( |
| 19 link, |
| 20 content::Referrer(), |
| 21 NEW_FOREGROUND_TAB, |
| 22 ui::PageTransition::PAGE_TRANSITION_LINK, |
| 23 false); |
| 24 content::WebContentsDelegate* delegate = web_contents->GetDelegate(); |
| 25 delegate->OpenURLFromTab(web_contents, params); |
| 26 } |
| 27 |
| 28 } // namespace |
| 29 |
7 namespace content { | 30 namespace content { |
8 | 31 |
9 BluetoothChooser::~BluetoothChooser() {} | 32 BluetoothChooser::~BluetoothChooser() {} |
10 | 33 |
| 34 void BluetoothChooser::ShowOverviewLink( |
| 35 content::WebContents* web_contents) { |
| 36 ShowLink(web_contents, GURL(kOverviewURL)); |
| 37 } |
| 38 |
| 39 void BluetoothChooser::ShowPairingLink( |
| 40 content::WebContents* web_contents) { |
| 41 ShowLink(web_contents, GURL(kPairingURL)); |
| 42 } |
| 43 |
| 44 void BluetoothChooser::ShowAdapterOffLink( |
| 45 content::WebContents* web_contents) { |
| 46 ShowLink(web_contents, GURL(kAdapterOffURL)); |
| 47 |
| 48 } |
| 49 |
| 50 |
11 } // namespace content | 51 } // namespace content |
OLD | NEW |