diff options
author | msw <msw@chromium.org> | 2016-02-09 16:26:16 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-10 00:27:47 +0000 |
commit | 40ddaa81f4e1e88439377986ce5c268afdf16e1d (patch) | |
tree | c5a2442e279040baf64c11ae2622db7e37e95a76 | |
parent | 382da786010fc309637e9afba4593ff65ae46e34 (diff) | |
download | chromium_src-40ddaa81f4e1e88439377986ce5c268afdf16e1d.zip chromium_src-40ddaa81f4e1e88439377986ce5c268afdf16e1d.tar.gz chromium_src-40ddaa81f4e1e88439377986ce5c268afdf16e1d.tar.bz2 |
Support building ash targets with use_ash=0 and use_aura=1.
Support building/running ash_unittests and ash_shell_with_content.
Change some build |use_ash| checks to |use_aura| (or remove them).
Avoid the unspecified ash dependency on chrome resources!
Explicitly load new ash_test_*.pak image/string resources instead.
(avoids including ash_resources in chrome paks w/use_aura builds)
Reserve more resource IDs for ash_strings to avoid overlap.
(uses 244 IDs now; reserve 300 instead of 200 to fit existing)
Reserve fewer content shell resource IDs, to avoid exceeding 3100.
(uses 4 IDs now; reserve 150 instead of 250 to keep current total)
https://code.google.com/p/chromium/codesearch#chromium/src/out/Debug/gen/content/shell/grit/shell_resources.h
Use base::i18n::GetConfiguredLocale(), in several ash_unittests.
(l10n_util::GetApplicationLocale fails IsLocaleAvailable('en-US'))
(because it's not loading the chrome locale data anymore)
(seems okay to pair with base::i18n::SetICUDefaultLocale)
TODO: Fix ash_unittests failures/crahes (repros on ToT w/use_ash).
TODO: Fix ash_shell_with_content crash (repros on ToT w/use_ash).
TODO: Load ash resources; not 'common' in ash_shell_with_content.
TODO: Exclude ash files from message_center crbug.com/585175.
TODO: Support ash_test_resources_300_percent.pak, etc.?
BUG=584038,585175
TEST=Building ash_unittests and ash_shell_with_content works with use_ash=0 and use_aura=1.
R=oshima@chromium.org,dewittj@chromium.org,sky@chromium.org
TBR=jam@chromium.org
Review URL: https://codereview.chromium.org/1664013002
Cr-Commit-Position: refs/heads/master@{#374547}
-rw-r--r-- | BUILD.gn | 7 | ||||
-rw-r--r-- | ash/BUILD.gn | 10 | ||||
-rw-r--r-- | ash/ash.gyp | 3 | ||||
-rw-r--r-- | ash/ash_resources.gyp | 111 | ||||
-rw-r--r-- | ash/ash_strings.gyp | 40 | ||||
-rw-r--r-- | ash/ash_unittests.isolate | 7 | ||||
-rw-r--r-- | ash/frame/caption_buttons/frame_size_button_unittest.cc | 3 | ||||
-rw-r--r-- | ash/host/ash_window_tree_host_win.cc | 7 | ||||
-rw-r--r-- | ash/host/ash_window_tree_host_win.h | 14 | ||||
-rw-r--r-- | ash/resources/BUILD.gn | 57 | ||||
-rw-r--r-- | ash/shelf/shelf_view_unittest.cc | 4 | ||||
-rw-r--r-- | ash/shell/content/shell_main_parts.cc | 1 | ||||
-rw-r--r-- | ash/strings/BUILD.gn | 28 | ||||
-rw-r--r-- | ash/test/test_suite.cc | 25 | ||||
-rw-r--r-- | ash/wm/panels/panel_layout_manager_unittest.cc | 7 | ||||
-rw-r--r-- | ash/wm/panels/panel_window_resizer_unittest.cc | 8 | ||||
-rw-r--r-- | build/all.gyp | 20 | ||||
-rw-r--r-- | build/filename_rules.gypi | 14 | ||||
-rw-r--r-- | components/components.gyp | 2 | ||||
-rw-r--r-- | tools/gritsettings/resource_ids | 22 | ||||
-rw-r--r-- | ui/message_center/BUILD.gn | 14 | ||||
-rw-r--r-- | ui/message_center/message_center.gyp | 9 | ||||
-rw-r--r-- | ui/strings/ui_strings.grd | 8 | ||||
-rw-r--r-- | ui/views/views.gyp | 2 |
24 files changed, 319 insertions, 104 deletions
@@ -472,15 +472,10 @@ group("both_gn_and_gyp") { deps += [ "//media:ffmpeg_regression_tests" ] } - if (use_ash) { + if (use_aura) { deps += [ "//ash:ash_shell_with_content", "//ash:ash_unittests", - ] - } - - if (use_aura) { - deps += [ "//ui/aura:aura_unittests", "//ui/aura:bench", "//ui/aura:demo", diff --git a/ash/BUILD.gn b/ash/BUILD.gn index ab93521..e6ecc72 100644 --- a/ash/BUILD.gn +++ b/ash/BUILD.gn @@ -6,7 +6,8 @@ import("//build/config/features.gni") import("//build/config/ui.gni") import("//testing/test.gni") -assert(use_ash) +assert(use_aura) +assert(enable_hidpi) gypi_values = exec_script("//build/gypi_to_gn.py", [ rebase_path("ash.gyp") ], @@ -317,6 +318,7 @@ test("ash_unittests") { "//ui/message_center", "//ui/message_center:test_support", "//ui/resources", + "//ui/strings", "//ui/views", "//ui/views:test_support", "//ui/views/controls/webview:test_support", @@ -325,6 +327,12 @@ test("ash_unittests") { "//url", ] + data_deps = [ + "//ash/strings:ash_test_strings", + "//ash/resources:ash_test_resources_100_percent", + "//ash/resources:ash_test_resources_200_percent", + ] + if (!is_chromeos) { sources -= [ # TODO(zork): fix this test to build on Windows. See: crosbug.com/26906 diff --git a/ash/ash.gyp b/ash/ash.gyp index b3629de..0448e11 100644 --- a/ash/ash.gyp +++ b/ash/ash.gyp @@ -1182,7 +1182,10 @@ '../url/url.gyp:url_lib', 'ash', 'ash_resources.gyp:ash_resources', + 'ash_resources.gyp:ash_test_resources_100_percent', + 'ash_resources.gyp:ash_test_resources_200_percent', 'ash_strings.gyp:ash_strings', + 'ash_strings.gyp:ash_test_strings', 'ash_test_support', 'ash_with_content', ], diff --git a/ash/ash_resources.gyp b/ash/ash_resources.gyp index d84fea4..199d6a1 100644 --- a/ash/ash_resources.gyp +++ b/ash/ash_resources.gyp @@ -22,5 +22,116 @@ ], 'includes': [ '../build/grit_target.gypi' ], }, + { + # Creates a 100% pak file containing resources for ash_unittests, etc. + # TODO(msw): Use ui_test.pak instead of its pieces? (no 200% support?) + # TODO(msw): Add copy steps and mac handling like repack_ui_test_pack? + # GN version: //ash/resources:ash_test_resources_100_percent + 'target_name': 'ash_test_resources_100_percent', + 'type': 'none', + 'dependencies': [ + '<(DEPTH)/ui/resources/ui_resources.gyp:ui_resources', + 'ash_resources', + ], + 'actions': [ + { + 'action_name': 'repack_ash_test_resources', + 'variables': { + 'pak_output': '<(PRODUCT_DIR)/ash_test_resources_100_percent.pak', + 'pak_inputs': [ + '<(SHARED_INTERMEDIATE_DIR)/ash/resources/ash_resources_100_percent.pak', + '<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_resources_100_percent.pak', + '<(SHARED_INTERMEDIATE_DIR)/ui/resources/webui_resources.pak', + ], + 'conditions': [ + ['chromeos==1', { + 'pak_inputs': [ + '<(SHARED_INTERMEDIATE_DIR)/ui/chromeos/resources/ui_chromeos_resources_100_percent.pak', + ], + }], + ['toolkit_views==1', { + 'pak_inputs': [ + # TODO(msw): This seems bad, but follows repack_ui_test_pack's example. + '<(SHARED_INTERMEDIATE_DIR)/blink/public/resources/blink_resources.pak', + '<(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' ], + }, + ], + 'conditions': [ + ['chromeos==1', { + 'dependencies': [ + '<(DEPTH)/ui/chromeos/ui_chromeos.gyp:ui_chromeos_resources', + ], + }], + ['toolkit_views==1', { + 'dependencies': [ + '<(DEPTH)/ui/views/resources/views_resources.gyp:views_resources', + ], + }], + ], + }, + { + # Creates a 200% pak file containing resources for ash_unittests, etc. + # TODO(msw): Use ui_test.pak instead of its pieces? (no 200% support?) + # TODO(msw): Add copy steps and mac handling like repack_ui_test_pack? + # GN version: //ash/resources:ash_test_resources_200_percent + 'target_name': 'ash_test_resources_200_percent', + 'type': 'none', + 'dependencies': [ + '<(DEPTH)/ui/resources/ui_resources.gyp:ui_resources', + 'ash_resources', + ], + 'actions': [ + { + 'action_name': 'repack_ash_test_resources', + 'variables': { + 'pak_output': '<(PRODUCT_DIR)/ash_test_resources_200_percent.pak', + 'pak_inputs': [ + '<(SHARED_INTERMEDIATE_DIR)/ash/resources/ash_resources_200_percent.pak', + '<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_resources_200_percent.pak', + ], + 'conditions': [ + ['chromeos==1', { + 'pak_inputs': [ + '<(SHARED_INTERMEDIATE_DIR)/ui/chromeos/resources/ui_chromeos_resources_200_percent.pak', + ], + }], + ['toolkit_views==1', { + 'pak_inputs': [ + '<(SHARED_INTERMEDIATE_DIR)/ui/views/resources/views_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' ], + }, + ], + 'conditions': [ + ['chromeos==1', { + 'dependencies': [ + '<(DEPTH)/ui/chromeos/ui_chromeos.gyp:ui_chromeos_resources', + ], + }], + ['toolkit_views==1', { + 'dependencies': [ + '<(DEPTH)/ui/views/resources/views_resources.gyp:views_resources', + ], + }], + ], + }, ], } diff --git a/ash/ash_strings.gyp b/ash/ash_strings.gyp index e71aa46..2865b5c 100644 --- a/ash/ash_strings.gyp +++ b/ash/ash_strings.gyp @@ -22,5 +22,45 @@ ], 'includes': [ '../build/grit_target.gypi' ], }, + { + # Creates a pak file containing strings for ash_unittests, etc. + # GN version: //ash/strings:ash_test_strings + 'target_name': 'ash_test_strings', + 'type': 'none', + 'dependencies': [ + '<(DEPTH)/ui/strings/ui_strings.gyp:ui_strings', + 'ash_strings.gyp:ash_strings', + ], + 'actions': [ + { + 'action_name': 'repack_ash_test_strings', + 'variables': { + 'pak_output': '<(PRODUCT_DIR)/ash_test_strings.pak', + 'pak_inputs': [ + '<(SHARED_INTERMEDIATE_DIR)/ash/strings/ash_strings_en-US.pak', + '<(SHARED_INTERMEDIATE_DIR)/ui/strings/app_locale_settings_en-US.pak', + '<(SHARED_INTERMEDIATE_DIR)/ui/strings/ui_strings_en-US.pak', + ], + 'conditions': [ + ['chromeos==1', { + 'pak_inputs': [ + '<(SHARED_INTERMEDIATE_DIR)/device/bluetooth/strings/bluetooth_strings_en-US.pak', + '<(SHARED_INTERMEDIATE_DIR)/ui/chromeos/strings/ui_chromeos_strings_en-US.pak', + ], + }], + ], + }, + 'includes': [ '../build/repack_action.gypi' ], + }, + ], + 'conditions': [ + ['chromeos==1', { + 'dependencies': [ + '<(DEPTH)/device/bluetooth/bluetooth_strings.gyp:bluetooth_strings', + '<(DEPTH)/ui/chromeos/ui_chromeos.gyp:ui_chromeos_strings', + ], + }], + ], + }, ], } diff --git a/ash/ash_unittests.isolate b/ash/ash_unittests.isolate index 89ab132..3a9b007 100644 --- a/ash/ash_unittests.isolate +++ b/ash/ash_unittests.isolate @@ -30,9 +30,10 @@ 'variables': { 'files': [ '../testing/test_env.py', - '<(PRODUCT_DIR)/chrome_100_percent.pak', - '<(PRODUCT_DIR)/chrome_200_percent.pak', - '<(PRODUCT_DIR)/locales/en-US.pak', + '<(PRODUCT_DIR)/ash_test_resources_100_percent.pak', + '<(PRODUCT_DIR)/ash_test_resources_200_percent.pak', + '<(PRODUCT_DIR)/ash_test_strings.pak', + # TODO(msw): Investigate under-specified DEPS (and/or unused pak?): '<(PRODUCT_DIR)/keyboard_resources.pak', ], }, diff --git a/ash/frame/caption_buttons/frame_size_button_unittest.cc b/ash/frame/caption_buttons/frame_size_button_unittest.cc index f1b31eb..e986ee8 100644 --- a/ash/frame/caption_buttons/frame_size_button_unittest.cc +++ b/ash/frame/caption_buttons/frame_size_button_unittest.cc @@ -13,7 +13,6 @@ #include "base/i18n/rtl.h" #include "grit/ash_resources.h" #include "ui/aura/window.h" -#include "ui/base/l10n/l10n_util.h" #include "ui/events/gesture_detection/gesture_configuration.h" #include "ui/events/test/event_generator.h" #include "ui/gfx/display.h" @@ -403,7 +402,7 @@ class FrameSizeButtonTestRTL : public FrameSizeButtonTest { ~FrameSizeButtonTestRTL() override {} void SetUp() override { - original_locale_ = l10n_util::GetApplicationLocale(std::string()); + original_locale_ = base::i18n::GetConfiguredLocale(); base::i18n::SetICUDefaultLocale("he"); FrameSizeButtonTest::SetUp(); diff --git a/ash/host/ash_window_tree_host_win.cc b/ash/host/ash_window_tree_host_win.cc index 5c3c5cd..211fff4 100644 --- a/ash/host/ash_window_tree_host_win.cc +++ b/ash/host/ash_window_tree_host_win.cc @@ -2,12 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ash/host/ash_window_tree_host.h" +#include "ash/host/ash_window_tree_host_win.h" #include "base/win/windows_version.h" namespace ash { -namespace { AshWindowTreeHostWin::AshWindowTreeHostWin(const gfx::Rect& initial_bounds) : AshWindowTreeHostPlatform(initial_bounds), @@ -17,7 +16,7 @@ AshWindowTreeHostWin::AshWindowTreeHostWin(const gfx::Rect& initial_bounds) AshWindowTreeHostWin::~AshWindowTreeHostWin() {} -void AshWindowTreeHostWin::ToggleFullScreen() override { +void AshWindowTreeHostWin::ToggleFullScreen() { gfx::Rect target_rect; gfx::AcceleratedWidget hwnd = GetAcceleratedWidget(); if (!fullscreen_) { @@ -47,7 +46,7 @@ void AshWindowTreeHostWin::ToggleFullScreen() override { SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED); } -void AshWindowTreeHostWin::SetBounds(const gfx::Rect& bounds) override { +void AshWindowTreeHostWin::SetBounds(const gfx::Rect& bounds) { if (fullscreen_) { saved_window_rect_.right = saved_window_rect_.left + bounds.width(); saved_window_rect_.bottom = saved_window_rect_.top + bounds.height(); diff --git a/ash/host/ash_window_tree_host_win.h b/ash/host/ash_window_tree_host_win.h index 0349bfc..9dd3575 100644 --- a/ash/host/ash_window_tree_host_win.h +++ b/ash/host/ash_window_tree_host_win.h @@ -17,23 +17,9 @@ class AshWindowTreeHostWin : public AshWindowTreeHostPlatform { private: // AshWindowTreeHost: void ToggleFullScreen() override; - bool ConfineCursorToRootWindow() override; - void UnConfineCursor() override; - void SetRootWindowTransformer( - scoped_ptr<RootWindowTransformer> transformer) override; - gfx::Insets GetHostInsets() const override; - aura::WindowTreeHost* AsWindowTreeHost() override; // WindowTreeHost: void SetBounds(const gfx::Rect& bounds) override; - void SetRootTransform(const gfx::Transform& transform) override; - gfx::Transform GetRootTransform() const override; - gfx::Transform GetInverseRootTransform() const override; - void UpdateRootWindowSize(const gfx::Size& host_size) override; - - // ui::internal::InputMethodDelegate: - ui::EventDispatchDetails DispatchKeyEventPostIME( - ui::KeyEvent* event) override; bool fullscreen_; RECT saved_window_rect_; diff --git a/ash/resources/BUILD.gn b/ash/resources/BUILD.gn index 25f61ec..bbb66bd 100644 --- a/ash/resources/BUILD.gn +++ b/ash/resources/BUILD.gn @@ -3,6 +3,9 @@ # found in the LICENSE file. import("//tools/grit/grit_rule.gni") +import("//tools/grit/repack.gni") + +assert(enable_hidpi) grit("resources") { source = "ash_resources.grd" @@ -12,3 +15,57 @@ grit("resources") { "ash_resources_200_percent.pak", ] } + +# Generates a rule to repack ash resources for a given percentage (e.g. "100"). +# TODO(msw): Use ui_test.pak instead of its pieces? (no 200% support?) +template("ash_test_resources") { + percent = invoker.percent + + repack("ash_test_resources_${target_name}") { + output = "$root_build_dir/ash_test_resources_${percent}_percent.pak" + + sources = [ + "$root_gen_dir/ash/resources/ash_resources_${percent}_percent.pak", + "$root_gen_dir/ui/resources/ui_resources_${percent}_percent.pak", + ] + + if (percent == "100") { + sources += [ "$root_gen_dir/ui/resources/webui_resources.pak" ] + } + + deps = [ + "//ash/resources", + "//ui/resources", + ] + + if (toolkit_views) { + deps += [ "//ui/views/resources" ] + sources += [ "$root_gen_dir/ui/views/resources/views_resources_${percent}_percent.pak" ] + + if (percent == "100") { + # TODO(msw): This seems bad, but follows repack_ui_test_pak's example. + deps += [ "//third_party/WebKit/public:resources_grit" ] + sources += + [ "$root_gen_dir/blink/public/resources/blink_resources.pak" ] + } + } + + if (is_chromeos) { + sources += [ "$root_gen_dir/ui/chromeos/resources/ui_chromeos_resources_${percent}_percent.pak" ] + deps += [ "//ui/chromeos/resources" ] + } + + if (enable_app_list) { + sources += [ "$root_gen_dir/ui/app_list/resources/app_list_resources_${percent}_percent.pak" ] + deps += [ "//ui/app_list/resources" ] + } + } +} + +ash_test_resources("100_percent") { + percent = "100" +} + +ash_test_resources("200_percent") { + percent = "200" +} diff --git a/ash/shelf/shelf_view_unittest.cc b/ash/shelf/shelf_view_unittest.cc index 80091d3..c347c60 100644 --- a/ash/shelf/shelf_view_unittest.cc +++ b/ash/shelf/shelf_view_unittest.cc @@ -31,6 +31,7 @@ #include "ash/test/test_shelf_delegate.h" #include "ash/test/test_shelf_item_delegate.h" #include "base/compiler_specific.h" +#include "base/i18n/rtl.h" #include "base/memory/scoped_ptr.h" #include "base/strings/string_number_conversions.h" #include "base/test/histogram_tester.h" @@ -39,7 +40,6 @@ #include "ui/aura/test/aura_test_base.h" #include "ui/aura/window.h" #include "ui/aura/window_event_dispatcher.h" -#include "ui/base/l10n/l10n_util.h" #include "ui/compositor/layer.h" #include "ui/events/event.h" #include "ui/events/event_constants.h" @@ -707,7 +707,7 @@ const char* class ScopedTextDirectionChange { public: explicit ScopedTextDirectionChange(bool is_rtl) : is_rtl_(is_rtl) { - original_locale_ = l10n_util::GetApplicationLocale(std::string()); + original_locale_ = base::i18n::GetConfiguredLocale(); if (is_rtl_) base::i18n::SetICUDefaultLocale("he"); CheckTextDirectionIsCorrect(); diff --git a/ash/shell/content/shell_main_parts.cc b/ash/shell/content/shell_main_parts.cc index d99635e..1a0aad9 100644 --- a/ash/shell/content/shell_main_parts.cc +++ b/ash/shell/content/shell_main_parts.cc @@ -14,6 +14,7 @@ namespace shell { void PreMainMessageLoopStart() { ui::RegisterPathProvider(); base::i18n::InitializeICU(); + // TODO(msw): Load ash and ui resources; not 'common' (Chrome) resources. ui::ResourceBundle::InitSharedInstanceWithLocale( "en-US", NULL, ui::ResourceBundle::LOAD_COMMON_RESOURCES); } diff --git a/ash/strings/BUILD.gn b/ash/strings/BUILD.gn index af2069a..68f39cc 100644 --- a/ash/strings/BUILD.gn +++ b/ash/strings/BUILD.gn @@ -3,6 +3,7 @@ # found in the LICENSE file. import("//tools/grit/grit_rule.gni") +import("//tools/grit/repack.gni") grit("strings") { source = "../ash_strings.grd" @@ -64,3 +65,30 @@ grit("strings") { "ash_strings_zh-TW.pak", ] } + +# Creates a pak file containing strings for ash_unittests, etc. +repack("ash_test_strings") { + output = "$root_build_dir/ash_test_strings.pak" + + sources = [ + "$root_gen_dir/ash/strings/ash_strings_en-US.pak", + "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak", + "$root_gen_dir/ui/strings/ui_strings_en-US.pak", + ] + + deps = [ + "//ash/strings", + "//ui/strings", + ] + + if (is_chromeos) { + sources += [ + "$root_gen_dir/device/bluetooth/strings/bluetooth_strings_en-US.pak", + "$root_gen_dir/ui/chromeos/strings/ui_chromeos_strings_en-US.pak", + ] + deps += [ + "//device/bluetooth/strings", + "//ui/chromeos/strings", + ] + } +} diff --git a/ash/test/test_suite.cc b/ash/test/test_suite.cc index 8e2db6d..c4f6c03 100644 --- a/ash/test/test_suite.cc +++ b/ash/test/test_suite.cc @@ -7,6 +7,8 @@ #include "ash/ash_switches.h" #include "base/command_line.h" #include "base/files/file_path.h" +#include "base/i18n/rtl.h" +#include "base/path_service.h" #include "build/build_config.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/aura/env.h" @@ -49,10 +51,25 @@ void AuraShellTestSuite::Initialize() { gfx::RegisterPathProvider(); ui::RegisterPathProvider(); - // Force unittests to run using en-US so if we test against string - // output, it'll pass regardless of the system language. - ui::ResourceBundle::InitSharedInstanceWithLocale( - "en-US", NULL, ui::ResourceBundle::LOAD_COMMON_RESOURCES); + // Force unittests to run using en-US so if we test against string output, + // it'll pass regardless of the system language. + base::i18n::SetICUDefaultLocale("en_US"); + + // Load ash resources and en-US strings; not 'common' (Chrome) resources. + // TODO(msw): Check ResourceBundle::IsScaleFactorSupported; load 300% etc. + base::FilePath path; + PathService::Get(base::DIR_MODULE, &path); + base::FilePath ash_test_strings = + path.Append(FILE_PATH_LITERAL("ash_test_strings.pak")); + base::FilePath ash_test_resources_100 = + path.Append(FILE_PATH_LITERAL("ash_test_resources_100_percent.pak")); + base::FilePath ash_test_resources_200 = + path.Append(FILE_PATH_LITERAL("ash_test_resources_200_percent.pak")); + + ui::ResourceBundle::InitSharedInstanceWithPakPath(ash_test_strings); + ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); + rb.AddDataPackFromPath(ash_test_resources_100, ui::SCALE_FACTOR_100P); + rb.AddDataPackFromPath(ash_test_resources_200, ui::SCALE_FACTOR_200P); base::DiscardableMemoryAllocator::SetInstance(&discardable_memory_allocator_); aura::Env::CreateInstance(true); diff --git a/ash/wm/panels/panel_layout_manager_unittest.cc b/ash/wm/panels/panel_layout_manager_unittest.cc index 51a0a646..9c270b5 100644 --- a/ash/wm/panels/panel_layout_manager_unittest.cc +++ b/ash/wm/panels/panel_layout_manager_unittest.cc @@ -33,7 +33,6 @@ #include "ui/aura/test/test_windows.h" #include "ui/aura/window.h" #include "ui/aura/window_event_dispatcher.h" -#include "ui/base/l10n/l10n_util.h" #include "ui/events/event_utils.h" #include "ui/events/test/event_generator.h" #include "ui/views/widget/widget.h" @@ -278,7 +277,7 @@ class PanelLayoutManagerTextDirectionTest virtual ~PanelLayoutManagerTextDirectionTest() {} void SetUp() override { - original_locale = l10n_util::GetApplicationLocale(std::string()); + original_locale_ = base::i18n::GetConfiguredLocale(); if (is_rtl_) base::i18n::SetICUDefaultLocale("he"); PanelLayoutManagerTest::SetUp(); @@ -287,13 +286,13 @@ class PanelLayoutManagerTextDirectionTest void TearDown() override { if (is_rtl_) - base::i18n::SetICUDefaultLocale(original_locale); + base::i18n::SetICUDefaultLocale(original_locale_); PanelLayoutManagerTest::TearDown(); } private: bool is_rtl_; - std::string original_locale; + std::string original_locale_; DISALLOW_COPY_AND_ASSIGN(PanelLayoutManagerTextDirectionTest); }; diff --git a/ash/wm/panels/panel_window_resizer_unittest.cc b/ash/wm/panels/panel_window_resizer_unittest.cc index 1e39c70..fccf61a 100644 --- a/ash/wm/panels/panel_window_resizer_unittest.cc +++ b/ash/wm/panels/panel_window_resizer_unittest.cc @@ -20,11 +20,11 @@ #include "ash/wm/drag_window_resizer.h" #include "ash/wm/window_state.h" #include "ash/wm/wm_event.h" +#include "base/i18n/rtl.h" #include "base/win/windows_version.h" #include "ui/aura/client/aura_constants.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/base/hit_test.h" -#include "ui/base/l10n/l10n_util.h" #include "ui/base/ui_base_types.h" #include "ui/views/widget/widget.h" #include "ui/wm/core/window_util.h" @@ -188,7 +188,7 @@ class PanelWindowResizerTextDirectionTest virtual ~PanelWindowResizerTextDirectionTest() {} void SetUp() override { - original_locale = l10n_util::GetApplicationLocale(std::string()); + original_locale_ = base::i18n::GetConfiguredLocale(); if (is_rtl_) base::i18n::SetICUDefaultLocale("he"); PanelWindowResizerTest::SetUp(); @@ -197,13 +197,13 @@ class PanelWindowResizerTextDirectionTest void TearDown() override { if (is_rtl_) - base::i18n::SetICUDefaultLocale(original_locale); + base::i18n::SetICUDefaultLocale(original_locale_); PanelWindowResizerTest::TearDown(); } private: bool is_rtl_; - std::string original_locale; + std::string original_locale_; DISALLOW_COPY_AND_ASSIGN(PanelWindowResizerTextDirectionTest); }; diff --git a/build/all.gyp b/build/all.gyp index bd4f963..cff1ff8 100644 --- a/build/all.gyp +++ b/build/all.gyp @@ -241,15 +241,11 @@ }], ['use_aura==1', { 'dependencies': [ + '../ash/ash.gyp:*', '../ui/aura/aura.gyp:*', '../ui/aura_extra/aura_extra.gyp:*', ], }], - ['use_ash==1', { - 'dependencies': [ - '../ash/ash.gyp:*', - ], - }], ['remoting==1', { 'dependencies': [ '../remoting/remoting_all.gyp:remoting_all', @@ -469,6 +465,7 @@ }], ['use_aura==1', { 'dependencies': [ + '../ash/ash.gyp:ash_unittests', '../ui/app_list/app_list.gyp:app_list_unittests', '../ui/aura/aura.gyp:aura_unittests', '../ui/compositor/compositor.gyp:compositor_unittests', @@ -485,11 +482,6 @@ '../ui/events/events_unittests.gyp:events_unittests', ], }], - ['use_ash==1', { - 'dependencies': [ - '../ash/ash.gyp:ash_unittests', - ], - }], ['disable_nacl==0', { 'dependencies': [ '../components/nacl.gyp:nacl_loader_unittests', @@ -1307,6 +1299,8 @@ 'target_name': 'aura_builder', 'type': 'none', 'dependencies': [ + '../ash/ash.gyp:ash_shell_with_content', + '../ash/ash.gyp:ash_unittests', '../cc/blink/cc_blink_tests.gyp:cc_blink_unittests', '../cc/cc_tests.gyp:cc_unittests', '../components/components_tests.gyp:components_unittests', @@ -1343,12 +1337,6 @@ '../chrome/chrome.gyp:crash_service_win64', ], }], - ['use_ash==1', { - 'dependencies': [ - '../ash/ash.gyp:ash_shell_with_content', - '../ash/ash.gyp:ash_unittests', - ], - }], ['OS=="linux"', { # Tests that currently only work on Linux. 'dependencies': [ diff --git a/build/filename_rules.gypi b/build/filename_rules.gypi index bc81752..5cff4c3 100644 --- a/build/filename_rules.gypi +++ b/build/filename_rules.gypi @@ -77,25 +77,21 @@ ['<(use_aura)==0 or >(nacl_untrusted_build)==1', { 'sources/': [ ['exclude', '_aura(_browsertest|_unittest)?\\.(h|cc)$'], ['exclude', '(^|/)aura/'], + ['exclude', '_ash(_browsertest|_unittest)?\\.(h|cc)$'], + ['exclude', '(^|/)ash/'], ] }], ['<(use_aura)==0 or <(use_x11)==0 or >(nacl_untrusted_build)==1', { 'sources/': [ ['exclude', '_aurax11(_browsertest|_unittest)?\\.(h|cc)$'] ] }], ['<(use_aura)==0 or OS!="win" or >(nacl_untrusted_build)==1', { - 'sources/': [ ['exclude', '_aurawin\\.(h|cc)$'] ] + 'sources/': [ ['exclude', '_aurawin\\.(h|cc)$'], + ['exclude', '_ashwin\\.(h|cc)$'] + ] }], ['<(use_aura)==0 or OS!="linux" or >(nacl_untrusted_build)==1', { 'sources/': [ ['exclude', '_auralinux\\.(h|cc)$'] ] }], - ['<(use_ash)==0 or >(nacl_untrusted_build)==1', { - 'sources/': [ ['exclude', '_ash(_browsertest|_unittest)?\\.(h|cc)$'], - ['exclude', '(^|/)ash/'], - ] - }], - ['<(use_ash)==0 or OS!="win" or >(nacl_untrusted_build)==1', { - 'sources/': [ ['exclude', '_ashwin\\.(h|cc)$'] ] - }], ['<(use_ozone)==0 or >(nacl_untrusted_build)==1', { 'sources/': [ ['exclude', '_ozone(_browsertest|_unittest)?\\.(h|cc)$'] ] }], diff --git a/components/components.gyp b/components/components.gyp index 1816fd6..837a51d 100644 --- a/components/components.gyp +++ b/components/components.gyp @@ -166,7 +166,7 @@ 'browser_watcher.gypi', ], }], - ['chromeos == 1 or use_ash == 1', { + ['chromeos == 1 or use_aura == 1', { 'includes': [ 'session_manager.gypi', 'user_manager.gypi', diff --git a/tools/gritsettings/resource_ids b/tools/gritsettings/resource_ids index fe03946..0528718 100644 --- a/tools/gritsettings/resource_ids +++ b/tools/gritsettings/resource_ids @@ -181,43 +181,43 @@ }, # This file is generated during the build. "<(SHARED_INTERMEDIATE_DIR)/content/browser/tracing/tracing_resources.grd": { - "includes": [24700], + "includes": [24600], }, # iOS resources overlap with android_webview, ash, chromeos and extensions_api, # as these are not used on iOS. "ios/chrome/app/strings/ios_locale_settings.grd": { - "messages": [24950], + "messages": [24850], }, "ios/chrome/app/strings/ios_strings.grd": { - "messages": [24955], + "messages": [24855], }, # Chromium strings and Google Chrome strings must start at the same id. # We only use one file depending on whether we're building Chromium or # Google Chrome. "ios/chrome/app/strings/ios_chromium_strings.grd": { - "messages": [25855], + "messages": [25755], }, "ios/chrome/app/strings/ios_google_chrome_strings.grd": { - "messages": [25855], + "messages": [25755], }, "ios/chrome/app/resources/ios_resources.grd": { "structures": [25950], - "includes": [26160], + "includes": [26060], }, "ios/chrome/app/theme/ios_theme_resources.grd": { - "structures": [25970], + "structures": [25870], }, "ios/chrome/today_extension/strings/ios_today_extension_strings.grd": { - "messages": [26435], + "messages": [26335], }, "ash/ash_strings.grd": { - "messages": [24950], + "messages": [24850], }, "android_webview/ui/aw_resources.grd": { - "includes": [24950], + "includes": [24850], }, "android_webview/ui/aw_strings.grd": { - "messages": [25050], + "messages": [24950], }, "ui/chromeos/resources/ui_chromeos_resources.grd": { "structures": [25150], diff --git a/ui/message_center/BUILD.gn b/ui/message_center/BUILD.gn index 0c1c71f..8ddcd20 100644 --- a/ui/message_center/BUILD.gn +++ b/ui/message_center/BUILD.gn @@ -6,6 +6,7 @@ import("//build/config/features.gni") import("//build/config/ui.gni") import("//testing/test.gni") +# TODO(msw|mukai|dewittj): Move ash-specific files: crbug.com/585175 component("message_center") { deps = [ "//base", @@ -90,6 +91,10 @@ component("message_center") { "views/constants.h", "views/desktop_popup_alignment_delegate.cc", "views/desktop_popup_alignment_delegate.h", + "views/message_bubble_base.cc", + "views/message_bubble_base.h", + "views/message_center_bubble.cc", + "views/message_center_bubble.h", "views/message_center_button_bar.cc", "views/message_center_button_bar.h", "views/message_center_controller.h", @@ -126,15 +131,6 @@ component("message_center") { "//ui/views", ] } - - if (use_ash) { - sources += [ - "views/message_bubble_base.cc", - "views/message_bubble_base.h", - "views/message_center_bubble.cc", - "views/message_center_bubble.h", - ] - } } else { # Notification service disabled. sources = [ diff --git a/ui/message_center/message_center.gyp b/ui/message_center/message_center.gyp index 036cfa6..0940f24 100644 --- a/ui/message_center/message_center.gyp +++ b/ui/message_center/message_center.gyp @@ -8,6 +8,7 @@ }, 'targets': [ { + # TODO(msw|mukai|dewittj): Move ash-specific files: crbug.com/585175 # GN version: //ui/message_center 'target_name': 'message_center', 'type': '<(component)', @@ -131,14 +132,6 @@ ['exclude', 'views/'], ], }], - ['use_ash==0', { - 'sources!': [ - 'views/message_bubble_base.cc', - 'views/message_bubble_base.h', - 'views/message_center_bubble.cc', - 'views/message_center_bubble.h', - ], - }], # iOS disables notifications altogether, Android implements its own # notification UI manager instead of deferring to the message center. ['notifications==0 or OS=="android"', { diff --git a/ui/strings/ui_strings.grd b/ui/strings/ui_strings.grd index 303be4d..5948744 100644 --- a/ui/strings/ui_strings.grd +++ b/ui/strings/ui_strings.grd @@ -593,11 +593,9 @@ need to be translated for each locale.--> </message> <!-- Message center --> - <if expr="use_ash"> - <message name="IDS_MESSAGE_CENTER_ACCESSIBLE_NAME" desc="The accessible name for the Notification Center window."> - Notification Center - </message> - </if> + <message name="IDS_MESSAGE_CENTER_ACCESSIBLE_NAME" desc="The accessible name for the Notification Center window."> + Notification Center + </message> <message name="IDS_MESSAGE_CENTER_NOTIFIER_DISABLE" desc="The menu entry for disabling a notifier from a notification."> Disable notifications from <ph name="notifier_name">$1<ex>Notification Galore!</ex></ph> </message> diff --git a/ui/views/views.gyp b/ui/views/views.gyp index 02a5e2e..5fd61b0 100644 --- a/ui/views/views.gyp +++ b/ui/views/views.gyp @@ -663,7 +663,7 @@ '<@(views_sources)', ], 'conditions': [ - ['use_ash==0', { + ['use_aura==0', { 'sources!': [ 'bubble/tray_bubble_view.cc', 'bubble/tray_bubble_view.h', |