Browse Source

chore: move the view APIs to their own directory (#14722)

* chore: move the view APIs to their own directory

* move view api cpp files
Samuel Attard 6 years ago
parent
commit
a524c5ec12

+ 15 - 15
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",
     ]
   }
 

+ 1 - 1
atom/browser/api/atom_api_view.h

@@ -8,7 +8,7 @@
 #include <memory>
 #include <vector>
 
-#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"
 

+ 1 - 1
atom/browser/api/atom_api_box_layout.cc → 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 <string>
 

+ 4 - 4
atom/browser/api/atom_api_box_layout.h → 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_

+ 1 - 1
atom/browser/api/atom_api_button.cc → 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"

+ 3 - 3
atom/browser/api/atom_api_button.h → 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_

+ 1 - 1
atom/browser/api/atom_api_label_button.cc → 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"

+ 4 - 4
atom/browser/api/atom_api_label_button.h → 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 <string>
 
-#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_

+ 1 - 1
atom/browser/api/atom_api_layout_manager.cc → 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"

+ 3 - 3
atom/browser/api/atom_api_layout_manager.h → 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 <memory>
 
@@ -41,4 +41,4 @@ class LayoutManager : public mate::TrackableObject<LayoutManager> {
 
 }  // namespace atom
 
-#endif  // ATOM_BROWSER_API_ATOM_API_LAYOUT_MANAGER_H_
+#endif  // ATOM_BROWSER_API_VIEWS_ATOM_API_LAYOUT_MANAGER_H_

+ 1 - 1
atom/browser/api/atom_api_text_field.cc → 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"

+ 3 - 3
atom/browser/api/atom_api_text_field.h → 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_

+ 5 - 5
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' }
   )
 }

+ 0 - 0
lib/browser/api/box-layout.js → lib/browser/api/views/box-layout.js


+ 0 - 0
lib/browser/api/button.js → lib/browser/api/views/button.js


+ 0 - 0
lib/browser/api/label-button.js → lib/browser/api/views/label-button.js


+ 0 - 0
lib/browser/api/layout-manager.js → lib/browser/api/views/layout-manager.js


+ 0 - 0
lib/browser/api/text-field.js → lib/browser/api/views/text-field.js