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.h" | 29 #include "base/threading/thread.h" |
30 #include "base/threading/thread_restrictions.h" | 30 #include "base/threading/thread_restrictions.h" |
31 #include "base/time/time.h" | 31 #include "base/time/time.h" |
32 #include "build/build_config.h" | 32 #include "build/build_config.h" |
33 #include "chrome/app/chrome_command_ids.h" | 33 #include "chrome/app/chrome_command_ids.h" |
34 #include "chrome/browser/app_mode/app_mode_utils.h" | 34 #include "chrome/browser/app_mode/app_mode_utils.h" |
35 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 35 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
36 #include "chrome/browser/background/background_contents.h" | 36 #include "chrome/browser/background/background_contents.h" |
37 #include "chrome/browser/background/background_contents_service.h" | 37 #include "chrome/browser/background/background_contents_service.h" |
38 #include "chrome/browser/background/background_contents_service_factory.h" | 38 #include "chrome/browser/background/background_contents_service_factory.h" |
| 39 #include "chrome/browser/banners/app_banner_manager_desktop.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 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1439 bubble_delegate_ptr); | 1440 bubble_delegate_ptr); |
1440 bubble_delegate->set_bluetooth_chooser(bluetooth_chooser_desktop.get()); | 1441 bubble_delegate->set_bluetooth_chooser(bluetooth_chooser_desktop.get()); |
1441 | 1442 |
1442 BubbleReference bubble_controller = | 1443 BubbleReference bubble_controller = |
1443 browser->GetBubbleManager()->ShowBubble(std::move(bubble_delegate)); | 1444 browser->GetBubbleManager()->ShowBubble(std::move(bubble_delegate)); |
1444 bubble_delegate_ptr->set_bubble_controller(bubble_controller); | 1445 bubble_delegate_ptr->set_bubble_controller(bubble_controller); |
1445 | 1446 |
1446 return std::move(bluetooth_chooser_desktop); | 1447 return std::move(bluetooth_chooser_desktop); |
1447 } | 1448 } |
1448 | 1449 |
| 1450 bool Browser::RequestAppBanner(content::WebContents* web_contents) { |
| 1451 banners::AppBannerManagerDesktop* manager = |
| 1452 banners::AppBannerManagerDesktop::FromWebContents(web_contents); |
| 1453 if (manager) { |
| 1454 manager->RequestAppBanner(web_contents->GetMainFrame(), |
| 1455 web_contents->GetLastCommittedURL(), true); |
| 1456 return true; |
| 1457 } |
| 1458 return false; |
| 1459 } |
| 1460 |
1449 bool Browser::IsMouseLocked() const { | 1461 bool Browser::IsMouseLocked() const { |
1450 return exclusive_access_manager_->mouse_lock_controller()->IsMouseLocked(); | 1462 return exclusive_access_manager_->mouse_lock_controller()->IsMouseLocked(); |
1451 } | 1463 } |
1452 | 1464 |
1453 void Browser::OnWindowDidShow() { | 1465 void Browser::OnWindowDidShow() { |
1454 if (window_has_shown_) | 1466 if (window_has_shown_) |
1455 return; | 1467 return; |
1456 window_has_shown_ = true; | 1468 window_has_shown_ = true; |
1457 | 1469 |
1458 startup_metric_utils::RecordBrowserWindowDisplay(base::TimeTicks::Now()); | 1470 startup_metric_utils::RecordBrowserWindowDisplay(base::TimeTicks::Now()); |
(...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2738 if (contents && !allow_js_access) { | 2750 if (contents && !allow_js_access) { |
2739 contents->web_contents()->GetController().LoadURL( | 2751 contents->web_contents()->GetController().LoadURL( |
2740 target_url, | 2752 target_url, |
2741 content::Referrer(), | 2753 content::Referrer(), |
2742 ui::PAGE_TRANSITION_LINK, | 2754 ui::PAGE_TRANSITION_LINK, |
2743 std::string()); // No extra headers. | 2755 std::string()); // No extra headers. |
2744 } | 2756 } |
2745 | 2757 |
2746 return contents != NULL; | 2758 return contents != NULL; |
2747 } | 2759 } |
OLD | NEW |