| 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/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 } | 180 } |
| 181 | 181 |
| 182 bool IsShowingWebContentsModalDialog(const Browser* browser) { | 182 bool IsShowingWebContentsModalDialog(const Browser* browser) { |
| 183 WebContents* web_contents = | 183 WebContents* web_contents = |
| 184 browser->tab_strip_model()->GetActiveWebContents(); | 184 browser->tab_strip_model()->GetActiveWebContents(); |
| 185 if (!web_contents) | 185 if (!web_contents) |
| 186 return false; | 186 return false; |
| 187 | 187 |
| 188 WebContentsModalDialogManager* web_contents_modal_dialog_manager = | 188 WebContentsModalDialogManager* web_contents_modal_dialog_manager = |
| 189 WebContentsModalDialogManager::FromWebContents(web_contents); | 189 WebContentsModalDialogManager::FromWebContents(web_contents); |
| 190 return web_contents_modal_dialog_manager->IsShowingDialog(); | 190 return web_contents_modal_dialog_manager->IsDialogActive(); |
| 191 } | 191 } |
| 192 | 192 |
| 193 bool PrintPreviewShowing(const Browser* browser) { | 193 bool PrintPreviewShowing(const Browser* browser) { |
| 194 #if defined(ENABLE_FULL_PRINTING) | 194 #if defined(ENABLE_FULL_PRINTING) |
| 195 WebContents* contents = browser->tab_strip_model()->GetActiveWebContents(); | 195 WebContents* contents = browser->tab_strip_model()->GetActiveWebContents(); |
| 196 printing::PrintPreviewDialogController* controller = | 196 printing::PrintPreviewDialogController* controller = |
| 197 printing::PrintPreviewDialogController::GetInstance(); | 197 printing::PrintPreviewDialogController::GetInstance(); |
| 198 return controller && (controller->GetPrintPreviewForContents(contents) || | 198 return controller && (controller->GetPrintPreviewForContents(contents) || |
| 199 controller->is_creating_print_preview_dialog()); | 199 controller->is_creating_print_preview_dialog()); |
| 200 #else | 200 #else |
| (...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1117 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile(), | 1117 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile(), |
| 1118 browser->host_desktop_type())); | 1118 browser->host_desktop_type())); |
| 1119 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1119 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
| 1120 | 1120 |
| 1121 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1121 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
| 1122 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1122 contents->GetRenderViewHost()->SyncRendererPrefs(); |
| 1123 app_browser->window()->Show(); | 1123 app_browser->window()->Show(); |
| 1124 } | 1124 } |
| 1125 | 1125 |
| 1126 } // namespace chrome | 1126 } // namespace chrome |
| OLD | NEW |