OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 // OS_WIN | 10 #endif // OS_WIN |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 #include "chrome/common/chrome_constants.h" | 144 #include "chrome/common/chrome_constants.h" |
145 #include "chrome/common/chrome_notification_types.h" | 145 #include "chrome/common/chrome_notification_types.h" |
146 #include "chrome/common/chrome_switches.h" | 146 #include "chrome/common/chrome_switches.h" |
147 #include "chrome/common/custom_handlers/protocol_handler.h" | 147 #include "chrome/common/custom_handlers/protocol_handler.h" |
148 #include "chrome/common/extensions/extension.h" | 148 #include "chrome/common/extensions/extension.h" |
149 #include "chrome/common/extensions/extension_constants.h" | 149 #include "chrome/common/extensions/extension_constants.h" |
150 #include "chrome/common/pref_names.h" | 150 #include "chrome/common/pref_names.h" |
151 #include "chrome/common/profiling.h" | 151 #include "chrome/common/profiling.h" |
152 #include "chrome/common/url_constants.h" | 152 #include "chrome/common/url_constants.h" |
153 #include "chrome/common/web_apps.h" | 153 #include "chrome/common/web_apps.h" |
| 154 #include "content/public/browser/color_chooser.h" |
154 #include "content/public/browser/devtools_manager.h" | 155 #include "content/public/browser/devtools_manager.h" |
155 #include "content/public/browser/download_item.h" | 156 #include "content/public/browser/download_item.h" |
156 #include "content/public/browser/download_manager.h" | 157 #include "content/public/browser/download_manager.h" |
157 #include "content/public/browser/interstitial_page.h" | 158 #include "content/public/browser/interstitial_page.h" |
158 #include "content/public/browser/invalidate_type.h" | 159 #include "content/public/browser/invalidate_type.h" |
159 #include "content/public/browser/navigation_controller.h" | 160 #include "content/public/browser/navigation_controller.h" |
160 #include "content/public/browser/navigation_entry.h" | 161 #include "content/public/browser/navigation_entry.h" |
161 #include "content/public/browser/notification_details.h" | 162 #include "content/public/browser/notification_details.h" |
162 #include "content/public/browser/notification_service.h" | 163 #include "content/public/browser/notification_service.h" |
163 #include "content/public/browser/plugin_service.h" | 164 #include "content/public/browser/plugin_service.h" |
(...skipping 3984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4148 | 4149 |
4149 void Browser::DidNavigateToPendingEntry(WebContents* tab) { | 4150 void Browser::DidNavigateToPendingEntry(WebContents* tab) { |
4150 if (tab == GetSelectedWebContents()) | 4151 if (tab == GetSelectedWebContents()) |
4151 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE); | 4152 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE); |
4152 } | 4153 } |
4153 | 4154 |
4154 content::JavaScriptDialogCreator* Browser::GetJavaScriptDialogCreator() { | 4155 content::JavaScriptDialogCreator* Browser::GetJavaScriptDialogCreator() { |
4155 return GetJavaScriptDialogCreatorInstance(); | 4156 return GetJavaScriptDialogCreatorInstance(); |
4156 } | 4157 } |
4157 | 4158 |
| 4159 content::ColorChooser* Browser::OpenColorChooser(WebContents* tab, |
| 4160 int color_chooser_id, |
| 4161 const SkColor& color) { |
| 4162 #if defined(OS_WIN) |
| 4163 // On Windows, only create a color chooser if one doesn't exist, because we |
| 4164 // can't close the old color chooser dialog. |
| 4165 if (!color_chooser_.get()) |
| 4166 color_chooser_.reset(content::ColorChooser::Create(color_chooser_id, tab, |
| 4167 color)); |
| 4168 #else |
| 4169 if (color_chooser_.get()) |
| 4170 color_chooser_->End(); |
| 4171 color_chooser_.reset(content::ColorChooser::Create(color_chooser_id, tab, |
| 4172 color)); |
| 4173 #endif |
| 4174 return color_chooser_.get(); |
| 4175 } |
| 4176 |
| 4177 void Browser::DidEndColorChooser() { |
| 4178 color_chooser_.reset(); |
| 4179 } |
| 4180 |
4158 void Browser::RunFileChooser(WebContents* tab, | 4181 void Browser::RunFileChooser(WebContents* tab, |
4159 const content::FileChooserParams& params) { | 4182 const content::FileChooserParams& params) { |
4160 RunFileChooserHelper(tab, params); | 4183 RunFileChooserHelper(tab, params); |
4161 } | 4184 } |
4162 | 4185 |
4163 void Browser::EnumerateDirectory(WebContents* tab, int request_id, | 4186 void Browser::EnumerateDirectory(WebContents* tab, int request_id, |
4164 const FilePath& path) { | 4187 const FilePath& path) { |
4165 EnumerateDirectoryHelper(tab, request_id, path); | 4188 EnumerateDirectoryHelper(tab, request_id, path); |
4166 } | 4189 } |
4167 | 4190 |
(...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5648 } else { | 5671 } else { |
5649 LoginUIServiceFactory::GetForProfile( | 5672 LoginUIServiceFactory::GetForProfile( |
5650 profile()->GetOriginalProfile())->ShowLoginUI(false); | 5673 profile()->GetOriginalProfile())->ShowLoginUI(false); |
5651 } | 5674 } |
5652 #endif | 5675 #endif |
5653 } | 5676 } |
5654 | 5677 |
5655 void Browser::ToggleSpeechInput() { | 5678 void Browser::ToggleSpeechInput() { |
5656 GetSelectedWebContents()->GetRenderViewHost()->ToggleSpeechInput(); | 5679 GetSelectedWebContents()->GetRenderViewHost()->ToggleSpeechInput(); |
5657 } | 5680 } |
OLD | NEW |