| 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/extensions/shell_window.h" | 5 #include "chrome/browser/ui/extensions/shell_window.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/extensions/extension_process_manager.h" | 9 #include "chrome/browser/extensions/extension_process_manager.h" |
| 10 #include "chrome/browser/extensions/extension_system.h" | 10 #include "chrome/browser/extensions/extension_system.h" |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 | 226 |
| 227 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, | 227 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, |
| 228 content::Source<Profile>(profile_)); | 228 content::Source<Profile>(profile_)); |
| 229 // Close when the browser is exiting. | 229 // Close when the browser is exiting. |
| 230 // TODO(mihaip): we probably don't want this in the long run (when platform | 230 // TODO(mihaip): we probably don't want this in the long run (when platform |
| 231 // apps are no longer tied to the browser process). | 231 // apps are no longer tied to the browser process). |
| 232 registrar_.Add(this, chrome::NOTIFICATION_APP_TERMINATING, | 232 registrar_.Add(this, chrome::NOTIFICATION_APP_TERMINATING, |
| 233 content::NotificationService::AllSources()); | 233 content::NotificationService::AllSources()); |
| 234 | 234 |
| 235 // Prevent the browser process from shutting down while this window is open. | 235 // Prevent the browser process from shutting down while this window is open. |
| 236 browser::StartKeepAlive(); | 236 chrome::StartKeepAlive(); |
| 237 | 237 |
| 238 UpdateExtensionAppIcon(); | 238 UpdateExtensionAppIcon(); |
| 239 } | 239 } |
| 240 | 240 |
| 241 ShellWindow::~ShellWindow() { | 241 ShellWindow::~ShellWindow() { |
| 242 // Unregister now to prevent getting NOTIFICATION_APP_TERMINATING if we're the | 242 // Unregister now to prevent getting NOTIFICATION_APP_TERMINATING if we're the |
| 243 // last window open. | 243 // last window open. |
| 244 registrar_.RemoveAll(); | 244 registrar_.RemoveAll(); |
| 245 | 245 |
| 246 // Remove shutdown prevention. | 246 // Remove shutdown prevention. |
| 247 browser::EndKeepAlive(); | 247 chrome::EndKeepAlive(); |
| 248 } | 248 } |
| 249 | 249 |
| 250 void ShellWindow::RequestMediaAccessPermission( | 250 void ShellWindow::RequestMediaAccessPermission( |
| 251 content::WebContents* web_contents, | 251 content::WebContents* web_contents, |
| 252 const content::MediaStreamRequest& request, | 252 const content::MediaStreamRequest& request, |
| 253 const content::MediaResponseCallback& callback) { | 253 const content::MediaResponseCallback& callback) { |
| 254 // Get the preferred default devices for the request. | 254 // Get the preferred default devices for the request. |
| 255 content::MediaStreamDevices devices; | 255 content::MediaStreamDevices devices; |
| 256 media::GetDefaultDevicesForProfile( | 256 media::GetDefaultDevicesForProfile( |
| 257 profile_, | 257 profile_, |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 const extensions::DraggableRegion& region = *iter; | 632 const extensions::DraggableRegion& region = *iter; |
| 633 sk_region->op( | 633 sk_region->op( |
| 634 region.bounds.x(), | 634 region.bounds.x(), |
| 635 region.bounds.y(), | 635 region.bounds.y(), |
| 636 region.bounds.right(), | 636 region.bounds.right(), |
| 637 region.bounds.bottom(), | 637 region.bounds.bottom(), |
| 638 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); | 638 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); |
| 639 } | 639 } |
| 640 return sk_region; | 640 return sk_region; |
| 641 } | 641 } |
| OLD | NEW |