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

Side by Side Diff: chrome/browser/extensions/api/app_window/app_window_api.cc

Issue 10986092: Transparent apps support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address reviewer's comment Created 8 years, 1 month 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 (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/extensions/api/app_window/app_window_api.h" 5 #include "chrome/browser/extensions/api/app_window/app_window_api.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/time.h" 8 #include "base/time.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/debugger/devtools_window.h" 10 #include "chrome/browser/debugger/devtools_window.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 if (options->left.get() || options->top.get()) { 133 if (options->left.get() || options->top.get()) {
134 if (options->left.get()) 134 if (options->left.get())
135 create_params.bounds.set_x(*options->left.get()); 135 create_params.bounds.set_x(*options->left.get());
136 if (options->top.get()) 136 if (options->top.get())
137 create_params.bounds.set_y(*options->top.get()); 137 create_params.bounds.set_y(*options->top.get());
138 create_params.restore_position = false; 138 create_params.restore_position = false;
139 } 139 }
140 140
141 if (options->frame.get()) { 141 if (options->frame.get()) {
142 if (*options->frame == kHtmlFrameOption && 142 if (*options->frame == kHtmlFrameOption &&
143 CommandLine::ForCurrentProcess()->HasSwitch( 143 GetExtension()->HasAPIPermission(APIPermission::kExperimental)) {
144 switches::kEnableExperimentalExtensionApis)) {
145 create_params.frame = ShellWindow::CreateParams::FRAME_NONE; 144 create_params.frame = ShellWindow::CreateParams::FRAME_NONE;
146 inject_html_titlebar = true; 145 inject_html_titlebar = true;
147 } else if (*options->frame == kNoneFrameOption) { 146 } else if (*options->frame == kNoneFrameOption) {
148 create_params.frame = ShellWindow::CreateParams::FRAME_NONE; 147 create_params.frame = ShellWindow::CreateParams::FRAME_NONE;
149 } else { 148 } else {
150 create_params.frame = ShellWindow::CreateParams::FRAME_CHROME; 149 create_params.frame = ShellWindow::CreateParams::FRAME_CHROME;
151 } 150 }
152 } 151 }
153 152
153 if (options->transparent_background.get() &&
154 GetExtension()->HasAPIPermission(APIPermission::kExperimental)) {
155 create_params.transparent_background = *options->transparent_background;
156 }
157
154 gfx::Size& minimum_size = create_params.minimum_size; 158 gfx::Size& minimum_size = create_params.minimum_size;
155 if (options->min_width.get()) 159 if (options->min_width.get())
156 minimum_size.set_width(*options->min_width); 160 minimum_size.set_width(*options->min_width);
157 if (options->min_height.get()) 161 if (options->min_height.get())
158 minimum_size.set_height(*options->min_height); 162 minimum_size.set_height(*options->min_height);
159 gfx::Size& maximum_size = create_params.maximum_size; 163 gfx::Size& maximum_size = create_params.maximum_size;
160 if (options->max_width.get()) 164 if (options->max_width.get())
161 maximum_size.set_width(*options->max_width); 165 maximum_size.set_width(*options->max_width);
162 if (options->max_height.get()) 166 if (options->max_height.get())
163 maximum_size.set_height(*options->max_height); 167 maximum_size.set_height(*options->max_height);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 if (ShellWindowRegistry::Get(profile())->HadDevToolsAttached(created_view)) { 212 if (ShellWindowRegistry::Get(profile())->HadDevToolsAttached(created_view)) {
209 new DevToolsRestorer(this, created_view); 213 new DevToolsRestorer(this, created_view);
210 return true; 214 return true;
211 } 215 }
212 216
213 SendResponse(true); 217 SendResponse(true);
214 return true; 218 return true;
215 } 219 }
216 220
217 } // namespace extensions 221 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/extensions/shell_window.h » ('j') | chrome/browser/ui/views/extensions/shell_window_views.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698