diff options
author | Mitsuru Oshima <oshima@chromium.org> | 2015-08-03 21:34:25 -0700 |
---|---|---|
committer | Mitsuru Oshima <oshima@chromium.org> | 2015-08-04 04:36:24 +0000 |
commit | 8cb079f8e1ce0efd8a7f0328c3bc6d33807f9470 (patch) | |
tree | 0c25f3e03be9fa6f92f5c80764fc39efa551ad98 /ui/views/examples | |
parent | 48eea5f39c399af026543bfcafc63c9fe55ecfd8 (diff) | |
download | chromium_src-8cb079f8e1ce0efd8a7f0328c3bc6d33807f9470.zip chromium_src-8cb079f8e1ce0efd8a7f0328c3bc6d33807f9470.tar.gz chromium_src-8cb079f8e1ce0efd8a7f0328c3bc6d33807f9470.tar.bz2 |
Revert "Make it easier to test changes to a .icon file."
Reason for revert:
build errors on GN bots
LINUX:
FAILED: /mnt/data/b/build/goma/gomacc ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/ui/views/examples/views_examples_lib/vector_example.o.d .....
../../ui/views/examples/vector_example.cc:112:14:error: no member named 'CreateVectorIconFromSource' in namespace 'gfx'
gfx::CreateVectorIconFromSource(contents, size_, color_));
~~~~~^
1 error generated.
WIN:
[472/771] LINK generate_barcode_video.exe
FAILED: ninja -t msvc -e environment.x64 -- E:\b\build\goma/gomacc.exe "E:\b\depot_tools\win_toolchain\vs2013_files\VC\bin\amd64/cl.exe" /nologo /showIncludes /FC @obj/ui/views/examples/views_examples_lib/vector_example.obj.rsp ....
e:\b\build\slave\win_x64_gn\build\src\ui\views\examples\vector_example.cc(112) :error C2039: 'CreateVectorIconFromSource' : is not a member of 'gfx'
e:\b\build\slave\win_x64_gn\build\src\ui\views\examples\vector_example.cc(112) :error C3861: 'CreateVectorIconFromSource': identifier not found
ninja: build stopped: subcommand failed.
> Make it easier to test changes to a .icon file.
> No need to recompile Chrome; views_examples_exe will read from a file. This would also be useful for the tool which will allow de
>
> Since this is potentially unsafe (could crash on the wrong inputs) and doesn't serve a purpose in Chrome itself, it's ifdef'd out
>
> BUG=505953
>
> Review URL: https://codereview.chromium.org/1268633002
>
> Cr-Commit-Position: refs/heads/master@{#341667}
TBR=estade@chromium.org
BUG=
Review URL: https://codereview.chromium.org/1264343003 .
Cr-Commit-Position: refs/heads/master@{#341673}
Diffstat (limited to 'ui/views/examples')
-rw-r--r-- | ui/views/examples/examples.gyp | 1 | ||||
-rw-r--r-- | ui/views/examples/vector_example.cc | 36 |
2 files changed, 1 insertions, 36 deletions
diff --git a/ui/views/examples/examples.gyp b/ui/views/examples/examples.gyp index cdf8120..56ef0b3 100644 --- a/ui/views/examples/examples.gyp +++ b/ui/views/examples/examples.gyp @@ -28,7 +28,6 @@ '../../..', ], 'defines': [ - 'GFX_VECTOR_ICONS_UNSAFE', 'VIEWS_EXAMPLES_IMPLEMENTATION', ], 'sources': [ diff --git a/ui/views/examples/vector_example.cc b/ui/views/examples/vector_example.cc index f563d50..4c72147 100644 --- a/ui/views/examples/vector_example.cc +++ b/ui/views/examples/vector_example.cc @@ -4,14 +4,10 @@ #include "ui/views/examples/vector_example.h" -#include "base/files/file_path.h" -#include "base/files/file_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/utf_string_conversions.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/vector_icons_public2.h" -#include "ui/views/controls/button/blue_button.h" -#include "ui/views/controls/button/button.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/textfield/textfield.h" #include "ui/views/controls/textfield/textfield_controller.h" @@ -24,16 +20,12 @@ namespace examples { namespace { -class VectorIconGallery : public View, - public TextfieldController, - public ButtonListener { +class VectorIconGallery : public View, public TextfieldController { public: VectorIconGallery() : image_view_(new ImageView()), size_input_(new Textfield()), color_input_(new Textfield()), - file_chooser_(new Textfield()), - file_go_button_(new BlueButton(this, base::ASCIIToUTF16("Render"))), vector_id_(0), size_(32), color_(SK_ColorRED) { @@ -41,16 +33,6 @@ class VectorIconGallery : public View, AddChildView(color_input_); AddChildView(image_view_); - file_chooser_->set_placeholder_text( - base::ASCIIToUTF16("Or enter a file to read")); - View* file_container = new View(); - BoxLayout* file_box = new BoxLayout(BoxLayout::kHorizontal, 10, 10, 10); - file_container->SetLayoutManager(file_box); - file_container->AddChildView(file_chooser_); - file_container->AddChildView(file_go_button_); - file_box->SetFlexForView(file_chooser_, 1); - AddChildView(file_container); - size_input_->set_placeholder_text(base::ASCIIToUTF16("Size in dip")); size_input_->set_controller(this); color_input_->set_placeholder_text(base::ASCIIToUTF16("Color (AARRGGBB)")); @@ -98,20 +80,6 @@ class VectorIconGallery : public View, } } - // ButtonListener - void ButtonPressed(Button* sender, const ui::Event& event) override { - DCHECK_EQ(file_go_button_, sender); - std::string contents; -#if defined(OS_POSIX) - base::FilePath path(base::UTF16ToUTF8(file_chooser_->text())); -#elif defined(OS_WIN) - base::FilePath path(file_chooser_->text()); -#endif - base::ReadFileToString(path, &contents); - image_view_->SetImage( - gfx::CreateVectorIconFromSource(contents, size_, color_)); - } - void UpdateImage() { image_view_->SetImage(gfx::CreateVectorIcon( static_cast<gfx::VectorIconId>(vector_id_), size_, color_)); @@ -121,8 +89,6 @@ class VectorIconGallery : public View, ImageView* image_view_; Textfield* size_input_; Textfield* color_input_; - Textfield* file_chooser_; - Button* file_go_button_; int vector_id_; size_t size_; |