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 1922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1971 } | 1972 } |
1972 | 1973 |
1973 bool Browser::CanReloadContents(content::WebContents* web_contents) const { | 1974 bool Browser::CanReloadContents(content::WebContents* web_contents) const { |
1974 return chrome::CanReload(this); | 1975 return chrome::CanReload(this); |
1975 } | 1976 } |
1976 | 1977 |
1977 bool Browser::CanSaveContents(content::WebContents* web_contents) const { | 1978 bool Browser::CanSaveContents(content::WebContents* web_contents) const { |
1978 return chrome::CanSavePage(this); | 1979 return chrome::CanSavePage(this); |
1979 } | 1980 } |
1980 | 1981 |
| 1982 bool Browser::RequestAppBanner(content::WebContents* web_contents) { |
| 1983 banners::AppBannerManagerDesktop* manager = |
| 1984 banners::AppBannerManagerDesktop::FromWebContents(web_contents); |
| 1985 if (manager) { |
| 1986 manager->RequestAppBanner(web_contents->GetMainFrame(), |
| 1987 web_contents->GetLastCommittedURL(), true); |
| 1988 return true; |
| 1989 } |
| 1990 return false; |
| 1991 } |
| 1992 |
1981 /////////////////////////////////////////////////////////////////////////////// | 1993 /////////////////////////////////////////////////////////////////////////////// |
1982 // Browser, SearchEngineTabHelperDelegate implementation: | 1994 // Browser, SearchEngineTabHelperDelegate implementation: |
1983 | 1995 |
1984 void Browser::ConfirmAddSearchProvider(TemplateURL* template_url, | 1996 void Browser::ConfirmAddSearchProvider(TemplateURL* template_url, |
1985 Profile* profile) { | 1997 Profile* profile) { |
1986 window()->ConfirmAddSearchProvider(template_url, profile); | 1998 window()->ConfirmAddSearchProvider(template_url, profile); |
1987 } | 1999 } |
1988 | 2000 |
1989 /////////////////////////////////////////////////////////////////////////////// | 2001 /////////////////////////////////////////////////////////////////////////////// |
1990 // Browser, SearchTabHelperDelegate implementation: | 2002 // Browser, SearchTabHelperDelegate implementation: |
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2737 if (contents && !allow_js_access) { | 2749 if (contents && !allow_js_access) { |
2738 contents->web_contents()->GetController().LoadURL( | 2750 contents->web_contents()->GetController().LoadURL( |
2739 target_url, | 2751 target_url, |
2740 content::Referrer(), | 2752 content::Referrer(), |
2741 ui::PAGE_TRANSITION_LINK, | 2753 ui::PAGE_TRANSITION_LINK, |
2742 std::string()); // No extra headers. | 2754 std::string()); // No extra headers. |
2743 } | 2755 } |
2744 | 2756 |
2745 return contents != NULL; | 2757 return contents != NULL; |
2746 } | 2758 } |
OLD | NEW |