| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 #include "chrome/browser/sync/profile_sync_service_factory.h" | 80 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 81 #include "chrome/browser/sync/sync_ui_util.h" | 81 #include "chrome/browser/sync/sync_ui_util.h" |
| 82 #include "chrome/browser/tab_contents/retargeting_details.h" | 82 #include "chrome/browser/tab_contents/retargeting_details.h" |
| 83 #include "chrome/browser/tab_contents/tab_util.h" | 83 #include "chrome/browser/tab_contents/tab_util.h" |
| 84 #include "chrome/browser/task_management/web_contents_tags.h" | 84 #include "chrome/browser/task_management/web_contents_tags.h" |
| 85 #include "chrome/browser/themes/theme_service.h" | 85 #include "chrome/browser/themes/theme_service.h" |
| 86 #include "chrome/browser/themes/theme_service_factory.h" | 86 #include "chrome/browser/themes/theme_service_factory.h" |
| 87 #include "chrome/browser/translate/chrome_translate_client.h" | 87 #include "chrome/browser/translate/chrome_translate_client.h" |
| 88 #include "chrome/browser/ui/autofill/chrome_autofill_client.h" | 88 #include "chrome/browser/ui/autofill/chrome_autofill_client.h" |
| 89 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" | 89 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" |
| 90 #include "chrome/browser/ui/bluetooth/bluetooth_chooser_bubble_delegate.h" | 90 #include "chrome/browser/ui/bluetooth/bluetooth_chooser_bubble_controller.h" |
| 91 #include "chrome/browser/ui/bluetooth/bluetooth_chooser_desktop.h" | 91 #include "chrome/browser/ui/bluetooth/bluetooth_chooser_desktop.h" |
| 92 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" | 92 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" |
| 93 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" | 93 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" |
| 94 #include "chrome/browser/ui/browser_command_controller.h" | 94 #include "chrome/browser/ui/browser_command_controller.h" |
| 95 #include "chrome/browser/ui/browser_commands.h" | 95 #include "chrome/browser/ui/browser_commands.h" |
| 96 #include "chrome/browser/ui/browser_content_setting_bubble_model_delegate.h" | 96 #include "chrome/browser/ui/browser_content_setting_bubble_model_delegate.h" |
| 97 #include "chrome/browser/ui/browser_dialogs.h" | 97 #include "chrome/browser/ui/browser_dialogs.h" |
| 98 #include "chrome/browser/ui/browser_finder.h" | 98 #include "chrome/browser/ui/browser_finder.h" |
| 99 #include "chrome/browser/ui/browser_instant_controller.h" | 99 #include "chrome/browser/ui/browser_instant_controller.h" |
| 100 #include "chrome/browser/ui/browser_list.h" | 100 #include "chrome/browser/ui/browser_list.h" |
| (...skipping 1311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1412 DevToolsWindow::GetInstanceForInspectedWebContents(web_contents); | 1412 DevToolsWindow::GetInstanceForInspectedWebContents(web_contents); |
| 1413 if (devtools_window) | 1413 if (devtools_window) |
| 1414 devtools_window->ShowCertificateViewer(cert_id); | 1414 devtools_window->ShowCertificateViewer(cert_id); |
| 1415 } | 1415 } |
| 1416 | 1416 |
| 1417 scoped_ptr<content::BluetoothChooser> Browser::RunBluetoothChooser( | 1417 scoped_ptr<content::BluetoothChooser> Browser::RunBluetoothChooser( |
| 1418 content::RenderFrameHost* frame, | 1418 content::RenderFrameHost* frame, |
| 1419 const content::BluetoothChooser::EventHandler& event_handler) { | 1419 const content::BluetoothChooser::EventHandler& event_handler) { |
| 1420 scoped_ptr<BluetoothChooserDesktop> bluetooth_chooser_desktop( | 1420 scoped_ptr<BluetoothChooserDesktop> bluetooth_chooser_desktop( |
| 1421 new BluetoothChooserDesktop(event_handler)); | 1421 new BluetoothChooserDesktop(event_handler)); |
| 1422 scoped_ptr<BluetoothChooserBubbleDelegate> bubble_delegate( | 1422 scoped_ptr<BluetoothChooserBubbleController> bubble_controller( |
| 1423 new BluetoothChooserBubbleDelegate(frame)); | 1423 new BluetoothChooserBubbleController(frame)); |
| 1424 BluetoothChooserBubbleDelegate* bubble_delegate_ptr = bubble_delegate.get(); | 1424 BluetoothChooserBubbleController* bubble_controller_ptr = |
| 1425 bubble_controller.get(); |
| 1425 | 1426 |
| 1426 // Wire the ChooserBubbleDelegate to the BluetoothChooser. | 1427 // Wire the ChooserBubbleController to the BluetoothChooser. |
| 1427 bluetooth_chooser_desktop->set_bluetooth_chooser_bubble_delegate( | 1428 bluetooth_chooser_desktop->set_bluetooth_chooser_bubble_controller( |
| 1428 bubble_delegate_ptr); | 1429 bubble_controller_ptr); |
| 1429 bubble_delegate->set_bluetooth_chooser(bluetooth_chooser_desktop.get()); | 1430 bubble_controller->set_bluetooth_chooser(bluetooth_chooser_desktop.get()); |
| 1430 | 1431 |
| 1431 Browser* browser = chrome::FindBrowserWithWebContents( | 1432 Browser* browser = chrome::FindBrowserWithWebContents( |
| 1432 WebContents::FromRenderFrameHost(frame)); | 1433 WebContents::FromRenderFrameHost(frame)); |
| 1433 BubbleReference bubble_controller = | 1434 BubbleReference bubble_reference = |
| 1434 browser->GetBubbleManager()->ShowBubble(std::move(bubble_delegate)); | 1435 browser->GetBubbleManager()->ShowBubble(std::move(bubble_controller)); |
| 1435 bubble_delegate_ptr->set_bubble_controller(bubble_controller); | 1436 bubble_controller_ptr->set_bubble_reference(bubble_reference); |
| 1436 | 1437 |
| 1437 return std::move(bluetooth_chooser_desktop); | 1438 return std::move(bluetooth_chooser_desktop); |
| 1438 } | 1439 } |
| 1439 | 1440 |
| 1440 bool Browser::RequestAppBanner(content::WebContents* web_contents) { | 1441 bool Browser::RequestAppBanner(content::WebContents* web_contents) { |
| 1441 banners::AppBannerManagerDesktop* manager = | 1442 banners::AppBannerManagerDesktop* manager = |
| 1442 banners::AppBannerManagerDesktop::FromWebContents(web_contents); | 1443 banners::AppBannerManagerDesktop::FromWebContents(web_contents); |
| 1443 if (manager) { | 1444 if (manager) { |
| 1444 manager->RequestAppBanner(web_contents->GetMainFrame(), | 1445 manager->RequestAppBanner(web_contents->GetMainFrame(), |
| 1445 web_contents->GetLastCommittedURL(), true); | 1446 web_contents->GetLastCommittedURL(), true); |
| (...skipping 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2732 if (contents && !allow_js_access) { | 2733 if (contents && !allow_js_access) { |
| 2733 contents->web_contents()->GetController().LoadURL( | 2734 contents->web_contents()->GetController().LoadURL( |
| 2734 target_url, | 2735 target_url, |
| 2735 content::Referrer(), | 2736 content::Referrer(), |
| 2736 ui::PAGE_TRANSITION_LINK, | 2737 ui::PAGE_TRANSITION_LINK, |
| 2737 std::string()); // No extra headers. | 2738 std::string()); // No extra headers. |
| 2738 } | 2739 } |
| 2739 | 2740 |
| 2740 return contents != NULL; | 2741 return contents != NULL; |
| 2741 } | 2742 } |
| OLD | NEW |