| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 #include "chrome/browser/ui/browser_navigator.h" | 101 #include "chrome/browser/ui/browser_navigator.h" |
| 102 #include "chrome/browser/ui/browser_tab_contents.h" | 102 #include "chrome/browser/ui/browser_tab_contents.h" |
| 103 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" | 103 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" |
| 104 #include "chrome/browser/ui/browser_tab_strip_model_delegate.h" | 104 #include "chrome/browser/ui/browser_tab_strip_model_delegate.h" |
| 105 #include "chrome/browser/ui/browser_tabstrip.h" | 105 #include "chrome/browser/ui/browser_tabstrip.h" |
| 106 #include "chrome/browser/ui/browser_toolbar_model_delegate.h" | 106 #include "chrome/browser/ui/browser_toolbar_model_delegate.h" |
| 107 #include "chrome/browser/ui/browser_ui_prefs.h" | 107 #include "chrome/browser/ui/browser_ui_prefs.h" |
| 108 #include "chrome/browser/ui/browser_window.h" | 108 #include "chrome/browser/ui/browser_window.h" |
| 109 #include "chrome/browser/ui/chrome_pages.h" | 109 #include "chrome/browser/ui/chrome_pages.h" |
| 110 #include "chrome/browser/ui/chrome_select_file_policy.h" | 110 #include "chrome/browser/ui/chrome_select_file_policy.h" |
| 111 #include "chrome/browser/ui/color_chooser.h" |
| 111 #include "chrome/browser/ui/extensions/shell_window.h" | 112 #include "chrome/browser/ui/extensions/shell_window.h" |
| 112 #include "chrome/browser/ui/find_bar/find_bar.h" | 113 #include "chrome/browser/ui/find_bar/find_bar.h" |
| 113 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 114 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
| 114 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 115 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
| 115 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" | 116 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" |
| 116 #include "chrome/browser/ui/global_error/global_error.h" | 117 #include "chrome/browser/ui/global_error/global_error.h" |
| 117 #include "chrome/browser/ui/global_error/global_error_service.h" | 118 #include "chrome/browser/ui/global_error/global_error_service.h" |
| 118 #include "chrome/browser/ui/global_error/global_error_service_factory.h" | 119 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
| 119 #include "chrome/browser/ui/omnibox/location_bar.h" | 120 #include "chrome/browser/ui/omnibox/location_bar.h" |
| 120 #include "chrome/browser/ui/search/search_delegate.h" | 121 #include "chrome/browser/ui/search/search_delegate.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 144 #include "chrome/common/custom_handlers/protocol_handler.h" | 145 #include "chrome/common/custom_handlers/protocol_handler.h" |
| 145 #include "chrome/common/extensions/background_info.h" | 146 #include "chrome/common/extensions/background_info.h" |
| 146 #include "chrome/common/extensions/extension.h" | 147 #include "chrome/common/extensions/extension.h" |
| 147 #include "chrome/common/extensions/extension_constants.h" | 148 #include "chrome/common/extensions/extension_constants.h" |
| 148 #include "chrome/common/pref_names.h" | 149 #include "chrome/common/pref_names.h" |
| 149 #include "chrome/common/profiling.h" | 150 #include "chrome/common/profiling.h" |
| 150 #include "chrome/common/search_types.h" | 151 #include "chrome/common/search_types.h" |
| 151 #include "chrome/common/startup_metric_utils.h" | 152 #include "chrome/common/startup_metric_utils.h" |
| 152 #include "chrome/common/url_constants.h" | 153 #include "chrome/common/url_constants.h" |
| 153 #include "chrome/common/web_apps.h" | 154 #include "chrome/common/web_apps.h" |
| 154 #include "content/public/browser/color_chooser.h" | |
| 155 #include "content/public/browser/devtools_manager.h" | 155 #include "content/public/browser/devtools_manager.h" |
| 156 #include "content/public/browser/download_item.h" | 156 #include "content/public/browser/download_item.h" |
| 157 #include "content/public/browser/download_manager.h" | 157 #include "content/public/browser/download_manager.h" |
| 158 #include "content/public/browser/interstitial_page.h" | 158 #include "content/public/browser/interstitial_page.h" |
| 159 #include "content/public/browser/invalidate_type.h" | 159 #include "content/public/browser/invalidate_type.h" |
| 160 #include "content/public/browser/navigation_controller.h" | 160 #include "content/public/browser/navigation_controller.h" |
| 161 #include "content/public/browser/navigation_entry.h" | 161 #include "content/public/browser/navigation_entry.h" |
| 162 #include "content/public/browser/notification_details.h" | 162 #include "content/public/browser/notification_details.h" |
| 163 #include "content/public/browser/notification_service.h" | 163 #include "content/public/browser/notification_service.h" |
| 164 #include "content/public/browser/plugin_service.h" | 164 #include "content/public/browser/plugin_service.h" |
| (...skipping 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1517 void Browser::DidNavigateToPendingEntry(WebContents* web_contents) { | 1517 void Browser::DidNavigateToPendingEntry(WebContents* web_contents) { |
| 1518 if (web_contents == tab_strip_model_->GetActiveWebContents()) | 1518 if (web_contents == tab_strip_model_->GetActiveWebContents()) |
| 1519 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE); | 1519 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE); |
| 1520 } | 1520 } |
| 1521 | 1521 |
| 1522 content::JavaScriptDialogManager* Browser::GetJavaScriptDialogManager() { | 1522 content::JavaScriptDialogManager* Browser::GetJavaScriptDialogManager() { |
| 1523 return GetJavaScriptDialogManagerInstance(); | 1523 return GetJavaScriptDialogManagerInstance(); |
| 1524 } | 1524 } |
| 1525 | 1525 |
| 1526 content::ColorChooser* Browser::OpenColorChooser(WebContents* web_contents, | 1526 content::ColorChooser* Browser::OpenColorChooser(WebContents* web_contents, |
| 1527 int color_chooser_id, | 1527 SkColor initial_color) { |
| 1528 SkColor color) { | 1528 return ColorChooser::Open(web_contents, initial_color); |
| 1529 #if defined(OS_WIN) | |
| 1530 // On Windows, only create a color chooser if one doesn't exist, because we | |
| 1531 // can't close the old color chooser dialog. | |
| 1532 if (!color_chooser_.get()) | |
| 1533 color_chooser_.reset(content::ColorChooser::Create(color_chooser_id, | |
| 1534 web_contents, | |
| 1535 color)); | |
| 1536 #else | |
| 1537 if (color_chooser_.get()) | |
| 1538 color_chooser_->End(); | |
| 1539 color_chooser_.reset(content::ColorChooser::Create(color_chooser_id, | |
| 1540 web_contents, | |
| 1541 color)); | |
| 1542 #endif | |
| 1543 return color_chooser_.get(); | |
| 1544 } | |
| 1545 | |
| 1546 void Browser::DidEndColorChooser() { | |
| 1547 color_chooser_.reset(); | |
| 1548 } | 1529 } |
| 1549 | 1530 |
| 1550 void Browser::RunFileChooser(WebContents* web_contents, | 1531 void Browser::RunFileChooser(WebContents* web_contents, |
| 1551 const content::FileChooserParams& params) { | 1532 const content::FileChooserParams& params) { |
| 1552 FileSelectHelper::RunFileChooser(web_contents, params); | 1533 FileSelectHelper::RunFileChooser(web_contents, params); |
| 1553 } | 1534 } |
| 1554 | 1535 |
| 1555 void Browser::EnumerateDirectory(WebContents* web_contents, | 1536 void Browser::EnumerateDirectory(WebContents* web_contents, |
| 1556 int request_id, | 1537 int request_id, |
| 1557 const base::FilePath& path) { | 1538 const base::FilePath& path) { |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2255 if (contents && !allow_js_access) { | 2236 if (contents && !allow_js_access) { |
| 2256 contents->web_contents()->GetController().LoadURL( | 2237 contents->web_contents()->GetController().LoadURL( |
| 2257 target_url, | 2238 target_url, |
| 2258 content::Referrer(), | 2239 content::Referrer(), |
| 2259 content::PAGE_TRANSITION_LINK, | 2240 content::PAGE_TRANSITION_LINK, |
| 2260 std::string()); // No extra headers. | 2241 std::string()); // No extra headers. |
| 2261 } | 2242 } |
| 2262 | 2243 |
| 2263 return contents != NULL; | 2244 return contents != NULL; |
| 2264 } | 2245 } |
| OLD | NEW |