OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <string> | 10 #include <string> |
(...skipping 1416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1427 } | 1427 } |
1428 | 1428 |
1429 scoped_ptr<content::BluetoothChooser> Browser::RunBluetoothChooser( | 1429 scoped_ptr<content::BluetoothChooser> Browser::RunBluetoothChooser( |
1430 content::WebContents* web_contents, | 1430 content::WebContents* web_contents, |
1431 const content::BluetoothChooser::EventHandler& event_handler, | 1431 const content::BluetoothChooser::EventHandler& event_handler, |
1432 const GURL& origin) { | 1432 const GURL& origin) { |
1433 scoped_ptr<BluetoothChooserDesktop> bluetooth_chooser_desktop( | 1433 scoped_ptr<BluetoothChooserDesktop> bluetooth_chooser_desktop( |
1434 new BluetoothChooserDesktop(event_handler)); | 1434 new BluetoothChooserDesktop(event_handler)); |
1435 Browser* browser = chrome::FindBrowserWithWebContents(web_contents); | 1435 Browser* browser = chrome::FindBrowserWithWebContents(web_contents); |
1436 scoped_ptr<BluetoothChooserBubbleDelegate> bubble_delegate( | 1436 scoped_ptr<BluetoothChooserBubbleDelegate> bubble_delegate( |
1437 new BluetoothChooserBubbleDelegate(browser)); | 1437 new BluetoothChooserBubbleDelegate(browser, web_contents, origin)); |
1438 BluetoothChooserBubbleDelegate* bubble_delegate_ptr = bubble_delegate.get(); | 1438 BluetoothChooserBubbleDelegate* bubble_delegate_ptr = bubble_delegate.get(); |
1439 | 1439 |
1440 // Wire the ChooserBubbleDelegate to the BluetoothChooser. | 1440 // Wire the ChooserBubbleDelegate to the BluetoothChooser. |
1441 bluetooth_chooser_desktop->set_bluetooth_chooser_bubble_delegate( | 1441 bluetooth_chooser_desktop->set_bluetooth_chooser_bubble_delegate( |
1442 bubble_delegate_ptr); | 1442 bubble_delegate_ptr); |
1443 bubble_delegate->set_bluetooth_chooser(bluetooth_chooser_desktop.get()); | 1443 bubble_delegate->set_bluetooth_chooser(bluetooth_chooser_desktop.get()); |
1444 | 1444 |
1445 BubbleReference bubble_controller = | 1445 BubbleReference bubble_controller = |
1446 browser->GetBubbleManager()->ShowBubble(std::move(bubble_delegate)); | 1446 browser->GetBubbleManager()->ShowBubble(std::move(bubble_delegate)); |
1447 bubble_delegate_ptr->set_bubble_controller(bubble_controller); | 1447 bubble_delegate_ptr->set_bubble_controller(bubble_controller); |
(...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2738 if (contents && !allow_js_access) { | 2738 if (contents && !allow_js_access) { |
2739 contents->web_contents()->GetController().LoadURL( | 2739 contents->web_contents()->GetController().LoadURL( |
2740 target_url, | 2740 target_url, |
2741 content::Referrer(), | 2741 content::Referrer(), |
2742 ui::PAGE_TRANSITION_LINK, | 2742 ui::PAGE_TRANSITION_LINK, |
2743 std::string()); // No extra headers. | 2743 std::string()); // No extra headers. |
2744 } | 2744 } |
2745 | 2745 |
2746 return contents != NULL; | 2746 return contents != NULL; |
2747 } | 2747 } |
OLD | NEW |