| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/apps/chrome_app_delegate.h" | 5 #include "chrome/browser/ui/apps/chrome_app_delegate.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" | 10 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" |
| 11 #include "chrome/browser/favicon/favicon_tab_helper.h" | 11 #include "chrome/browser/favicon/favicon_tab_helper.h" |
| 12 #include "chrome/browser/file_select_helper.h" | 12 #include "chrome/browser/file_select_helper.h" |
| 13 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 13 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
| 14 #include "chrome/browser/platform_util.h" | 14 #include "chrome/browser/platform_util.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/shell_integration.h" | 16 #include "chrome/browser/shell_integration.h" |
| 17 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
| 18 #include "chrome/browser/ui/browser_dialogs.h" | 18 #include "chrome/browser/ui/browser_dialogs.h" |
| 19 #include "chrome/browser/ui/browser_tabstrip.h" | 19 #include "chrome/browser/ui/browser_tabstrip.h" |
| 20 #include "chrome/browser/ui/browser_window.h" | 20 #include "chrome/browser/ui/browser_window.h" |
| 21 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 21 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
| 22 #include "chrome/browser/ui/web_contents_sizer.h" |
| 22 #include "chrome/common/extensions/chrome_extension_messages.h" | 23 #include "chrome/common/extensions/chrome_extension_messages.h" |
| 23 #include "content/public/browser/browser_context.h" | 24 #include "content/public/browser/browser_context.h" |
| 24 #include "content/public/browser/notification_service.h" | 25 #include "content/public/browser/notification_service.h" |
| 25 #include "content/public/browser/render_view_host.h" | 26 #include "content/public/browser/render_view_host.h" |
| 26 #include "content/public/browser/web_contents.h" | 27 #include "content/public/browser/web_contents.h" |
| 27 #include "content/public/browser/web_contents_delegate.h" | 28 #include "content/public/browser/web_contents_delegate.h" |
| 28 #include "extensions/common/constants.h" | 29 #include "extensions/common/constants.h" |
| 29 #include "grit/theme_resources.h" | 30 #include "grit/theme_resources.h" |
| 30 #include "ui/base/resource/resource_bundle.h" | 31 #include "ui/base/resource/resource_bundle.h" |
| 31 | 32 |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 printing::PrintViewManager::CreateForWebContents(web_contents); | 170 printing::PrintViewManager::CreateForWebContents(web_contents); |
| 170 printing::PrintPreviewMessageHandler::CreateForWebContents(web_contents); | 171 printing::PrintPreviewMessageHandler::CreateForWebContents(web_contents); |
| 171 #else | 172 #else |
| 172 printing::PrintViewManagerBasic::CreateForWebContents(web_contents); | 173 printing::PrintViewManagerBasic::CreateForWebContents(web_contents); |
| 173 #endif // defined(ENABLE_FULL_PRINTING) | 174 #endif // defined(ENABLE_FULL_PRINTING) |
| 174 #endif // defined(ENABLE_PRINTING) | 175 #endif // defined(ENABLE_PRINTING) |
| 175 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( | 176 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( |
| 176 web_contents); | 177 web_contents); |
| 177 } | 178 } |
| 178 | 179 |
| 180 void ChromeAppDelegate::ResizeWebContents(content::WebContents* web_contents, |
| 181 const gfx::Size& size) { |
| 182 ::ResizeWebContents(web_contents, size); |
| 183 } |
| 184 |
| 179 content::WebContents* ChromeAppDelegate::OpenURLFromTab( | 185 content::WebContents* ChromeAppDelegate::OpenURLFromTab( |
| 180 content::BrowserContext* context, | 186 content::BrowserContext* context, |
| 181 content::WebContents* source, | 187 content::WebContents* source, |
| 182 const content::OpenURLParams& params) { | 188 const content::OpenURLParams& params) { |
| 183 return OpenURLFromTabInternal(context, params); | 189 return OpenURLFromTabInternal(context, params); |
| 184 } | 190 } |
| 185 | 191 |
| 186 void ChromeAppDelegate::AddNewContents(content::BrowserContext* context, | 192 void ChromeAppDelegate::AddNewContents(content::BrowserContext* context, |
| 187 content::WebContents* new_contents, | 193 content::WebContents* new_contents, |
| 188 WindowOpenDisposition disposition, | 194 WindowOpenDisposition disposition, |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 const content::NotificationDetails& details) { | 277 const content::NotificationDetails& details) { |
| 272 switch (type) { | 278 switch (type) { |
| 273 case chrome::NOTIFICATION_APP_TERMINATING: | 279 case chrome::NOTIFICATION_APP_TERMINATING: |
| 274 if (!terminating_callback_.is_null()) | 280 if (!terminating_callback_.is_null()) |
| 275 terminating_callback_.Run(); | 281 terminating_callback_.Run(); |
| 276 break; | 282 break; |
| 277 default: | 283 default: |
| 278 NOTREACHED() << "Received unexpected notification"; | 284 NOTREACHED() << "Received unexpected notification"; |
| 279 } | 285 } |
| 280 } | 286 } |
| OLD | NEW |