OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 #include "chrome/browser/ui/omnibox/location_bar.h" | 106 #include "chrome/browser/ui/omnibox/location_bar.h" |
107 #include "chrome/browser/ui/panels/panel.h" | 107 #include "chrome/browser/ui/panels/panel.h" |
108 #include "chrome/browser/ui/panels/panel_manager.h" | 108 #include "chrome/browser/ui/panels/panel_manager.h" |
109 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" | 109 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" |
110 #include "chrome/browser/ui/status_bubble.h" | 110 #include "chrome/browser/ui/status_bubble.h" |
111 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 111 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
112 #include "chrome/browser/ui/tabs/dock_info.h" | 112 #include "chrome/browser/ui/tabs/dock_info.h" |
113 #include "chrome/browser/ui/tabs/tab_menu_model.h" | 113 #include "chrome/browser/ui/tabs/tab_menu_model.h" |
114 #include "chrome/browser/ui/web_applications/web_app_ui.h" | 114 #include "chrome/browser/ui/web_applications/web_app_ui.h" |
115 #include "chrome/browser/ui/webui/bug_report_ui.h" | 115 #include "chrome/browser/ui/webui/bug_report_ui.h" |
| 116 #include "chrome/browser/ui/webui/chrome_web_ui.h" |
116 #include "chrome/browser/ui/webui/ntp/new_tab_page_handler.h" | 117 #include "chrome/browser/ui/webui/ntp/new_tab_page_handler.h" |
117 #include "chrome/browser/ui/webui/options/content_settings_handler.h" | 118 #include "chrome/browser/ui/webui/options/content_settings_handler.h" |
118 #include "chrome/browser/ui/window_sizer.h" | 119 #include "chrome/browser/ui/window_sizer.h" |
119 #include "chrome/browser/upgrade_detector.h" | 120 #include "chrome/browser/upgrade_detector.h" |
120 #include "chrome/browser/web_applications/web_app.h" | 121 #include "chrome/browser/web_applications/web_app.h" |
121 #include "chrome/common/chrome_constants.h" | 122 #include "chrome/common/chrome_constants.h" |
122 #include "chrome/common/chrome_notification_types.h" | 123 #include "chrome/common/chrome_notification_types.h" |
123 #include "chrome/common/chrome_switches.h" | 124 #include "chrome/common/chrome_switches.h" |
124 #include "chrome/common/custom_handlers/protocol_handler.h" | 125 #include "chrome/common/custom_handlers/protocol_handler.h" |
125 #include "chrome/common/extensions/extension.h" | 126 #include "chrome/common/extensions/extension.h" |
(...skipping 3789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3915 void Browser::ConfirmSetDefaultSearchProvider( | 3916 void Browser::ConfirmSetDefaultSearchProvider( |
3916 TabContents* tab_contents, | 3917 TabContents* tab_contents, |
3917 TemplateURL* template_url, | 3918 TemplateURL* template_url, |
3918 TemplateURLService* template_url_service) { | 3919 TemplateURLService* template_url_service) { |
3919 window()->ConfirmSetDefaultSearchProvider(tab_contents, template_url, | 3920 window()->ConfirmSetDefaultSearchProvider(tab_contents, template_url, |
3920 template_url_service); | 3921 template_url_service); |
3921 } | 3922 } |
3922 | 3923 |
3923 void Browser::ConfirmAddSearchProvider(const TemplateURL* template_url, | 3924 void Browser::ConfirmAddSearchProvider(const TemplateURL* template_url, |
3924 Profile* profile) { | 3925 Profile* profile) { |
3925 window()->ConfirmAddSearchProvider(template_url, profile); | 3926 // If we are using web UI dialogs, then redirect this dialog to the web UI |
| 3927 // version. Otherwise, call the existing framework, which is called by way of |
| 3928 // window()->ConfirmAddSearchProvider. |
| 3929 if (ChromeWebUI::IsMoreWebUI()) { |
| 3930 // Call a clean API to confirm adding a search provider. |
| 3931 browser::ConfirmAddSearchProvider(template_url, profile); |
| 3932 } else { |
| 3933 window()->ConfirmAddSearchProvider(template_url, profile); |
| 3934 } |
3926 } | 3935 } |
3927 | 3936 |
3928 /////////////////////////////////////////////////////////////////////////////// | 3937 /////////////////////////////////////////////////////////////////////////////// |
3929 // Browser, BlockedContentTabHelperDelegate implementation: | 3938 // Browser, BlockedContentTabHelperDelegate implementation: |
3930 | 3939 |
3931 TabContentsWrapper* Browser::GetConstrainingContentsWrapper( | 3940 TabContentsWrapper* Browser::GetConstrainingContentsWrapper( |
3932 TabContentsWrapper* source) { | 3941 TabContentsWrapper* source) { |
3933 return source; | 3942 return source; |
3934 } | 3943 } |
3935 | 3944 |
(...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5274 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); | 5283 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); |
5275 } else if (is_type_tabbed()) { | 5284 } else if (is_type_tabbed()) { |
5276 GlobalErrorService* service = | 5285 GlobalErrorService* service = |
5277 GlobalErrorServiceFactory::GetForProfile(profile()); | 5286 GlobalErrorServiceFactory::GetForProfile(profile()); |
5278 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); | 5287 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); |
5279 if (error) { | 5288 if (error) { |
5280 error->ShowBubbleView(this); | 5289 error->ShowBubbleView(this); |
5281 } | 5290 } |
5282 } | 5291 } |
5283 } | 5292 } |
OLD | NEW |