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

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

Issue 2738373002: Enhance chrome.app.window API with window background color (Closed)
Patch Set: Created 3 years, 9 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
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 "extensions/browser/api/app_window/app_window_api.h" 5 #include "extensions/browser/api/app_window/app_window_api.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 return false; 291 return false;
292 } 292 }
293 #if defined(USE_AURA) 293 #if defined(USE_AURA)
294 create_params.alpha_enabled = *options->alpha_enabled; 294 create_params.alpha_enabled = *options->alpha_enabled;
295 #else 295 #else
296 // Transparency is only supported on Aura. 296 // Transparency is only supported on Aura.
297 // Fallback to creating an opaque window (by ignoring alphaEnabled). 297 // Fallback to creating an opaque window (by ignoring alphaEnabled).
298 #endif 298 #endif
299 } 299 }
300 300
301 if (options->background_color.get()) {
302 if (!image_util::ParseHexColorString(*options->background_color,
303 &create_params.background_color)) {
304 error_ = app_window_constants::kInvalidColorSpecification;
305 return false;
306 }
307 }
308
301 if (options->hidden.get()) 309 if (options->hidden.get())
302 create_params.hidden = *options->hidden; 310 create_params.hidden = *options->hidden;
303 311
304 if (options->resizable.get()) 312 if (options->resizable.get())
305 create_params.resizable = *options->resizable; 313 create_params.resizable = *options->resizable;
306 314
307 if (options->always_on_top.get()) { 315 if (options->always_on_top.get()) {
308 create_params.always_on_top = *options->always_on_top; 316 create_params.always_on_top = *options->always_on_top;
309 317
310 if (create_params.always_on_top && 318 if (create_params.always_on_top &&
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 582
575 if (options.frame->as_frame_options->inactive_color.get()) { 583 if (options.frame->as_frame_options->inactive_color.get()) {
576 error_ = app_window_constants::kInactiveColorWithoutColor; 584 error_ = app_window_constants::kInactiveColorWithoutColor;
577 return false; 585 return false;
578 } 586 }
579 587
580 return true; 588 return true;
581 } 589 }
582 590
583 } // namespace extensions 591 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698