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 1427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1438 | 1438 |
1439 Browser* browser = chrome::FindBrowserWithWebContents( | 1439 Browser* browser = chrome::FindBrowserWithWebContents( |
1440 WebContents::FromRenderFrameHost(frame)); | 1440 WebContents::FromRenderFrameHost(frame)); |
1441 BubbleReference bubble_reference = | 1441 BubbleReference bubble_reference = |
1442 browser->GetBubbleManager()->ShowBubble(std::move(bubble_controller)); | 1442 browser->GetBubbleManager()->ShowBubble(std::move(bubble_controller)); |
1443 bubble_controller_ptr->set_bubble_reference(bubble_reference); | 1443 bubble_controller_ptr->set_bubble_reference(bubble_reference); |
1444 | 1444 |
1445 return std::move(bluetooth_chooser_desktop); | 1445 return std::move(bluetooth_chooser_desktop); |
1446 } | 1446 } |
1447 | 1447 |
| 1448 void Browser::RequestAppBannerFromDevTools(content::WebContents* web_contents) { |
| 1449 banners::AppBannerManagerDesktop::CreateForWebContents(web_contents); |
| 1450 RequestAppBanner(web_contents); |
| 1451 } |
| 1452 |
1448 bool Browser::RequestAppBanner(content::WebContents* web_contents) { | 1453 bool Browser::RequestAppBanner(content::WebContents* web_contents) { |
1449 banners::AppBannerManagerDesktop* manager = | 1454 banners::AppBannerManagerDesktop* manager = |
1450 banners::AppBannerManagerDesktop::FromWebContents(web_contents); | 1455 banners::AppBannerManagerDesktop::FromWebContents(web_contents); |
1451 if (manager) { | 1456 if (manager) { |
1452 manager->RequestAppBanner(web_contents->GetMainFrame(), | 1457 manager->RequestAppBanner(web_contents->GetMainFrame(), |
1453 web_contents->GetLastCommittedURL(), true); | 1458 web_contents->GetLastCommittedURL(), true); |
1454 return true; | 1459 return true; |
1455 } | 1460 } |
1456 | 1461 |
1457 web_contents->GetMainFrame()->AddMessageToConsole( | 1462 web_contents->GetMainFrame()->AddMessageToConsole( |
(...skipping 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2740 if (contents && !allow_js_access) { | 2745 if (contents && !allow_js_access) { |
2741 contents->web_contents()->GetController().LoadURL( | 2746 contents->web_contents()->GetController().LoadURL( |
2742 target_url, | 2747 target_url, |
2743 content::Referrer(), | 2748 content::Referrer(), |
2744 ui::PAGE_TRANSITION_LINK, | 2749 ui::PAGE_TRANSITION_LINK, |
2745 std::string()); // No extra headers. | 2750 std::string()); // No extra headers. |
2746 } | 2751 } |
2747 | 2752 |
2748 return contents != NULL; | 2753 return contents != NULL; |
2749 } | 2754 } |
OLD | NEW |