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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
99 #include "chrome/browser/themes/theme_service.h" | 99 #include "chrome/browser/themes/theme_service.h" |
100 #include "chrome/browser/themes/theme_service_factory.h" | 100 #include "chrome/browser/themes/theme_service_factory.h" |
101 #include "chrome/browser/ui/app_modal_dialogs/message_box_handler.h" | 101 #include "chrome/browser/ui/app_modal_dialogs/message_box_handler.h" |
102 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" | 102 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" |
103 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" | 103 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" |
104 #include "chrome/browser/ui/browser_dialogs.h" | 104 #include "chrome/browser/ui/browser_dialogs.h" |
105 #include "chrome/browser/ui/browser_list.h" | 105 #include "chrome/browser/ui/browser_list.h" |
106 #include "chrome/browser/ui/browser_navigator.h" | 106 #include "chrome/browser/ui/browser_navigator.h" |
107 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" | 107 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" |
108 #include "chrome/browser/ui/browser_window.h" | 108 #include "chrome/browser/ui/browser_window.h" |
109 #include "chrome/browser/ui/color_chooser.h" | |
109 #include "chrome/browser/ui/constrained_window_tab_helper.h" | 110 #include "chrome/browser/ui/constrained_window_tab_helper.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_controller.h" | 115 #include "chrome/browser/ui/fullscreen_controller.h" |
115 #include "chrome/browser/ui/global_error.h" | 116 #include "chrome/browser/ui/global_error.h" |
116 #include "chrome/browser/ui/global_error_service.h" | 117 #include "chrome/browser/ui/global_error_service.h" |
117 #include "chrome/browser/ui/global_error_service_factory.h" | 118 #include "chrome/browser/ui/global_error_service_factory.h" |
118 #include "chrome/browser/ui/intents/web_intent_picker_controller.h" | 119 #include "chrome/browser/ui/intents/web_intent_picker_controller.h" |
(...skipping 3895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4014 | 4015 |
4015 void Browser::DidNavigateToPendingEntry(WebContents* tab) { | 4016 void Browser::DidNavigateToPendingEntry(WebContents* tab) { |
4016 if (tab == GetSelectedWebContents()) | 4017 if (tab == GetSelectedWebContents()) |
4017 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE); | 4018 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE); |
4018 } | 4019 } |
4019 | 4020 |
4020 content::JavaScriptDialogCreator* Browser::GetJavaScriptDialogCreator() { | 4021 content::JavaScriptDialogCreator* Browser::GetJavaScriptDialogCreator() { |
4021 return GetJavaScriptDialogCreatorInstance(); | 4022 return GetJavaScriptDialogCreatorInstance(); |
4022 } | 4023 } |
4023 | 4024 |
4025 void Browser::OpenColorChooser(WebContents* tab, | |
4026 unsigned color_chooser_id, | |
4027 const SkColor& color) { | |
4028 printf("! Browser::OpenColorChooser %p %d\n", this, color_chooser_id); | |
Peter Kasting
2012/02/07 01:46:24
No printfs (3 places)
keishi
2012/02/17 11:31:05
Done.
| |
4029 if (color_chooser_.get() && color_chooser_id == color_chooser_->identifier()) | |
4030 return; | |
4031 if (color_chooser_.get()) | |
4032 color_chooser_->End(); | |
4033 color_chooser_.reset(ColorChooser::Create(color_chooser_id, | |
4034 tab->GetRenderViewHost())); | |
4035 color_chooser_->Open(color); | |
4036 } | |
4037 void Browser::EndColorChooser(WebContents* tab, unsigned color_chooser_id) { | |
Peter Kasting
2012/02/07 01:46:24
In general I don't understand why you check both t
keishi
2012/02/17 11:31:05
The color chooser id is generated by incrementing
| |
4038 printf("! Browser::EndColorChooser %p\n", this); | |
4039 if (tab->GetRenderViewHost() != color_chooser_->render_view_host()) | |
4040 return; | |
4041 if (tab->GetRenderViewHost() != color_chooser_->render_view_host()) | |
Peter Kasting
2012/02/07 01:46:24
Nit: Two copies of this line, I think you meant to
keishi
2012/02/17 11:31:05
Done.
| |
4042 return; | |
4043 color_chooser_->End(); | |
4044 } | |
4045 void Browser::SetSelectedColorInColorChooser(WebContents* tab, | |
4046 unsigned color_chooser_id, | |
Peter Kasting
2012/02/07 01:46:24
Nit: Indent even. If it won't fit, indent even th
keishi
2012/02/17 11:31:05
Done.
| |
4047 const SkColor& color) { | |
4048 if (!color_chooser_.get()) | |
Peter Kasting
2012/02/07 01:46:24
Nit: Combine these conditionals
keishi
2012/02/17 11:31:05
Done.
| |
4049 return; | |
4050 if (tab->GetRenderViewHost() != color_chooser_->render_view_host()) | |
4051 return; | |
4052 if (color_chooser_id != color_chooser_->identifier()) | |
4053 return; | |
4054 color_chooser_->SetSelectedColor(color); | |
4055 } | |
4056 void Browser::DidEndColorChooser(WebContents* tab) { | |
4057 printf("! Browser::DidEndColorChooser %p\n", this); | |
4058 if (tab->GetRenderViewHost() != color_chooser_->render_view_host()) | |
4059 return; | |
4060 color_chooser_.reset(); | |
4061 } | |
4062 | |
4024 void Browser::RunFileChooser(WebContents* tab, | 4063 void Browser::RunFileChooser(WebContents* tab, |
4025 const content::FileChooserParams& params) { | 4064 const content::FileChooserParams& params) { |
4026 RunFileChooserHelper(tab, params); | 4065 RunFileChooserHelper(tab, params); |
4027 } | 4066 } |
4028 | 4067 |
4029 void Browser::EnumerateDirectory(WebContents* tab, int request_id, | 4068 void Browser::EnumerateDirectory(WebContents* tab, int request_id, |
4030 const FilePath& path) { | 4069 const FilePath& path) { |
4031 EnumerateDirectoryHelper(tab, request_id, path); | 4070 EnumerateDirectoryHelper(tab, request_id, path); |
4032 } | 4071 } |
4033 | 4072 |
(...skipping 1472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5506 profile()->GetOriginalProfile()); | 5545 profile()->GetOriginalProfile()); |
5507 if (service->HasSyncSetupCompleted()) | 5546 if (service->HasSyncSetupCompleted()) |
5508 ShowOptionsTab(chrome::kPersonalOptionsSubPage); | 5547 ShowOptionsTab(chrome::kPersonalOptionsSubPage); |
5509 else | 5548 else |
5510 service->ShowLoginDialog(); | 5549 service->ShowLoginDialog(); |
5511 } | 5550 } |
5512 | 5551 |
5513 void Browser::ToggleSpeechInput() { | 5552 void Browser::ToggleSpeechInput() { |
5514 GetSelectedWebContents()->GetRenderViewHost()->ToggleSpeechInput(); | 5553 GetSelectedWebContents()->GetRenderViewHost()->ToggleSpeechInput(); |
5515 } | 5554 } |
OLD | NEW |