From a524c5ec126746db91bf24f5f915a7f5f432ad02 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Fri, 28 Sep 2018 12:47:09 +1000 Subject: [PATCH] chore: move the view APIs to their own directory (#14722) * chore: move the view APIs to their own directory * move view api cpp files --- BUILD.gn | 30 +++++++++---------- atom/browser/api/atom_api_view.h | 2 +- .../api/{ => views}/atom_api_box_layout.cc | 2 +- .../api/{ => views}/atom_api_box_layout.h | 8 ++--- .../api/{ => views}/atom_api_button.cc | 2 +- .../browser/api/{ => views}/atom_api_button.h | 6 ++-- .../api/{ => views}/atom_api_label_button.cc | 2 +- .../api/{ => views}/atom_api_label_button.h | 8 ++--- .../{ => views}/atom_api_layout_manager.cc | 2 +- .../api/{ => views}/atom_api_layout_manager.h | 6 ++-- .../api/{ => views}/atom_api_text_field.cc | 2 +- .../api/{ => views}/atom_api_text_field.h | 6 ++-- lib/browser/api/module-list.js | 10 +++---- lib/browser/api/{ => views}/box-layout.js | 0 lib/browser/api/{ => views}/button.js | 0 lib/browser/api/{ => views}/label-button.js | 0 lib/browser/api/{ => views}/layout-manager.js | 0 lib/browser/api/{ => views}/text-field.js | 0 18 files changed, 43 insertions(+), 43 deletions(-) rename atom/browser/api/{ => views}/atom_api_box_layout.cc (97%) rename atom/browser/api/{ => views}/atom_api_box_layout.h (78%) rename atom/browser/api/{ => views}/atom_api_button.cc (96%) rename atom/browser/api/{ => views}/atom_api_button.h (84%) rename atom/browser/api/{ => views}/atom_api_label_button.cc (96%) rename atom/browser/api/{ => views}/atom_api_label_button.h (74%) rename atom/browser/api/{ => views}/atom_api_layout_manager.cc (96%) rename atom/browser/api/{ => views}/atom_api_layout_manager.h (85%) rename atom/browser/api/{ => views}/atom_api_text_field.cc (96%) rename atom/browser/api/{ => views}/atom_api_text_field.h (83%) rename lib/browser/api/{ => views}/box-layout.js (100%) rename lib/browser/api/{ => views}/button.js (100%) rename lib/browser/api/{ => views}/label-button.js (100%) rename lib/browser/api/{ => views}/layout-manager.js (100%) rename lib/browser/api/{ => views}/text-field.js (100%) diff --git a/BUILD.gn b/BUILD.gn index fb6acf9e2e12..aa57a50ba9eb 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -184,11 +184,11 @@ asar("js2asar") { } if (enable_view_api) { sources += [ - "lib/browser/api/box-layout.js", - "lib/browser/api/button.js", - "lib/browser/api/label-button.js", - "lib/browser/api/layout-manager.js", - "lib/browser/api/text-field.js", + "lib/browser/api/views/box-layout.js", + "lib/browser/api/views/button.js", + "lib/browser/api/views/label-button.js", + "lib/browser/api/views/layout-manager.js", + "lib/browser/api/views/text-field.js", ] } outputs = [ @@ -423,16 +423,16 @@ static_library("electron_lib") { if (enable_view_api) { sources += [ - "atom/browser/api/atom_api_box_layout.cc", - "atom/browser/api/atom_api_box_layout.h", - "atom/browser/api/atom_api_button.cc", - "atom/browser/api/atom_api_button.h", - "atom/browser/api/atom_api_label_button.cc", - "atom/browser/api/atom_api_label_button.h", - "atom/browser/api/atom_api_layout_manager.cc", - "atom/browser/api/atom_api_layout_manager.h", - "atom/browser/api/atom_api_text_field.cc", - "atom/browser/api/atom_api_text_field.h", + "atom/browser/api/views/atom_api_box_layout.cc", + "atom/browser/api/views/atom_api_box_layout.h", + "atom/browser/api/views/atom_api_button.cc", + "atom/browser/api/views/atom_api_button.h", + "atom/browser/api/views/atom_api_label_button.cc", + "atom/browser/api/views/atom_api_label_button.h", + "atom/browser/api/views/atom_api_layout_manager.cc", + "atom/browser/api/views/atom_api_layout_manager.h", + "atom/browser/api/views/atom_api_text_field.cc", + "atom/browser/api/views/atom_api_text_field.h", ] } diff --git a/atom/browser/api/atom_api_view.h b/atom/browser/api/atom_api_view.h index 03b4e10823c9..f86fb6fc17bb 100644 --- a/atom/browser/api/atom_api_view.h +++ b/atom/browser/api/atom_api_view.h @@ -8,7 +8,7 @@ #include #include -#include "atom/browser/api/atom_api_layout_manager.h" +#include "atom/browser/api/views/atom_api_layout_manager.h" #include "native_mate/handle.h" #include "ui/views/view.h" diff --git a/atom/browser/api/atom_api_box_layout.cc b/atom/browser/api/views/atom_api_box_layout.cc similarity index 97% rename from atom/browser/api/atom_api_box_layout.cc rename to atom/browser/api/views/atom_api_box_layout.cc index 99e2efc55b75..7ae33bac5edd 100644 --- a/atom/browser/api/atom_api_box_layout.cc +++ b/atom/browser/api/views/atom_api_box_layout.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "atom/browser/api/atom_api_box_layout.h" +#include "atom/browser/api/views/atom_api_box_layout.h" #include diff --git a/atom/browser/api/atom_api_box_layout.h b/atom/browser/api/views/atom_api_box_layout.h similarity index 78% rename from atom/browser/api/atom_api_box_layout.h rename to atom/browser/api/views/atom_api_box_layout.h index b29e2eda6ab0..e9f26155a93c 100644 --- a/atom/browser/api/atom_api_box_layout.h +++ b/atom/browser/api/views/atom_api_box_layout.h @@ -2,10 +2,10 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef ATOM_BROWSER_API_ATOM_API_BOX_LAYOUT_H_ -#define ATOM_BROWSER_API_ATOM_API_BOX_LAYOUT_H_ +#ifndef ATOM_BROWSER_API_VIEWS_ATOM_API_BOX_LAYOUT_H_ +#define ATOM_BROWSER_API_VIEWS_ATOM_API_BOX_LAYOUT_H_ -#include "atom/browser/api/atom_api_layout_manager.h" +#include "atom/browser/api/views/atom_api_layout_manager.h" #include "native_mate/handle.h" #include "ui/views/layout/box_layout.h" @@ -37,4 +37,4 @@ class BoxLayout : public LayoutManager { } // namespace atom -#endif // ATOM_BROWSER_API_ATOM_API_BOX_LAYOUT_H_ +#endif // ATOM_BROWSER_API_VIEWS_ATOM_API_BOX_LAYOUT_H_ diff --git a/atom/browser/api/atom_api_button.cc b/atom/browser/api/views/atom_api_button.cc similarity index 96% rename from atom/browser/api/atom_api_button.cc rename to atom/browser/api/views/atom_api_button.cc index 841fec758bd1..4cf3d7f021e6 100644 --- a/atom/browser/api/atom_api_button.cc +++ b/atom/browser/api/views/atom_api_button.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "atom/browser/api/atom_api_button.h" +#include "atom/browser/api/views/atom_api_button.h" #include "atom/common/api/constructor.h" #include "native_mate/dictionary.h" diff --git a/atom/browser/api/atom_api_button.h b/atom/browser/api/views/atom_api_button.h similarity index 84% rename from atom/browser/api/atom_api_button.h rename to atom/browser/api/views/atom_api_button.h index efc9489e2c76..783afe9c89f7 100644 --- a/atom/browser/api/atom_api_button.h +++ b/atom/browser/api/views/atom_api_button.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef ATOM_BROWSER_API_ATOM_API_BUTTON_H_ -#define ATOM_BROWSER_API_ATOM_API_BUTTON_H_ +#ifndef ATOM_BROWSER_API_VIEWS_ATOM_API_BUTTON_H_ +#define ATOM_BROWSER_API_VIEWS_ATOM_API_BUTTON_H_ #include "atom/browser/api/atom_api_view.h" #include "native_mate/handle.h" @@ -35,4 +35,4 @@ class Button : public View, public views::ButtonListener { } // namespace atom -#endif // ATOM_BROWSER_API_ATOM_API_BUTTON_H_ +#endif // ATOM_BROWSER_API_VIEWS_ATOM_API_BUTTON_H_ diff --git a/atom/browser/api/atom_api_label_button.cc b/atom/browser/api/views/atom_api_label_button.cc similarity index 96% rename from atom/browser/api/atom_api_label_button.cc rename to atom/browser/api/views/atom_api_label_button.cc index beaa9ccb4a1c..2e3b27d1ab90 100644 --- a/atom/browser/api/atom_api_label_button.cc +++ b/atom/browser/api/views/atom_api_label_button.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "atom/browser/api/atom_api_label_button.h" +#include "atom/browser/api/views/atom_api_label_button.h" #include "atom/common/api/constructor.h" #include "base/strings/utf_string_conversions.h" diff --git a/atom/browser/api/atom_api_label_button.h b/atom/browser/api/views/atom_api_label_button.h similarity index 74% rename from atom/browser/api/atom_api_label_button.h rename to atom/browser/api/views/atom_api_label_button.h index 28cd902dcece..9625f5038c7d 100644 --- a/atom/browser/api/atom_api_label_button.h +++ b/atom/browser/api/views/atom_api_label_button.h @@ -2,12 +2,12 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef ATOM_BROWSER_API_ATOM_API_LABEL_BUTTON_H_ -#define ATOM_BROWSER_API_ATOM_API_LABEL_BUTTON_H_ +#ifndef ATOM_BROWSER_API_VIEWS_ATOM_API_LABEL_BUTTON_H_ +#define ATOM_BROWSER_API_VIEWS_ATOM_API_LABEL_BUTTON_H_ #include -#include "atom/browser/api/atom_api_button.h" +#include "atom/browser/api/views/atom_api_button.h" namespace atom { @@ -33,4 +33,4 @@ class LabelButton : public Button { } // namespace atom -#endif // ATOM_BROWSER_API_ATOM_API_LABEL_BUTTON_H_ +#endif // ATOM_BROWSER_API_VIEWS_ATOM_API_LABEL_BUTTON_H_ diff --git a/atom/browser/api/atom_api_layout_manager.cc b/atom/browser/api/views/atom_api_layout_manager.cc similarity index 96% rename from atom/browser/api/atom_api_layout_manager.cc rename to atom/browser/api/views/atom_api_layout_manager.cc index 49c8cea5e748..79d9d61fca1b 100644 --- a/atom/browser/api/atom_api_layout_manager.cc +++ b/atom/browser/api/views/atom_api_layout_manager.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "atom/browser/api/atom_api_layout_manager.h" +#include "atom/browser/api/views/atom_api_layout_manager.h" #include "atom/common/api/constructor.h" #include "native_mate/dictionary.h" diff --git a/atom/browser/api/atom_api_layout_manager.h b/atom/browser/api/views/atom_api_layout_manager.h similarity index 85% rename from atom/browser/api/atom_api_layout_manager.h rename to atom/browser/api/views/atom_api_layout_manager.h index 4e893b746b80..0431f1a21487 100644 --- a/atom/browser/api/atom_api_layout_manager.h +++ b/atom/browser/api/views/atom_api_layout_manager.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef ATOM_BROWSER_API_ATOM_API_LAYOUT_MANAGER_H_ -#define ATOM_BROWSER_API_ATOM_API_LAYOUT_MANAGER_H_ +#ifndef ATOM_BROWSER_API_VIEWS_ATOM_API_LAYOUT_MANAGER_H_ +#define ATOM_BROWSER_API_VIEWS_ATOM_API_LAYOUT_MANAGER_H_ #include @@ -41,4 +41,4 @@ class LayoutManager : public mate::TrackableObject { } // namespace atom -#endif // ATOM_BROWSER_API_ATOM_API_LAYOUT_MANAGER_H_ +#endif // ATOM_BROWSER_API_VIEWS_ATOM_API_LAYOUT_MANAGER_H_ diff --git a/atom/browser/api/atom_api_text_field.cc b/atom/browser/api/views/atom_api_text_field.cc similarity index 96% rename from atom/browser/api/atom_api_text_field.cc rename to atom/browser/api/views/atom_api_text_field.cc index c1ceea3b54a5..19f84b1b777c 100644 --- a/atom/browser/api/atom_api_text_field.cc +++ b/atom/browser/api/views/atom_api_text_field.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#include "atom/browser/api/atom_api_text_field.h" +#include "atom/browser/api/views/atom_api_text_field.h" #include "atom/common/api/constructor.h" #include "native_mate/dictionary.h" diff --git a/atom/browser/api/atom_api_text_field.h b/atom/browser/api/views/atom_api_text_field.h similarity index 83% rename from atom/browser/api/atom_api_text_field.h rename to atom/browser/api/views/atom_api_text_field.h index fd7d592325c8..474b5d4a9e5c 100644 --- a/atom/browser/api/atom_api_text_field.h +++ b/atom/browser/api/views/atom_api_text_field.h @@ -2,8 +2,8 @@ // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. -#ifndef ATOM_BROWSER_API_ATOM_API_TEXT_FIELD_H_ -#define ATOM_BROWSER_API_ATOM_API_TEXT_FIELD_H_ +#ifndef ATOM_BROWSER_API_VIEWS_ATOM_API_TEXT_FIELD_H_ +#define ATOM_BROWSER_API_VIEWS_ATOM_API_TEXT_FIELD_H_ #include "atom/browser/api/atom_api_view.h" #include "native_mate/handle.h" @@ -39,4 +39,4 @@ class TextField : public View { } // namespace atom -#endif // ATOM_BROWSER_API_ATOM_API_TEXT_FIELD_H_ +#endif // ATOM_BROWSER_API_VIEWS_ATOM_API_TEXT_FIELD_H_ diff --git a/lib/browser/api/module-list.js b/lib/browser/api/module-list.js index 02d73ec6d5ac..3fcebe89ba2c 100644 --- a/lib/browser/api/module-list.js +++ b/lib/browser/api/module-list.js @@ -36,10 +36,10 @@ module.exports = [ if (features.isViewApiEnabled()) { module.exports.push( - { name: 'BoxLayout', file: 'box-layout' }, - { name: 'Button', file: 'button' }, - { name: 'LabelButton', file: 'label-button' }, - { name: 'LayoutManager', file: 'layout-manager' }, - { name: 'TextField', file: 'text-field' } + { name: 'BoxLayout', file: 'views/box-layout' }, + { name: 'Button', file: 'views/button' }, + { name: 'LabelButton', file: 'views/label-button' }, + { name: 'LayoutManager', file: 'views/layout-manager' }, + { name: 'TextField', file: 'views/text-field' } ) } diff --git a/lib/browser/api/box-layout.js b/lib/browser/api/views/box-layout.js similarity index 100% rename from lib/browser/api/box-layout.js rename to lib/browser/api/views/box-layout.js diff --git a/lib/browser/api/button.js b/lib/browser/api/views/button.js similarity index 100% rename from lib/browser/api/button.js rename to lib/browser/api/views/button.js diff --git a/lib/browser/api/label-button.js b/lib/browser/api/views/label-button.js similarity index 100% rename from lib/browser/api/label-button.js rename to lib/browser/api/views/label-button.js diff --git a/lib/browser/api/layout-manager.js b/lib/browser/api/views/layout-manager.js similarity index 100% rename from lib/browser/api/layout-manager.js rename to lib/browser/api/views/layout-manager.js diff --git a/lib/browser/api/text-field.js b/lib/browser/api/views/text-field.js similarity index 100% rename from lib/browser/api/text-field.js rename to lib/browser/api/views/text-field.js