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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 #include "components/ui/zoom/zoom_controller.h" | 175 #include "components/ui/zoom/zoom_controller.h" |
176 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 176 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
177 #include "content/public/browser/devtools_agent_host.h" | 177 #include "content/public/browser/devtools_agent_host.h" |
178 #include "content/public/browser/interstitial_page.h" | 178 #include "content/public/browser/interstitial_page.h" |
179 #include "content/public/browser/invalidate_type.h" | 179 #include "content/public/browser/invalidate_type.h" |
180 #include "content/public/browser/navigation_controller.h" | 180 #include "content/public/browser/navigation_controller.h" |
181 #include "content/public/browser/navigation_entry.h" | 181 #include "content/public/browser/navigation_entry.h" |
182 #include "content/public/browser/notification_details.h" | 182 #include "content/public/browser/notification_details.h" |
183 #include "content/public/browser/notification_service.h" | 183 #include "content/public/browser/notification_service.h" |
184 #include "content/public/browser/plugin_service.h" | 184 #include "content/public/browser/plugin_service.h" |
| 185 #include "content/public/browser/render_frame_host.h" |
185 #include "content/public/browser/render_process_host.h" | 186 #include "content/public/browser/render_process_host.h" |
186 #include "content/public/browser/render_view_host.h" | 187 #include "content/public/browser/render_view_host.h" |
187 #include "content/public/browser/render_widget_host.h" | 188 #include "content/public/browser/render_widget_host.h" |
188 #include "content/public/browser/render_widget_host_view.h" | 189 #include "content/public/browser/render_widget_host_view.h" |
189 #include "content/public/browser/security_style_explanation.h" | 190 #include "content/public/browser/security_style_explanation.h" |
190 #include "content/public/browser/security_style_explanations.h" | 191 #include "content/public/browser/security_style_explanations.h" |
191 #include "content/public/browser/site_instance.h" | 192 #include "content/public/browser/site_instance.h" |
192 #include "content/public/browser/user_metrics.h" | 193 #include "content/public/browser/user_metrics.h" |
193 #include "content/public/browser/web_contents.h" | 194 #include "content/public/browser/web_contents.h" |
194 #include "content/public/common/content_switches.h" | 195 #include "content/public/common/content_switches.h" |
(...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1448 } | 1449 } |
1449 | 1450 |
1450 bool Browser::RequestAppBanner(content::WebContents* web_contents) { | 1451 bool Browser::RequestAppBanner(content::WebContents* web_contents) { |
1451 banners::AppBannerManagerDesktop* manager = | 1452 banners::AppBannerManagerDesktop* manager = |
1452 banners::AppBannerManagerDesktop::FromWebContents(web_contents); | 1453 banners::AppBannerManagerDesktop::FromWebContents(web_contents); |
1453 if (manager) { | 1454 if (manager) { |
1454 manager->RequestAppBanner(web_contents->GetMainFrame(), | 1455 manager->RequestAppBanner(web_contents->GetMainFrame(), |
1455 web_contents->GetLastCommittedURL(), true); | 1456 web_contents->GetLastCommittedURL(), true); |
1456 return true; | 1457 return true; |
1457 } | 1458 } |
| 1459 |
| 1460 web_contents->GetMainFrame()->AddMessageToConsole( |
| 1461 content::CONSOLE_MESSAGE_LEVEL_DEBUG, |
| 1462 "App banners are currently disabled. Please check chrome://flags/#" + |
| 1463 std::string(switches::kEnableAddToShelf)); |
1458 return false; | 1464 return false; |
1459 } | 1465 } |
1460 | 1466 |
1461 bool Browser::IsMouseLocked() const { | 1467 bool Browser::IsMouseLocked() const { |
1462 return exclusive_access_manager_->mouse_lock_controller()->IsMouseLocked(); | 1468 return exclusive_access_manager_->mouse_lock_controller()->IsMouseLocked(); |
1463 } | 1469 } |
1464 | 1470 |
1465 void Browser::OnWindowDidShow() { | 1471 void Browser::OnWindowDidShow() { |
1466 if (window_has_shown_) | 1472 if (window_has_shown_) |
1467 return; | 1473 return; |
(...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2735 if (contents && !allow_js_access) { | 2741 if (contents && !allow_js_access) { |
2736 contents->web_contents()->GetController().LoadURL( | 2742 contents->web_contents()->GetController().LoadURL( |
2737 target_url, | 2743 target_url, |
2738 content::Referrer(), | 2744 content::Referrer(), |
2739 ui::PAGE_TRANSITION_LINK, | 2745 ui::PAGE_TRANSITION_LINK, |
2740 std::string()); // No extra headers. | 2746 std::string()); // No extra headers. |
2741 } | 2747 } |
2742 | 2748 |
2743 return contents != NULL; | 2749 return contents != NULL; |
2744 } | 2750 } |
OLD | NEW |