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

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: Review v5 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
« no previous file with comments | « no previous file | extensions/browser/app_window/app_window.h » ('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 (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 // First, check if the window icon URL is a valid global URL.
337 create_params.window_icon_url = GURL(*options->icon.get());
338
339 // If the URL is not global, check for a valid extension local URL.
340 if (!create_params.window_icon_url.is_valid()) {
341 create_params.window_icon_url =
342 extension()->GetResourceURL(*options->icon.get());
343 }
344 }
345
335 if (options->type != app_window::WINDOW_TYPE_PANEL) { 346 if (options->type != app_window::WINDOW_TYPE_PANEL) {
336 switch (options->state) { 347 switch (options->state) {
337 case app_window::STATE_NONE: 348 case app_window::STATE_NONE:
338 case app_window::STATE_NORMAL: 349 case app_window::STATE_NORMAL:
339 break; 350 break;
340 case app_window::STATE_FULLSCREEN: 351 case app_window::STATE_FULLSCREEN:
341 create_params.state = ui::SHOW_STATE_FULLSCREEN; 352 create_params.state = ui::SHOW_STATE_FULLSCREEN;
342 break; 353 break;
343 case app_window::STATE_MAXIMIZED: 354 case app_window::STATE_MAXIMIZED:
344 create_params.state = ui::SHOW_STATE_MAXIMIZED; 355 create_params.state = ui::SHOW_STATE_MAXIMIZED;
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 575
565 if (options.frame->as_frame_options->inactive_color.get()) { 576 if (options.frame->as_frame_options->inactive_color.get()) {
566 error_ = app_window_constants::kInactiveColorWithoutColor; 577 error_ = app_window_constants::kInactiveColorWithoutColor;
567 return false; 578 return false;
568 } 579 }
569 580
570 return true; 581 return true;
571 } 582 }
572 583
573 } // namespace extensions 584 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | extensions/browser/app_window/app_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698