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.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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 174 #include "components/ui/zoom/zoom_controller.h" | 175 #include "components/ui/zoom/zoom_controller.h" |
| 175 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 176 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 176 #include "content/public/browser/devtools_agent_host.h" | 177 #include "content/public/browser/devtools_agent_host.h" |
| 177 #include "content/public/browser/interstitial_page.h" | 178 #include "content/public/browser/interstitial_page.h" |
| 178 #include "content/public/browser/invalidate_type.h" | 179 #include "content/public/browser/invalidate_type.h" |
| 179 #include "content/public/browser/navigation_controller.h" | 180 #include "content/public/browser/navigation_controller.h" |
| 180 #include "content/public/browser/navigation_entry.h" | 181 #include "content/public/browser/navigation_entry.h" |
| 181 #include "content/public/browser/notification_details.h" | 182 #include "content/public/browser/notification_details.h" |
| 182 #include "content/public/browser/notification_service.h" | 183 #include "content/public/browser/notification_service.h" |
| 183 #include "content/public/browser/plugin_service.h" | 184 #include "content/public/browser/plugin_service.h" |
| 185 #include "content/public/browser/render_frame_host.h" | |
| 184 #include "content/public/browser/render_process_host.h" | 186 #include "content/public/browser/render_process_host.h" |
| 185 #include "content/public/browser/render_view_host.h" | 187 #include "content/public/browser/render_view_host.h" |
| 186 #include "content/public/browser/render_widget_host.h" | 188 #include "content/public/browser/render_widget_host.h" |
| 187 #include "content/public/browser/render_widget_host_view.h" | 189 #include "content/public/browser/render_widget_host_view.h" |
| 188 #include "content/public/browser/security_style_explanation.h" | 190 #include "content/public/browser/security_style_explanation.h" |
| 189 #include "content/public/browser/security_style_explanations.h" | 191 #include "content/public/browser/security_style_explanations.h" |
| 190 #include "content/public/browser/site_instance.h" | 192 #include "content/public/browser/site_instance.h" |
| 191 #include "content/public/browser/user_metrics.h" | 193 #include "content/public/browser/user_metrics.h" |
| 192 #include "content/public/browser/web_contents.h" | 194 #include "content/public/browser/web_contents.h" |
| 193 #include "content/public/common/content_switches.h" | 195 #include "content/public/common/content_switches.h" |
| (...skipping 1777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1971 } | 1973 } |
| 1972 | 1974 |
| 1973 bool Browser::CanReloadContents(content::WebContents* web_contents) const { | 1975 bool Browser::CanReloadContents(content::WebContents* web_contents) const { |
| 1974 return chrome::CanReload(this); | 1976 return chrome::CanReload(this); |
| 1975 } | 1977 } |
| 1976 | 1978 |
| 1977 bool Browser::CanSaveContents(content::WebContents* web_contents) const { | 1979 bool Browser::CanSaveContents(content::WebContents* web_contents) const { |
| 1978 return chrome::CanSavePage(this); | 1980 return chrome::CanSavePage(this); |
| 1979 } | 1981 } |
| 1980 | 1982 |
| 1983 bool Browser::RequestAppBanner(content::WebContents* web_contents) { | |
| 1984 content::RenderFrameHost* frame = web_contents->GetMainFrame(); | |
| 1985 banners::AppBannerManagerDesktop* manager = | |
| 1986 banners::AppBannerManagerDesktop::FromWebContents(web_contents); | |
| 1987 if (manager) { | |
| 1988 manager->RequestAppBanner(frame, frame->GetLastCommittedURL(), true); | |
| 1989 return true; | |
|
dominickn
2016/01/18 23:20:41
Nit: like previously, call this as manager->Reques
horo
2016/01/19 01:45:43
Done.
| |
| 1990 } | |
| 1991 return false; | |
| 1992 } | |
| 1993 | |
| 1981 /////////////////////////////////////////////////////////////////////////////// | 1994 /////////////////////////////////////////////////////////////////////////////// |
| 1982 // Browser, SearchEngineTabHelperDelegate implementation: | 1995 // Browser, SearchEngineTabHelperDelegate implementation: |
| 1983 | 1996 |
| 1984 void Browser::ConfirmAddSearchProvider(TemplateURL* template_url, | 1997 void Browser::ConfirmAddSearchProvider(TemplateURL* template_url, |
| 1985 Profile* profile) { | 1998 Profile* profile) { |
| 1986 window()->ConfirmAddSearchProvider(template_url, profile); | 1999 window()->ConfirmAddSearchProvider(template_url, profile); |
| 1987 } | 2000 } |
| 1988 | 2001 |
| 1989 /////////////////////////////////////////////////////////////////////////////// | 2002 /////////////////////////////////////////////////////////////////////////////// |
| 1990 // Browser, SearchTabHelperDelegate implementation: | 2003 // Browser, SearchTabHelperDelegate implementation: |
| (...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2737 if (contents && !allow_js_access) { | 2750 if (contents && !allow_js_access) { |
| 2738 contents->web_contents()->GetController().LoadURL( | 2751 contents->web_contents()->GetController().LoadURL( |
| 2739 target_url, | 2752 target_url, |
| 2740 content::Referrer(), | 2753 content::Referrer(), |
| 2741 ui::PAGE_TRANSITION_LINK, | 2754 ui::PAGE_TRANSITION_LINK, |
| 2742 std::string()); // No extra headers. | 2755 std::string()); // No extra headers. |
| 2743 } | 2756 } |
| 2744 | 2757 |
| 2745 return contents != NULL; | 2758 return contents != NULL; |
| 2746 } | 2759 } |
| OLD | NEW |