Chromium Code Reviews| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 105 #include "chrome/browser/ui/omnibox/location_bar.h" | 105 #include "chrome/browser/ui/omnibox/location_bar.h" |
| 106 #include "chrome/browser/ui/panels/panel.h" | 106 #include "chrome/browser/ui/panels/panel.h" |
| 107 #include "chrome/browser/ui/panels/panel_manager.h" | 107 #include "chrome/browser/ui/panels/panel_manager.h" |
| 108 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" | 108 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" |
| 109 #include "chrome/browser/ui/status_bubble.h" | 109 #include "chrome/browser/ui/status_bubble.h" |
| 110 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 110 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 111 #include "chrome/browser/ui/tabs/dock_info.h" | 111 #include "chrome/browser/ui/tabs/dock_info.h" |
| 112 #include "chrome/browser/ui/tabs/tab_menu_model.h" | 112 #include "chrome/browser/ui/tabs/tab_menu_model.h" |
| 113 #include "chrome/browser/ui/web_applications/web_app_ui.h" | 113 #include "chrome/browser/ui/web_applications/web_app_ui.h" |
| 114 #include "chrome/browser/ui/webui/bug_report_ui.h" | 114 #include "chrome/browser/ui/webui/bug_report_ui.h" |
| 115 #include "chrome/browser/ui/webui/chrome_web_ui.h" | |
| 115 #include "chrome/browser/ui/webui/ntp/new_tab_page_handler.h" | 116 #include "chrome/browser/ui/webui/ntp/new_tab_page_handler.h" |
| 116 #include "chrome/browser/ui/webui/options/content_settings_handler.h" | 117 #include "chrome/browser/ui/webui/options/content_settings_handler.h" |
| 117 #include "chrome/browser/ui/window_sizer.h" | 118 #include "chrome/browser/ui/window_sizer.h" |
| 118 #include "chrome/browser/upgrade_detector.h" | 119 #include "chrome/browser/upgrade_detector.h" |
| 119 #include "chrome/browser/web_applications/web_app.h" | 120 #include "chrome/browser/web_applications/web_app.h" |
| 120 #include "chrome/common/chrome_constants.h" | 121 #include "chrome/common/chrome_constants.h" |
| 121 #include "chrome/common/chrome_notification_types.h" | 122 #include "chrome/common/chrome_notification_types.h" |
| 122 #include "chrome/common/chrome_switches.h" | 123 #include "chrome/common/chrome_switches.h" |
| 123 #include "chrome/common/custom_handlers/protocol_handler.h" | 124 #include "chrome/common/custom_handlers/protocol_handler.h" |
| 124 #include "chrome/common/extensions/extension.h" | 125 #include "chrome/common/extensions/extension.h" |
| (...skipping 3768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3893 void Browser::ConfirmSetDefaultSearchProvider( | 3894 void Browser::ConfirmSetDefaultSearchProvider( |
| 3894 TabContents* tab_contents, | 3895 TabContents* tab_contents, |
| 3895 TemplateURL* template_url, | 3896 TemplateURL* template_url, |
| 3896 TemplateURLService* template_url_service) { | 3897 TemplateURLService* template_url_service) { |
| 3897 window()->ConfirmSetDefaultSearchProvider(tab_contents, template_url, | 3898 window()->ConfirmSetDefaultSearchProvider(tab_contents, template_url, |
| 3898 template_url_service); | 3899 template_url_service); |
| 3899 } | 3900 } |
| 3900 | 3901 |
| 3901 void Browser::ConfirmAddSearchProvider(const TemplateURL* template_url, | 3902 void Browser::ConfirmAddSearchProvider(const TemplateURL* template_url, |
| 3902 Profile* profile) { | 3903 Profile* profile) { |
| 3904 // If we are using web UI dialogs, then redirect this dialog to the web UI | |
| 3905 // version. Otherwise, call the existing framework, which is called by way of | |
| 3906 // window()->ConfirmAddSearchProvider. | |
| 3907 if (ChromeWebUI::IsMoreWebUI()) { | |
| 3908 // Call a clean API to confirm adding a search provider. | |
| 3909 browser::ConfirmAddSearchProvider(template_url, profile); | |
| 3910 return; | |
| 3911 } | |
|
arv (Not doing code reviews)
2011/10/04 20:55:01
remove return and use else
wyck
2011/10/04 21:57:57
Done.
| |
| 3903 window()->ConfirmAddSearchProvider(template_url, profile); | 3912 window()->ConfirmAddSearchProvider(template_url, profile); |
| 3904 } | 3913 } |
| 3905 | 3914 |
| 3906 /////////////////////////////////////////////////////////////////////////////// | 3915 /////////////////////////////////////////////////////////////////////////////// |
| 3907 // Browser, BlockedContentTabHelperDelegate implementation: | 3916 // Browser, BlockedContentTabHelperDelegate implementation: |
| 3908 | 3917 |
| 3909 TabContentsWrapper* Browser::GetConstrainingContentsWrapper( | 3918 TabContentsWrapper* Browser::GetConstrainingContentsWrapper( |
| 3910 TabContentsWrapper* source) { | 3919 TabContentsWrapper* source) { |
| 3911 return source; | 3920 return source; |
| 3912 } | 3921 } |
| (...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5252 } else if (is_type_tabbed()) { | 5261 } else if (is_type_tabbed()) { |
| 5253 GlobalErrorService* service = | 5262 GlobalErrorService* service = |
| 5254 GlobalErrorServiceFactory::GetForProfile(profile()); | 5263 GlobalErrorServiceFactory::GetForProfile(profile()); |
| 5255 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); | 5264 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); |
| 5256 if (error) { | 5265 if (error) { |
| 5257 error->ShowBubbleView(this); | 5266 error->ShowBubbleView(this); |
| 5258 did_show_bubble = true; | 5267 did_show_bubble = true; |
| 5259 } | 5268 } |
| 5260 } | 5269 } |
| 5261 } | 5270 } |
| OLD | NEW |