| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "apps/shell_window.h" | 5 #include "apps/shell_window.h" |
| 6 | 6 |
| 7 #include "apps/shell_window_geometry_cache.h" | 7 #include "apps/shell_window_geometry_cache.h" |
| 8 #include "apps/shell_window_registry.h" | 8 #include "apps/shell_window_registry.h" |
| 9 #include "apps/ui/native_app_window.h" | 9 #include "apps/ui/native_app_window.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 else if (new_params.state == ui::SHOW_STATE_MINIMIZED) | 201 else if (new_params.state == ui::SHOW_STATE_MINIMIZED) |
| 202 Minimize(); | 202 Minimize(); |
| 203 | 203 |
| 204 OnNativeWindowChanged(); | 204 OnNativeWindowChanged(); |
| 205 | 205 |
| 206 // When the render view host is changed, the native window needs to know | 206 // When the render view host is changed, the native window needs to know |
| 207 // about it in case it has any setup to do to make the renderer appear | 207 // about it in case it has any setup to do to make the renderer appear |
| 208 // properly. In particular, on Windows, the view's clickthrough region needs | 208 // properly. In particular, on Windows, the view's clickthrough region needs |
| 209 // to be set. | 209 // to be set. |
| 210 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, | 210 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, |
| 211 content::Source<Profile>(profile_)); | 211 content::Source<Profile>(profile_->GetOriginalProfile())); |
| 212 // Close when the browser process is exiting. | 212 // Close when the browser process is exiting. |
| 213 registrar_.Add(this, chrome::NOTIFICATION_APP_TERMINATING, | 213 registrar_.Add(this, chrome::NOTIFICATION_APP_TERMINATING, |
| 214 content::NotificationService::AllSources()); | 214 content::NotificationService::AllSources()); |
| 215 | 215 |
| 216 shell_window_contents_->LoadContents(new_params.creator_process_id); | 216 shell_window_contents_->LoadContents(new_params.creator_process_id); |
| 217 | 217 |
| 218 if (CommandLine::ForCurrentProcess()->HasSwitch( | 218 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 219 switches::kEnableAppsShowOnFirstPaint)) { | 219 switches::kEnableAppsShowOnFirstPaint)) { |
| 220 // We want to show the window only when the content has been painted. For | 220 // We want to show the window only when the content has been painted. For |
| 221 // that to happen, we need to define a size for the content, otherwise the | 221 // that to happen, we need to define a size for the content, otherwise the |
| (...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 885 region.bounds.x(), | 885 region.bounds.x(), |
| 886 region.bounds.y(), | 886 region.bounds.y(), |
| 887 region.bounds.right(), | 887 region.bounds.right(), |
| 888 region.bounds.bottom(), | 888 region.bounds.bottom(), |
| 889 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); | 889 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); |
| 890 } | 890 } |
| 891 return sk_region; | 891 return sk_region; |
| 892 } | 892 } |
| 893 | 893 |
| 894 } // namespace apps | 894 } // namespace apps |
| OLD | NEW |