Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Side by Side Diff: apps/shell_window.cc

Issue 21344002: Move native_app_window code to apps areas (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge error Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/native_app_window.h"
7 #include "apps/shell_window_geometry_cache.h" 8 #include "apps/shell_window_geometry_cache.h"
8 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
10 #include "base/values.h" 11 #include "base/values.h"
11 #include "chrome/browser/chrome_notification_types.h" 12 #include "chrome/browser/chrome_notification_types.h"
12 #include "chrome/browser/extensions/extension_process_manager.h" 13 #include "chrome/browser/extensions/extension_process_manager.h"
13 #include "chrome/browser/extensions/extension_system.h" 14 #include "chrome/browser/extensions/extension_system.h"
14 #include "chrome/browser/extensions/image_loader.h" 15 #include "chrome/browser/extensions/image_loader.h"
15 #include "chrome/browser/extensions/shell_window_registry.h" 16 #include "chrome/browser/extensions/shell_window_registry.h"
16 #include "chrome/browser/extensions/suggest_permission_util.h" 17 #include "chrome/browser/extensions/suggest_permission_util.h"
17 #include "chrome/browser/lifetime/application_lifetime.h" 18 #include "chrome/browser/lifetime/application_lifetime.h"
18 #include "chrome/browser/profiles/profile.h" 19 #include "chrome/browser/profiles/profile.h"
19 #include "chrome/browser/ui/extensions/native_app_window.h"
20 #include "chrome/common/extensions/extension.h" 20 #include "chrome/common/extensions/extension.h"
21 #include "chrome/common/extensions/extension_constants.h" 21 #include "chrome/common/extensions/extension_constants.h"
22 #include "chrome/common/extensions/extension_messages.h" 22 #include "chrome/common/extensions/extension_messages.h"
23 #include "chrome/common/extensions/manifest_handlers/icons_handler.h" 23 #include "chrome/common/extensions/manifest_handlers/icons_handler.h"
24 #include "components/web_modal/web_contents_modal_dialog_manager.h" 24 #include "components/web_modal/web_contents_modal_dialog_manager.h"
25 #include "content/public/browser/invalidate_type.h" 25 #include "content/public/browser/invalidate_type.h"
26 #include "content/public/browser/navigation_entry.h" 26 #include "content/public/browser/navigation_entry.h"
27 #include "content/public/browser/notification_details.h" 27 #include "content/public/browser/notification_details.h"
28 #include "content/public/browser/notification_service.h" 28 #include "content/public/browser/notification_service.h"
29 #include "content/public/browser/notification_source.h" 29 #include "content/public/browser/notification_source.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 if (maximum_size.height() && bounds.height() > maximum_size.height()) 154 if (maximum_size.height() && bounds.height() > maximum_size.height())
155 bounds.set_height(maximum_size.height()); 155 bounds.set_height(maximum_size.height());
156 if (bounds.height() != INT_MIN && bounds.height() < minimum_size.height()) 156 if (bounds.height() != INT_MIN && bounds.height() < minimum_size.height())
157 bounds.set_height(minimum_size.height()); 157 bounds.set_height(minimum_size.height());
158 158
159 new_params.bounds = bounds; 159 new_params.bounds = bounds;
160 160
161 if (cached_state != ui::SHOW_STATE_DEFAULT) 161 if (cached_state != ui::SHOW_STATE_DEFAULT)
162 new_params.state = cached_state; 162 new_params.state = cached_state;
163 163
164 native_app_window_.reset(NativeAppWindow::Create(this, new_params)); 164 native_app_window_.reset(delegate_->CreateNativeAppWindow(this, new_params));
165 165
166 if (!new_params.hidden) { 166 if (!new_params.hidden) {
167 if (window_type_is_panel()) 167 if (window_type_is_panel())
168 GetBaseWindow()->ShowInactive(); // Panels are not activated by default. 168 GetBaseWindow()->ShowInactive(); // Panels are not activated by default.
169 else 169 else
170 GetBaseWindow()->Show(); 170 GetBaseWindow()->Show();
171 } 171 }
172 172
173 if (new_params.state == ui::SHOW_STATE_FULLSCREEN) 173 if (new_params.state == ui::SHOW_STATE_FULLSCREEN)
174 Fullscreen(); 174 Fullscreen();
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 region.bounds.x(), 629 region.bounds.x(),
630 region.bounds.y(), 630 region.bounds.y(),
631 region.bounds.right(), 631 region.bounds.right(),
632 region.bounds.bottom(), 632 region.bounds.bottom(),
633 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); 633 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op);
634 } 634 }
635 return sk_region; 635 return sk_region;
636 } 636 }
637 637
638 } // namespace apps 638 } // namespace apps
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698