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

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

Issue 2209053004: Enhance chrome.app.window API with icon property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 325
326 if (options->show_in_shelf.get()) { 326 if (options->show_in_shelf.get()) {
327 create_params.show_in_shelf = *options->show_in_shelf.get(); 327 create_params.show_in_shelf = *options->show_in_shelf.get();
328 328
329 if (create_params.show_in_shelf && create_params.window_key.empty()) { 329 if (create_params.show_in_shelf && create_params.window_key.empty()) {
330 error_ = app_window_constants::kShowInShelfWindowKeyNotSet; 330 error_ = app_window_constants::kShowInShelfWindowKeyNotSet;
331 return false; 331 return false;
332 } 332 }
333 } 333 }
334 334
335 if (options->icon.get()) {
336 create_params.window_icon_url = GURL(*options->icon.get());
337
338 if (!create_params.window_icon_url.is_valid())
339 create_params.window_icon_url =
340 extension()->GetResourceURL(*options->icon.get());
stevenjb 2016/08/04 21:00:47 {}
Andra Paraschiv 2016/08/08 13:34:12 Done.
341 }
342
335 if (options->type != app_window::WINDOW_TYPE_PANEL) { 343 if (options->type != app_window::WINDOW_TYPE_PANEL) {
336 switch (options->state) { 344 switch (options->state) {
337 case app_window::STATE_NONE: 345 case app_window::STATE_NONE:
338 case app_window::STATE_NORMAL: 346 case app_window::STATE_NORMAL:
339 break; 347 break;
340 case app_window::STATE_FULLSCREEN: 348 case app_window::STATE_FULLSCREEN:
341 create_params.state = ui::SHOW_STATE_FULLSCREEN; 349 create_params.state = ui::SHOW_STATE_FULLSCREEN;
342 break; 350 break;
343 case app_window::STATE_MAXIMIZED: 351 case app_window::STATE_MAXIMIZED:
344 create_params.state = ui::SHOW_STATE_MAXIMIZED; 352 create_params.state = ui::SHOW_STATE_MAXIMIZED;
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 572
565 if (options.frame->as_frame_options->inactive_color.get()) { 573 if (options.frame->as_frame_options->inactive_color.get()) {
566 error_ = app_window_constants::kInactiveColorWithoutColor; 574 error_ = app_window_constants::kInactiveColorWithoutColor;
567 return false; 575 return false;
568 } 576 }
569 577
570 return true; 578 return true;
571 } 579 }
572 580
573 } // namespace extensions 581 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698