Skip to content

Commit

Permalink
Move resources used by app_list into app_list/resources
Browse files Browse the repository at this point in the history
TBR=thakis
BUG=503224

Review URL: https://codereview.chromium.org/1257223005

Cr-Commit-Position: refs/heads/master@{#344246}
  • Loading branch information
bshe authored and Commit bot committed Aug 19, 2015
1 parent 59bf8cd commit ce22274
Show file tree
Hide file tree
Showing 43 changed files with 125 additions and 24 deletions.
4 changes: 4 additions & 0 deletions chrome/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,10 @@ template("chrome_repack_percent") {
sources += [ "$root_gen_dir/extensions/extensions_browser_resources_${percent}_percent.pak" ]
deps += [ "//extensions:extensions_browser_resources" ]
}
if (enable_app_list) {
sources += [ "$root_gen_dir/ui/app_list/resources/app_list_resources_${percent}_percent.pak" ]
deps += [ "//ui/app_list/resources" ]
}

output = repack_output_file
}
Expand Down
5 changes: 5 additions & 0 deletions chrome/chrome_repack_chrome_100_percent.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
'<(SHARED_INTERMEDIATE_DIR)/extensions/extensions_browser_resources_100_percent.pak',
],
}],
['enable_app_list==1', {
'pak_inputs': [
'<(SHARED_INTERMEDIATE_DIR)/ui/app_list/resources/app_list_resources_100_percent.pak',
],
}],
],
},
'includes': [ '../build/repack_action.gypi' ],
Expand Down
5 changes: 5 additions & 0 deletions chrome/chrome_repack_chrome_200_percent.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
'<(SHARED_INTERMEDIATE_DIR)/extensions/extensions_browser_resources_200_percent.pak',
],
}],
['enable_app_list==1', {
'pak_inputs': [
'<(SHARED_INTERMEDIATE_DIR)/ui/app_list/resources/app_list_resources_200_percent.pak',
],
}],
],
},
'includes': [ '../build/repack_action.gypi' ],
Expand Down
5 changes: 5 additions & 0 deletions chrome/chrome_resources.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,11 @@
'<(DEPTH)/extensions/extensions_strings.gyp:extensions_strings',
],
}],
['enable_app_list==1', {
'dependencies': [
'<(DEPTH)/ui/app_list/resources/app_list_resources.gyp:app_list_resources',
],
}],
['OS != "mac" and OS != "ios"', {
# Copy pak files to the product directory. These files will be picked
# up by the following installer scripts:
Expand Down
3 changes: 3 additions & 0 deletions tools/gritsettings/resource_ids
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
"ui/resources/ui_resources.grd": {
"structures": [5500],
},
"ui/app_list/resources/app_list_resources.grd": {
"structures": [5760],
},
"ui/views/resources/views_resources.grd": {
"structures": [5800],
},
Expand Down
2 changes: 1 addition & 1 deletion ui/app_list/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ component("app_list") {
"//sync",
"//third_party/icu",
"//ui/accessibility",
"//ui/app_list/resources",
"//ui/base",
"//ui/base/ime",
"//ui/compositor",
Expand Down Expand Up @@ -223,7 +224,6 @@ static_library("test_support") {
"//base",
"//ui/gfx",
"//ui/gfx/geometry",
"//ui/resources",
]
}

Expand Down
2 changes: 1 addition & 1 deletion ui/app_list/app_list.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
'../resources/ui_resources.gyp:ui_resources',
'../strings/ui_strings.gyp:ui_strings',
'../../third_party/icu/icu.gyp:icuuc',
'resources/app_list_resources.gyp:app_list_resources',
],
'defines': [
'APP_LIST_IMPLEMENTATION',
Expand Down Expand Up @@ -229,7 +230,6 @@
'../../base/base.gyp:base',
'../gfx/gfx.gyp:gfx',
'../gfx/gfx.gyp:gfx_geometry',
'../resources/ui_resources.gyp:ui_resources',
'app_list',
],
'sources': [
Expand Down
2 changes: 1 addition & 1 deletion ui/app_list/app_list_menu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
#include "ui/app_list/app_list_menu.h"

#include "ui/app_list/app_list_view_delegate.h"
#include "ui/app_list/resources/grit/app_list_resources.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/models/menu_separator_types.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/resources/grit/ui_resources.h"
#include "ui/strings/grit/ui_strings.h"

namespace app_list {
Expand Down
2 changes: 1 addition & 1 deletion ui/app_list/cocoa/apps_search_box_controller.mm
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
#import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSBezierPath+RoundRect.h"
#include "ui/app_list/app_list_menu.h"
#include "ui/app_list/app_list_model.h"
#include "ui/app_list/resources/grit/app_list_resources.h"
#include "ui/app_list/search_box_model.h"
#include "ui/app_list/search_box_model_observer.h"
#import "ui/base/cocoa/controls/hover_image_menu_button.h"
#import "ui/base/cocoa/controls/hover_image_menu_button_cell.h"
#import "ui/base/cocoa/menu_controller.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image_skia_util_mac.h"
#include "ui/resources/grit/ui_resources.h"

namespace {

Expand Down
24 changes: 24 additions & 0 deletions ui/app_list/resources/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//tools/grit/grit_rule.gni")
import("//tools/grit/repack.gni")

group("resources") {
deps = [
":resources_grd",
]
}

grit("resources_grd") {
source = "app_list_resources.grd"
outputs = [
"grit/app_list_resources.h",
"grit/app_list_resources_map.cc",
"grit/app_list_resources_map.h",
"app_list_resources_100_percent.pak",
"app_list_resources_200_percent.pak",
"app_list_resources_300_percent.pak",
]
}
34 changes: 34 additions & 0 deletions ui/app_list/resources/app_list_resources.grd
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<grit latest_public_release="0" current_release="1">
<outputs>
<output filename="grit/app_list_resources.h" type="rc_header" context="default_100_percent">
<emit emit_type='prepend'></emit>
</output>
<output filename="grit/app_list_resources_map.cc" type="resource_map_source" context="default_100_percent" />
<output filename="grit/app_list_resources_map.h" type="resource_map_header" context="default_100_percent" />
<output filename="app_list_resources_100_percent.pak" type="data_package" context="default_100_percent" />
<output filename="app_list_resources_200_percent.pak" type="data_package" context="default_200_percent" />
<output filename="app_list_resources_300_percent.pak" type="data_package" context="default_300_percent" />
</outputs>
<release seq="1">
<structures fallback_to_low_resolution="true">
<!-- KEEP THESE IN ALPHABETICAL ORDER! DO NOT ADD TO RANDOM PLACES JUST
BECAUSE YOUR RESOURCES ARE FUNCTIONALLY RELATED OR FALL UNDER THE
SAME CONDITIONALS. -->
<structure type="chrome_scaled_image" name="IDR_APP_LIST_ITEM_PROGRESS_BACKGROUND" file="common/app_list_progress_bar_background.png" />
<structure type="chrome_scaled_image" name="IDR_APP_LIST_ITEM_PROGRESS_LEFT" file="common/app_list_progress_bar_left.png" />
<structure type="chrome_scaled_image" name="IDR_APP_LIST_ITEM_PROGRESS_CENTER" file="common/app_list_progress_bar_center.png" />
<structure type="chrome_scaled_image" name="IDR_APP_LIST_ITEM_PROGRESS_RIGHT" file="common/app_list_progress_bar_right.png" />
<structure type="chrome_scaled_image" name="IDR_APP_LIST_TOOLS_HOVER" file="common/app_list_tools_hover.png" />
<structure type="chrome_scaled_image" name="IDR_APP_LIST_TOOLS_NORMAL" file="common/app_list_tools_normal.png" />
<structure type="chrome_scaled_image" name="IDR_APP_LIST_TOOLS_PRESSED" file="common/app_list_tools_pressed.png" />
<structure type="chrome_scaled_image" name="IDR_APP_LIST_FOLDER_BACK_NORMAL" file="common/app_list_folder_back_normal.png" />
<structure type="chrome_scaled_image" name="IDR_APP_LIST_SPEECH_MIC_ON" file="common/app_list_mic_on.png" />
<structure type="chrome_scaled_image" name="IDR_APP_LIST_SPEECH_MIC_OFF" file="common/app_list_mic_off.png" />
<structure type="chrome_scaled_image" name="IDR_APP_LIST_SPEECH_MIC_RECORDING" file="common/app_list_mic_recording.png" />
<if expr="is_win or desktop_linux">
<structure type="chrome_scaled_image" name="IDR_APP_LIST_USER_INDICATOR" file="common/app_list_user_indicator.png" />
</if>
</structures>
</release>
</grit>
27 changes: 27 additions & 0 deletions ui/app_list/resources/app_list_resources.gyp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

{
'variables': {
'chromium_code': 1,
},
'targets': [
{
# GN version: //ui/app_list/resources
'target_name': 'app_list_resources',
'type': 'none',
'variables': {
'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/ui/app_list/resources',
},
'actions': [{
'action_name': 'app_list_resources',
'variables': {
'grit_grd_file': 'app_list_resources.grd',
},
'includes': [ '../../../build/grit_action.gypi' ],
}],
'includes': [ '../../../build/grit_target.gypi' ],
},
],
}
2 changes: 1 addition & 1 deletion ui/app_list/views/folder_header_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
#include "ui/app_list/app_list_constants.h"
#include "ui/app_list/app_list_folder_item.h"
#include "ui/app_list/app_list_switches.h"
#include "ui/app_list/resources/grit/app_list_resources.h"
#include "ui/app_list/views/app_list_folder_view.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
#include "ui/resources/grit/ui_resources.h"
#include "ui/strings/grit/ui_strings.h"
#include "ui/views/border.h"
#include "ui/views/controls/button/image_button.h"
Expand Down
2 changes: 1 addition & 1 deletion ui/app_list/views/progress_bar_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

#include <algorithm>

#include "ui/app_list/resources/grit/app_list_resources.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/resources/grit/ui_resources.h"
#include "ui/views/painter.h"

namespace app_list {
Expand Down
2 changes: 1 addition & 1 deletion ui/app_list/views/search_box_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "ui/app_list/app_list_model.h"
#include "ui/app_list/app_list_switches.h"
#include "ui/app_list/app_list_view_delegate.h"
#include "ui/app_list/resources/grit/app_list_resources.h"
#include "ui/app_list/search_box_model.h"
#include "ui/app_list/speech_ui_model.h"
#include "ui/app_list/views/app_list_menu_views.h"
Expand All @@ -21,7 +22,6 @@
#include "ui/events/event.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/shadow_value.h"
#include "ui/resources/grit/ui_resources.h"
#include "ui/strings/grit/ui_strings.h"
#include "ui/views/border.h"
#include "ui/views/controls/button/image_button.h"
Expand Down
2 changes: 1 addition & 1 deletion ui/app_list/views/speech_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
#include "ui/app_list/app_list_constants.h"
#include "ui/app_list/app_list_model.h"
#include "ui/app_list/app_list_view_delegate.h"
#include "ui/app_list/resources/grit/app_list_resources.h"
#include "ui/app_list/speech_ui_model.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/path.h"
#include "ui/gfx/shadow_value.h"
#include "ui/resources/grit/ui_resources.h"
#include "ui/strings/grit/ui_strings.h"
#include "ui/views/animation/bounds_animator.h"
#include "ui/views/background.h"
Expand Down
5 changes: 5 additions & 0 deletions ui/resources/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ repack("repack_ui_test_pak") {
"$root_gen_dir/ui/views/resources/views_resources_100_percent.pak",
]
}

if (enable_app_list) {
deps += [ "//ui/app_list/resources" ]
sources += [ "$root_gen_dir/ui/app_list/resources/app_list_resources_100_percent.pak" ]
}
}

# Repack just the strings for the framework locales on Mac and iOS. This
Expand Down
16 changes: 0 additions & 16 deletions ui/resources/ui_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,6 @@
<!-- KEEP THESE IN ALPHABETICAL ORDER! DO NOT ADD TO RANDOM PLACES JUST
BECAUSE YOUR RESOURCES ARE FUNCTIONALLY RELATED OR FALL UNDER THE
SAME CONDITIONALS. -->
<if expr="enable_app_list">
<structure type="chrome_scaled_image" name="IDR_APP_LIST_ITEM_PROGRESS_BACKGROUND" file="common/app_list_progress_bar_background.png" />
<structure type="chrome_scaled_image" name="IDR_APP_LIST_ITEM_PROGRESS_LEFT" file="common/app_list_progress_bar_left.png" />
<structure type="chrome_scaled_image" name="IDR_APP_LIST_ITEM_PROGRESS_CENTER" file="common/app_list_progress_bar_center.png" />
<structure type="chrome_scaled_image" name="IDR_APP_LIST_ITEM_PROGRESS_RIGHT" file="common/app_list_progress_bar_right.png" />
<structure type="chrome_scaled_image" name="IDR_APP_LIST_TOOLS_HOVER" file="common/app_list_tools_hover.png" />
<structure type="chrome_scaled_image" name="IDR_APP_LIST_TOOLS_NORMAL" file="common/app_list_tools_normal.png" />
<structure type="chrome_scaled_image" name="IDR_APP_LIST_TOOLS_PRESSED" file="common/app_list_tools_pressed.png" />
<structure type="chrome_scaled_image" name="IDR_APP_LIST_FOLDER_BACK_NORMAL" file="common/app_list_folder_back_normal.png" />
<structure type="chrome_scaled_image" name="IDR_APP_LIST_SPEECH_MIC_ON" file="common/app_list_mic_on.png" />
<structure type="chrome_scaled_image" name="IDR_APP_LIST_SPEECH_MIC_OFF" file="common/app_list_mic_off.png" />
<structure type="chrome_scaled_image" name="IDR_APP_LIST_SPEECH_MIC_RECORDING" file="common/app_list_mic_recording.png" />
<if expr="is_win or desktop_linux">
<structure type="chrome_scaled_image" name="IDR_APP_LIST_USER_INDICATOR" file="common/app_list_user_indicator.png" />
</if>
</if>
<if expr="is_linux and use_aura">
<structure type="chrome_scaled_image" name="IDR_AURA_CURSOR_BIG_ALIAS" file="common/pointers/alias_big.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_CURSOR_BIG_CELL" file="common/pointers/cell_big.png" />
Expand Down
5 changes: 5 additions & 0 deletions ui/resources/ui_resources.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@
'<(SHARED_INTERMEDIATE_DIR)/ui/views/resources/views_resources_100_percent.pak',
],
}],
['enable_app_list==1', {
'pak_inputs': [
'<(SHARED_INTERMEDIATE_DIR)/ui/app_list/resources/app_list_resources_100_percent.pak',
],
}],
],
},
'includes': [ '../../build/repack_action.gypi' ],
Expand Down

0 comments on commit ce22274

Please sign in to comment.