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_commands.h" | 5 #include "chrome/browser/ui/browser_commands.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/bookmarks/bookmark_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 #include "chrome/browser/ui/bookmarks/bookmark_prompt_controller.h" | 35 #include "chrome/browser/ui/bookmarks/bookmark_prompt_controller.h" |
36 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" | 36 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" |
37 #include "chrome/browser/ui/browser.h" | 37 #include "chrome/browser/ui/browser.h" |
38 #include "chrome/browser/ui/browser_command_controller.h" | 38 #include "chrome/browser/ui/browser_command_controller.h" |
39 #include "chrome/browser/ui/browser_finder.h" | 39 #include "chrome/browser/ui/browser_finder.h" |
40 #include "chrome/browser/ui/browser_instant_controller.h" | 40 #include "chrome/browser/ui/browser_instant_controller.h" |
41 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" | 41 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" |
42 #include "chrome/browser/ui/browser_tabstrip.h" | 42 #include "chrome/browser/ui/browser_tabstrip.h" |
43 #include "chrome/browser/ui/browser_window.h" | 43 #include "chrome/browser/ui/browser_window.h" |
44 #include "chrome/browser/ui/chrome_pages.h" | 44 #include "chrome/browser/ui/chrome_pages.h" |
45 #include "chrome/browser/ui/constrained_window_tab_helper.h" | |
46 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 45 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
47 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 46 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
48 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" | 47 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" |
49 #include "chrome/browser/ui/omnibox/location_bar.h" | 48 #include "chrome/browser/ui/omnibox/location_bar.h" |
50 #include "chrome/browser/ui/search/search.h" | 49 #include "chrome/browser/ui/search/search.h" |
51 #include "chrome/browser/ui/search/search_model.h" | 50 #include "chrome/browser/ui/search/search_model.h" |
52 #include "chrome/browser/ui/status_bubble.h" | 51 #include "chrome/browser/ui/status_bubble.h" |
53 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 52 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 53 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h" |
54 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" | 54 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" |
55 #include "chrome/browser/web_applications/web_app.h" | 55 #include "chrome/browser/web_applications/web_app.h" |
56 #include "chrome/common/chrome_switches.h" | 56 #include "chrome/common/chrome_switches.h" |
57 #include "chrome/common/pref_names.h" | 57 #include "chrome/common/pref_names.h" |
58 #include "content/public/browser/devtools_agent_host_registry.h" | 58 #include "content/public/browser/devtools_agent_host_registry.h" |
59 #include "content/public/browser/navigation_controller.h" | 59 #include "content/public/browser/navigation_controller.h" |
60 #include "content/public/browser/navigation_entry.h" | 60 #include "content/public/browser/navigation_entry.h" |
61 #include "content/public/browser/page_navigator.h" | 61 #include "content/public/browser/page_navigator.h" |
62 #include "content/public/browser/render_view_host.h" | 62 #include "content/public/browser/render_view_host.h" |
63 #include "content/public/browser/user_metrics.h" | 63 #include "content/public/browser/user_metrics.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 web_contents->GetController().ReloadIgnoringCache(true); | 171 web_contents->GetController().ReloadIgnoringCache(true); |
172 else | 172 else |
173 web_contents->GetController().Reload(true); | 173 web_contents->GetController().Reload(true); |
174 } | 174 } |
175 | 175 |
176 bool HasConstrainedWindow(const Browser* browser) { | 176 bool HasConstrainedWindow(const Browser* browser) { |
177 WebContents* web_contents = GetActiveWebContents(browser); | 177 WebContents* web_contents = GetActiveWebContents(browser); |
178 if (!web_contents) | 178 if (!web_contents) |
179 return false; | 179 return false; |
180 | 180 |
181 ConstrainedWindowTabHelper* constrained_window_tab_helper = | 181 WebContentsModalDialogManager* web_contents_dialog_manager = |
182 ConstrainedWindowTabHelper::FromWebContents(web_contents); | 182 WebContentsModalDialogManager::FromWebContents(web_contents); |
183 return constrained_window_tab_helper->dialog_count() > 0; | 183 return web_contents_dialog_manager->dialog_count() > 0; |
184 } | 184 } |
185 | 185 |
186 bool PrintPreviewShowing(const Browser* browser) { | 186 bool PrintPreviewShowing(const Browser* browser) { |
187 WebContents* contents = browser->tab_strip_model()->GetActiveWebContents(); | 187 WebContents* contents = browser->tab_strip_model()->GetActiveWebContents(); |
188 printing::PrintPreviewTabController* controller = | 188 printing::PrintPreviewTabController* controller = |
189 printing::PrintPreviewTabController::GetInstance(); | 189 printing::PrintPreviewTabController::GetInstance(); |
190 return controller && (controller->GetPrintPreviewForTab(contents) || | 190 return controller && (controller->GetPrintPreviewForTab(contents) || |
191 controller->is_creating_print_preview_tab()); | 191 controller->is_creating_print_preview_tab()); |
192 } | 192 } |
193 | 193 |
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1074 Browser::CreateParams::CreateForApp( | 1074 Browser::CreateParams::CreateForApp( |
1075 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile())); | 1075 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile())); |
1076 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1076 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
1077 | 1077 |
1078 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1078 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
1079 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1079 contents->GetRenderViewHost()->SyncRendererPrefs(); |
1080 app_browser->window()->Show(); | 1080 app_browser->window()->Show(); |
1081 } | 1081 } |
1082 | 1082 |
1083 } // namespace chrome | 1083 } // namespace chrome |
OLD | NEW |