| 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 #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 // defined(OS_WIN) | 10 #endif // defined(OS_WIN) |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 #include "chrome/browser/ui/browser_navigator.h" | 100 #include "chrome/browser/ui/browser_navigator.h" |
| 101 #include "chrome/browser/ui/browser_tab_contents.h" | 101 #include "chrome/browser/ui/browser_tab_contents.h" |
| 102 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" | 102 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" |
| 103 #include "chrome/browser/ui/browser_tab_strip_model_delegate.h" | 103 #include "chrome/browser/ui/browser_tab_strip_model_delegate.h" |
| 104 #include "chrome/browser/ui/browser_tabstrip.h" | 104 #include "chrome/browser/ui/browser_tabstrip.h" |
| 105 #include "chrome/browser/ui/browser_toolbar_model_delegate.h" | 105 #include "chrome/browser/ui/browser_toolbar_model_delegate.h" |
| 106 #include "chrome/browser/ui/browser_ui_prefs.h" | 106 #include "chrome/browser/ui/browser_ui_prefs.h" |
| 107 #include "chrome/browser/ui/browser_window.h" | 107 #include "chrome/browser/ui/browser_window.h" |
| 108 #include "chrome/browser/ui/chrome_pages.h" | 108 #include "chrome/browser/ui/chrome_pages.h" |
| 109 #include "chrome/browser/ui/chrome_select_file_policy.h" | 109 #include "chrome/browser/ui/chrome_select_file_policy.h" |
| 110 #include "chrome/browser/ui/color_chooser_controller.h" |
| 110 #include "chrome/browser/ui/extensions/shell_window.h" | 111 #include "chrome/browser/ui/extensions/shell_window.h" |
| 111 #include "chrome/browser/ui/find_bar/find_bar.h" | 112 #include "chrome/browser/ui/find_bar/find_bar.h" |
| 112 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 113 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
| 113 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 114 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
| 114 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" | 115 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" |
| 115 #include "chrome/browser/ui/global_error/global_error.h" | 116 #include "chrome/browser/ui/global_error/global_error.h" |
| 116 #include "chrome/browser/ui/global_error/global_error_service.h" | 117 #include "chrome/browser/ui/global_error/global_error_service.h" |
| 117 #include "chrome/browser/ui/global_error/global_error_service_factory.h" | 118 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
| 118 #include "chrome/browser/ui/omnibox/location_bar.h" | 119 #include "chrome/browser/ui/omnibox/location_bar.h" |
| 119 #include "chrome/browser/ui/search/search_delegate.h" | 120 #include "chrome/browser/ui/search/search_delegate.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 142 #include "chrome/common/chrome_switches.h" | 143 #include "chrome/common/chrome_switches.h" |
| 143 #include "chrome/common/custom_handlers/protocol_handler.h" | 144 #include "chrome/common/custom_handlers/protocol_handler.h" |
| 144 #include "chrome/common/extensions/background_info.h" | 145 #include "chrome/common/extensions/background_info.h" |
| 145 #include "chrome/common/extensions/extension.h" | 146 #include "chrome/common/extensions/extension.h" |
| 146 #include "chrome/common/extensions/extension_constants.h" | 147 #include "chrome/common/extensions/extension_constants.h" |
| 147 #include "chrome/common/pref_names.h" | 148 #include "chrome/common/pref_names.h" |
| 148 #include "chrome/common/profiling.h" | 149 #include "chrome/common/profiling.h" |
| 149 #include "chrome/common/search_types.h" | 150 #include "chrome/common/search_types.h" |
| 150 #include "chrome/common/startup_metric_utils.h" | 151 #include "chrome/common/startup_metric_utils.h" |
| 151 #include "chrome/common/web_apps.h" | 152 #include "chrome/common/web_apps.h" |
| 152 #include "content/public/browser/color_chooser.h" | |
| 153 #include "content/public/browser/devtools_manager.h" | 153 #include "content/public/browser/devtools_manager.h" |
| 154 #include "content/public/browser/download_item.h" | 154 #include "content/public/browser/download_item.h" |
| 155 #include "content/public/browser/download_manager.h" | 155 #include "content/public/browser/download_manager.h" |
| 156 #include "content/public/browser/interstitial_page.h" | 156 #include "content/public/browser/interstitial_page.h" |
| 157 #include "content/public/browser/invalidate_type.h" | 157 #include "content/public/browser/invalidate_type.h" |
| 158 #include "content/public/browser/navigation_controller.h" | 158 #include "content/public/browser/navigation_controller.h" |
| 159 #include "content/public/browser/navigation_entry.h" | 159 #include "content/public/browser/navigation_entry.h" |
| 160 #include "content/public/browser/notification_details.h" | 160 #include "content/public/browser/notification_details.h" |
| 161 #include "content/public/browser/notification_service.h" | 161 #include "content/public/browser/notification_service.h" |
| 162 #include "content/public/browser/plugin_service.h" | 162 #include "content/public/browser/plugin_service.h" |
| (...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1512 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE); | 1512 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE); |
| 1513 } | 1513 } |
| 1514 | 1514 |
| 1515 content::JavaScriptDialogManager* Browser::GetJavaScriptDialogManager() { | 1515 content::JavaScriptDialogManager* Browser::GetJavaScriptDialogManager() { |
| 1516 return GetJavaScriptDialogManagerInstance(); | 1516 return GetJavaScriptDialogManagerInstance(); |
| 1517 } | 1517 } |
| 1518 | 1518 |
| 1519 content::ColorChooser* Browser::OpenColorChooser(WebContents* web_contents, | 1519 content::ColorChooser* Browser::OpenColorChooser(WebContents* web_contents, |
| 1520 int color_chooser_id, | 1520 int color_chooser_id, |
| 1521 SkColor color) { | 1521 SkColor color) { |
| 1522 #if defined(OS_WIN) | 1522 return ColorChooserController::GetInstance()->OpenColorChooser( |
| 1523 // On Windows, only create a color chooser if one doesn't exist, because we | 1523 color, web_contents, color_chooser_id); |
| 1524 // can't close the old color chooser dialog. | |
| 1525 if (!color_chooser_.get()) | |
| 1526 color_chooser_.reset(content::ColorChooser::Create(color_chooser_id, | |
| 1527 web_contents, | |
| 1528 color)); | |
| 1529 #else | |
| 1530 if (color_chooser_.get()) | |
| 1531 color_chooser_->End(); | |
| 1532 color_chooser_.reset(content::ColorChooser::Create(color_chooser_id, | |
| 1533 web_contents, | |
| 1534 color)); | |
| 1535 #endif | |
| 1536 return color_chooser_.get(); | |
| 1537 } | |
| 1538 | |
| 1539 void Browser::DidEndColorChooser() { | |
| 1540 color_chooser_.reset(); | |
| 1541 } | 1524 } |
| 1542 | 1525 |
| 1543 void Browser::RunFileChooser(WebContents* web_contents, | 1526 void Browser::RunFileChooser(WebContents* web_contents, |
| 1544 const content::FileChooserParams& params) { | 1527 const content::FileChooserParams& params) { |
| 1545 FileSelectHelper::RunFileChooser(web_contents, params); | 1528 FileSelectHelper::RunFileChooser(web_contents, params); |
| 1546 } | 1529 } |
| 1547 | 1530 |
| 1548 void Browser::EnumerateDirectory(WebContents* web_contents, | 1531 void Browser::EnumerateDirectory(WebContents* web_contents, |
| 1549 int request_id, | 1532 int request_id, |
| 1550 const base::FilePath& path) { | 1533 const base::FilePath& path) { |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2244 if (contents && !allow_js_access) { | 2227 if (contents && !allow_js_access) { |
| 2245 contents->web_contents()->GetController().LoadURL( | 2228 contents->web_contents()->GetController().LoadURL( |
| 2246 target_url, | 2229 target_url, |
| 2247 content::Referrer(), | 2230 content::Referrer(), |
| 2248 content::PAGE_TRANSITION_LINK, | 2231 content::PAGE_TRANSITION_LINK, |
| 2249 std::string()); // No extra headers. | 2232 std::string()); // No extra headers. |
| 2250 } | 2233 } |
| 2251 | 2234 |
| 2252 return contents != NULL; | 2235 return contents != NULL; |
| 2253 } | 2236 } |
| OLD | NEW |