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

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: Rebase to after mac app shim fix 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
« no previous file with comments | « apps/shell_window.h ('k') | chrome/browser/extensions/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/shell_window_registry.h" 15 #include "chrome/browser/extensions/shell_window_registry.h"
15 #include "chrome/browser/extensions/suggest_permission_util.h" 16 #include "chrome/browser/extensions/suggest_permission_util.h"
16 #include "chrome/browser/lifetime/application_lifetime.h" 17 #include "chrome/browser/lifetime/application_lifetime.h"
17 #include "chrome/browser/profiles/profile.h" 18 #include "chrome/browser/profiles/profile.h"
18 #include "chrome/browser/ui/extensions/native_app_window.h"
19 #include "chrome/common/extensions/extension.h" 19 #include "chrome/common/extensions/extension.h"
20 #include "chrome/common/extensions/extension_constants.h" 20 #include "chrome/common/extensions/extension_constants.h"
21 #include "chrome/common/extensions/extension_messages.h" 21 #include "chrome/common/extensions/extension_messages.h"
22 #include "chrome/common/extensions/manifest_handlers/icons_handler.h" 22 #include "chrome/common/extensions/manifest_handlers/icons_handler.h"
23 #include "components/web_modal/web_contents_modal_dialog_manager.h" 23 #include "components/web_modal/web_contents_modal_dialog_manager.h"
24 #include "content/public/browser/invalidate_type.h" 24 #include "content/public/browser/invalidate_type.h"
25 #include "content/public/browser/navigation_entry.h" 25 #include "content/public/browser/navigation_entry.h"
26 #include "content/public/browser/notification_details.h" 26 #include "content/public/browser/notification_details.h"
27 #include "content/public/browser/notification_service.h" 27 #include "content/public/browser/notification_service.h"
28 #include "content/public/browser/notification_source.h" 28 #include "content/public/browser/notification_source.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 if (bounds.width() != INT_MIN && bounds.width() < minimum_size.width()) 149 if (bounds.width() != INT_MIN && bounds.width() < minimum_size.width())
150 bounds.set_width(minimum_size.width()); 150 bounds.set_width(minimum_size.width());
151 151
152 if (maximum_size.height() && bounds.height() > maximum_size.height()) 152 if (maximum_size.height() && bounds.height() > maximum_size.height())
153 bounds.set_height(maximum_size.height()); 153 bounds.set_height(maximum_size.height());
154 if (bounds.height() != INT_MIN && bounds.height() < minimum_size.height()) 154 if (bounds.height() != INT_MIN && bounds.height() < minimum_size.height())
155 bounds.set_height(minimum_size.height()); 155 bounds.set_height(minimum_size.height());
156 156
157 new_params.bounds = bounds; 157 new_params.bounds = bounds;
158 158
159 native_app_window_.reset(NativeAppWindow::Create(this, new_params)); 159 native_app_window_.reset(delegate_->CreateNativeAppWindow(this, new_params));
160 160
161 if (!new_params.hidden) { 161 if (!new_params.hidden) {
162 if (window_type_is_panel()) 162 if (window_type_is_panel())
163 GetBaseWindow()->ShowInactive(); // Panels are not activated by default. 163 GetBaseWindow()->ShowInactive(); // Panels are not activated by default.
164 else 164 else
165 GetBaseWindow()->Show(); 165 GetBaseWindow()->Show();
166 } 166 }
167 167
168 if (new_params.state == ui::SHOW_STATE_FULLSCREEN) 168 if (new_params.state == ui::SHOW_STATE_FULLSCREEN)
169 Fullscreen(); 169 Fullscreen();
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 region.bounds.x(), 626 region.bounds.x(),
627 region.bounds.y(), 627 region.bounds.y(),
628 region.bounds.right(), 628 region.bounds.right(),
629 region.bounds.bottom(), 629 region.bounds.bottom(),
630 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); 630 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op);
631 } 631 }
632 return sk_region; 632 return sk_region;
633 } 633 }
634 634
635 } // namespace apps 635 } // namespace apps
OLDNEW
« no previous file with comments | « apps/shell_window.h ('k') | chrome/browser/extensions/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698