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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
101 #include "chrome/browser/themes/theme_service.h" | 101 #include "chrome/browser/themes/theme_service.h" |
102 #include "chrome/browser/themes/theme_service_factory.h" | 102 #include "chrome/browser/themes/theme_service_factory.h" |
103 #include "chrome/browser/ui/app_modal_dialogs/message_box_handler.h" | 103 #include "chrome/browser/ui/app_modal_dialogs/message_box_handler.h" |
104 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" | 104 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" |
105 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" | 105 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" |
106 #include "chrome/browser/ui/browser_dialogs.h" | 106 #include "chrome/browser/ui/browser_dialogs.h" |
107 #include "chrome/browser/ui/browser_list.h" | 107 #include "chrome/browser/ui/browser_list.h" |
108 #include "chrome/browser/ui/browser_navigator.h" | 108 #include "chrome/browser/ui/browser_navigator.h" |
109 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" | 109 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" |
110 #include "chrome/browser/ui/browser_window.h" | 110 #include "chrome/browser/ui/browser_window.h" |
111 #include "chrome/browser/ui/color_chooser.h" | |
111 #include "chrome/browser/ui/constrained_window_tab_helper.h" | 112 #include "chrome/browser/ui/constrained_window_tab_helper.h" |
112 #include "chrome/browser/ui/extensions/shell_window.h" | 113 #include "chrome/browser/ui/extensions/shell_window.h" |
113 #include "chrome/browser/ui/find_bar/find_bar.h" | 114 #include "chrome/browser/ui/find_bar/find_bar.h" |
114 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 115 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
115 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 116 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
116 #include "chrome/browser/ui/fullscreen_controller.h" | 117 #include "chrome/browser/ui/fullscreen_controller.h" |
117 #include "chrome/browser/ui/global_error.h" | 118 #include "chrome/browser/ui/global_error.h" |
118 #include "chrome/browser/ui/global_error_service.h" | 119 #include "chrome/browser/ui/global_error_service.h" |
119 #include "chrome/browser/ui/global_error_service_factory.h" | 120 #include "chrome/browser/ui/global_error_service_factory.h" |
120 #include "chrome/browser/ui/intents/web_intent_picker_controller.h" | 121 #include "chrome/browser/ui/intents/web_intent_picker_controller.h" |
(...skipping 22 matching lines...) Expand all Loading... | |
143 #include "chrome/common/chrome_switches.h" | 144 #include "chrome/common/chrome_switches.h" |
144 #include "chrome/common/custom_handlers/protocol_handler.h" | 145 #include "chrome/common/custom_handlers/protocol_handler.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/url_constants.h" | 150 #include "chrome/common/url_constants.h" |
150 #include "chrome/common/web_apps.h" | 151 #include "chrome/common/web_apps.h" |
151 #include "content/browser/browser_url_handler.h" | 152 #include "content/browser/browser_url_handler.h" |
152 #include "content/browser/renderer_host/render_view_host.h" | 153 #include "content/browser/renderer_host/render_view_host.h" |
154 #include "content/public/browser/color_chooser.h" | |
153 #include "content/public/browser/devtools_manager.h" | 155 #include "content/public/browser/devtools_manager.h" |
154 #include "content/public/browser/download_item.h" | 156 #include "content/public/browser/download_item.h" |
155 #include "content/public/browser/download_manager.h" | 157 #include "content/public/browser/download_manager.h" |
156 #include "content/public/browser/interstitial_page.h" | 158 #include "content/public/browser/interstitial_page.h" |
157 #include "content/public/browser/invalidate_type.h" | 159 #include "content/public/browser/invalidate_type.h" |
158 #include "content/public/browser/navigation_controller.h" | 160 #include "content/public/browser/navigation_controller.h" |
159 #include "content/public/browser/navigation_entry.h" | 161 #include "content/public/browser/navigation_entry.h" |
160 #include "content/public/browser/notification_details.h" | 162 #include "content/public/browser/notification_details.h" |
161 #include "content/public/browser/notification_service.h" | 163 #include "content/public/browser/notification_service.h" |
162 #include "content/public/browser/plugin_service.h" | 164 #include "content/public/browser/plugin_service.h" |
(...skipping 3948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4111 | 4113 |
4112 void Browser::DidNavigateToPendingEntry(WebContents* tab) { | 4114 void Browser::DidNavigateToPendingEntry(WebContents* tab) { |
4113 if (tab == GetSelectedWebContents()) | 4115 if (tab == GetSelectedWebContents()) |
4114 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE); | 4116 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE); |
4115 } | 4117 } |
4116 | 4118 |
4117 content::JavaScriptDialogCreator* Browser::GetJavaScriptDialogCreator() { | 4119 content::JavaScriptDialogCreator* Browser::GetJavaScriptDialogCreator() { |
4118 return GetJavaScriptDialogCreatorInstance(); | 4120 return GetJavaScriptDialogCreatorInstance(); |
4119 } | 4121 } |
4120 | 4122 |
4123 content::ColorChooser* Browser::OpenColorChooser(WebContents* tab, | |
4124 int color_chooser_id, | |
4125 const SkColor& color) { | |
4126 if (color_chooser_.get() && | |
4127 color_chooser_id == color_chooser_->GetIdentifier() && | |
4128 tab->GetRenderViewHost() == color_chooser_->GetRenderViewHost()) | |
4129 return NULL; | |
jam
2012/02/27 22:06:25
I don't think this condition can happen?
i.e. whe
keishi
2012/02/28 11:27:45
Yes, it should never happen. Removed.
| |
4130 if (color_chooser_.get()) | |
4131 color_chooser_->End(); | |
4132 color_chooser_.reset(ColorChooser::Create(color_chooser_id, | |
4133 tab->GetRenderViewHost(), | |
4134 color)); | |
4135 return static_cast<content::ColorChooser*>(color_chooser_.get()); | |
4136 } | |
4137 | |
4138 void Browser::DidEndColorChooser() { | |
4139 color_chooser_.reset(); | |
4140 } | |
4141 | |
4121 void Browser::RunFileChooser(WebContents* tab, | 4142 void Browser::RunFileChooser(WebContents* tab, |
4122 const content::FileChooserParams& params) { | 4143 const content::FileChooserParams& params) { |
4123 RunFileChooserHelper(tab, params); | 4144 RunFileChooserHelper(tab, params); |
4124 } | 4145 } |
4125 | 4146 |
4126 void Browser::EnumerateDirectory(WebContents* tab, int request_id, | 4147 void Browser::EnumerateDirectory(WebContents* tab, int request_id, |
4127 const FilePath& path) { | 4148 const FilePath& path) { |
4128 EnumerateDirectoryHelper(tab, request_id, path); | 4149 EnumerateDirectoryHelper(tab, request_id, path); |
4129 } | 4150 } |
4130 | 4151 |
(...skipping 1453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5584 ShowSingletonTabOverwritingNTP(params); | 5605 ShowSingletonTabOverwritingNTP(params); |
5585 } else { | 5606 } else { |
5586 LoginUIServiceFactory::GetForProfile( | 5607 LoginUIServiceFactory::GetForProfile( |
5587 profile()->GetOriginalProfile())->ShowLoginUI(); | 5608 profile()->GetOriginalProfile())->ShowLoginUI(); |
5588 } | 5609 } |
5589 } | 5610 } |
5590 | 5611 |
5591 void Browser::ToggleSpeechInput() { | 5612 void Browser::ToggleSpeechInput() { |
5592 GetSelectedWebContents()->GetRenderViewHost()->ToggleSpeechInput(); | 5613 GetSelectedWebContents()->GetRenderViewHost()->ToggleSpeechInput(); |
5593 } | 5614 } |
OLD | NEW |