Chromium Code Reviews| 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 18 matching lines...) Expand all Loading... | |
| 29 #include "base/threading/thread_restrictions.h" | 29 #include "base/threading/thread_restrictions.h" |
| 30 #include "base/time/time.h" | 30 #include "base/time/time.h" |
| 31 #include "build/build_config.h" | 31 #include "build/build_config.h" |
| 32 #include "chrome/app/chrome_command_ids.h" | 32 #include "chrome/app/chrome_command_ids.h" |
| 33 #include "chrome/browser/app_mode/app_mode_utils.h" | 33 #include "chrome/browser/app_mode/app_mode_utils.h" |
| 34 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 34 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
| 35 #include "chrome/browser/background/background_contents.h" | 35 #include "chrome/browser/background/background_contents.h" |
| 36 #include "chrome/browser/background/background_contents_service.h" | 36 #include "chrome/browser/background/background_contents_service.h" |
| 37 #include "chrome/browser/background/background_contents_service_factory.h" | 37 #include "chrome/browser/background/background_contents_service_factory.h" |
| 38 #include "chrome/browser/banners/app_banner_manager_desktop.h" | 38 #include "chrome/browser/banners/app_banner_manager_desktop.h" |
| 39 #include "chrome/browser/banners/app_banner_manager_emulation.h" | |
| 39 #include "chrome/browser/browser_process.h" | 40 #include "chrome/browser/browser_process.h" |
| 40 #include "chrome/browser/browser_shutdown.h" | 41 #include "chrome/browser/browser_shutdown.h" |
| 41 #include "chrome/browser/character_encoding.h" | 42 #include "chrome/browser/character_encoding.h" |
| 42 #include "chrome/browser/chrome_notification_types.h" | 43 #include "chrome/browser/chrome_notification_types.h" |
| 43 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 44 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 44 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 45 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
| 45 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" | 46 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" |
| 46 #include "chrome/browser/custom_handlers/register_protocol_handler_permission_re quest.h" | 47 #include "chrome/browser/custom_handlers/register_protocol_handler_permission_re quest.h" |
| 47 #include "chrome/browser/defaults.h" | 48 #include "chrome/browser/defaults.h" |
| 48 #include "chrome/browser/devtools/devtools_toggle_action.h" | 49 #include "chrome/browser/devtools/devtools_toggle_action.h" |
| (...skipping 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1440 Browser* browser = chrome::FindBrowserWithWebContents( | 1441 Browser* browser = chrome::FindBrowserWithWebContents( |
| 1441 WebContents::FromRenderFrameHost(frame)); | 1442 WebContents::FromRenderFrameHost(frame)); |
| 1442 BubbleReference bubble_reference = | 1443 BubbleReference bubble_reference = |
| 1443 browser->GetBubbleManager()->ShowBubble(std::move(bubble_controller)); | 1444 browser->GetBubbleManager()->ShowBubble(std::move(bubble_controller)); |
| 1444 bubble_controller_ptr->set_bubble_reference(bubble_reference); | 1445 bubble_controller_ptr->set_bubble_reference(bubble_reference); |
| 1445 | 1446 |
| 1446 return std::move(bluetooth_chooser_desktop); | 1447 return std::move(bluetooth_chooser_desktop); |
| 1447 } | 1448 } |
| 1448 | 1449 |
| 1449 void Browser::RequestAppBannerFromDevTools(content::WebContents* web_contents) { | 1450 void Browser::RequestAppBannerFromDevTools(content::WebContents* web_contents) { |
| 1450 banners::AppBannerManagerDesktop::CreateForWebContents(web_contents); | 1451 banners::AppBannerManagerEmulation::CreateForWebContents(web_contents); |
| 1451 RequestAppBanner(web_contents); | 1452 banners::AppBannerManagerEmulation* manager = |
| 1453 banners::AppBannerManagerEmulation::FromWebContents(web_contents); | |
| 1454 manager->RequestAppBanner(web_contents->GetMainFrame(), | |
| 1455 web_contents->GetLastCommittedURL(), true); | |
| 1452 } | 1456 } |
| 1453 | 1457 |
| 1454 bool Browser::RequestAppBanner(content::WebContents* web_contents) { | 1458 bool Browser::RequestAppBanner(content::WebContents* web_contents) { |
|
dominickn
2016/05/06 18:29:47
Nit: it looks like this method isn't called from a
dominickn
2016/05/06 18:42:38
Ping?
pfeldman
2016/05/06 19:32:05
I did not realize that. Done.
| |
| 1455 banners::AppBannerManagerDesktop* manager = | 1459 banners::AppBannerManagerDesktop* manager = |
| 1456 banners::AppBannerManagerDesktop::FromWebContents(web_contents); | 1460 banners::AppBannerManagerDesktop::FromWebContents(web_contents); |
| 1457 if (manager) { | 1461 if (manager) { |
| 1458 manager->RequestAppBanner(web_contents->GetMainFrame(), | 1462 manager->RequestAppBanner(web_contents->GetMainFrame(), |
| 1459 web_contents->GetLastCommittedURL(), true); | 1463 web_contents->GetLastCommittedURL(), true); |
| 1460 return true; | 1464 return true; |
| 1461 } | 1465 } |
| 1462 | 1466 |
| 1463 web_contents->GetMainFrame()->AddMessageToConsole( | 1467 web_contents->GetMainFrame()->AddMessageToConsole( |
| 1464 content::CONSOLE_MESSAGE_LEVEL_DEBUG, | 1468 content::CONSOLE_MESSAGE_LEVEL_DEBUG, |
| (...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2745 if (contents && !allow_js_access) { | 2749 if (contents && !allow_js_access) { |
| 2746 contents->web_contents()->GetController().LoadURL( | 2750 contents->web_contents()->GetController().LoadURL( |
| 2747 target_url, | 2751 target_url, |
| 2748 content::Referrer(), | 2752 content::Referrer(), |
| 2749 ui::PAGE_TRANSITION_LINK, | 2753 ui::PAGE_TRANSITION_LINK, |
| 2750 std::string()); // No extra headers. | 2754 std::string()); // No extra headers. |
| 2751 } | 2755 } |
| 2752 | 2756 |
| 2753 return contents != NULL; | 2757 return contents != NULL; |
| 2754 } | 2758 } |
| OLD | NEW |