| 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 <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "ash/shelf/shelf_constants.h" |
| 10 #include "base/macros.h" | 11 #include "base/macros.h" |
| 11 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
| 12 #include "chrome/browser/app_mode/app_mode_utils.h" | 13 #include "chrome/browser/app_mode/app_mode_utils.h" |
| 13 #include "chrome/browser/chrome_notification_types.h" | 14 #include "chrome/browser/chrome_notification_types.h" |
| 14 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" | 15 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" |
| 15 #include "chrome/browser/favicon/favicon_utils.h" | 16 #include "chrome/browser/favicon/favicon_utils.h" |
| 16 #include "chrome/browser/file_select_helper.h" | 17 #include "chrome/browser/file_select_helper.h" |
| 17 #include "chrome/browser/lifetime/keep_alive_types.h" | 18 #include "chrome/browser/lifetime/keep_alive_types.h" |
| 18 #include "chrome/browser/lifetime/scoped_keep_alive.h" | 19 #include "chrome/browser/lifetime/scoped_keep_alive.h" |
| 19 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 20 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 const GURL& security_origin, | 276 const GURL& security_origin, |
| 276 content::MediaStreamType type, | 277 content::MediaStreamType type, |
| 277 const extensions::Extension* extension) { | 278 const extensions::Extension* extension) { |
| 278 return MediaCaptureDevicesDispatcher::GetInstance() | 279 return MediaCaptureDevicesDispatcher::GetInstance() |
| 279 ->CheckMediaAccessPermission( | 280 ->CheckMediaAccessPermission( |
| 280 web_contents, security_origin, type, extension); | 281 web_contents, security_origin, type, extension); |
| 281 } | 282 } |
| 282 | 283 |
| 283 int ChromeAppDelegate::PreferredIconSize() { | 284 int ChromeAppDelegate::PreferredIconSize() { |
| 284 #if defined(USE_ASH) | 285 #if defined(USE_ASH) |
| 285 return ash::kShelfSize; | 286 return ash::GetShelfLayoutConstant(ash::SHELF_SIZE); |
| 286 #else | 287 #else |
| 287 return extension_misc::EXTENSION_ICON_SMALL; | 288 return extension_misc::EXTENSION_ICON_SMALL; |
| 288 #endif | 289 #endif |
| 289 } | 290 } |
| 290 | 291 |
| 291 void ChromeAppDelegate::SetWebContentsBlocked( | 292 void ChromeAppDelegate::SetWebContentsBlocked( |
| 292 content::WebContents* web_contents, | 293 content::WebContents* web_contents, |
| 293 bool blocked) { | 294 bool blocked) { |
| 294 if (!blocked) | 295 if (!blocked) |
| 295 web_contents->Focus(); | 296 web_contents->Focus(); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 const content::NotificationDetails& details) { | 339 const content::NotificationDetails& details) { |
| 339 switch (type) { | 340 switch (type) { |
| 340 case chrome::NOTIFICATION_APP_TERMINATING: | 341 case chrome::NOTIFICATION_APP_TERMINATING: |
| 341 if (!terminating_callback_.is_null()) | 342 if (!terminating_callback_.is_null()) |
| 342 terminating_callback_.Run(); | 343 terminating_callback_.Run(); |
| 343 break; | 344 break; |
| 344 default: | 345 default: |
| 345 NOTREACHED() << "Received unexpected notification"; | 346 NOTREACHED() << "Received unexpected notification"; |
| 346 } | 347 } |
| 347 } | 348 } |
| OLD | NEW |