refactor: rename the atom namespace to electron
This commit is contained in:
parent
8c4496a9c9
commit
34c4c8d508
531 changed files with 1456 additions and 1428 deletions
|
@ -28,7 +28,7 @@ bool IsDesktopEnvironmentUnity() {
|
|||
|
||||
} // namespace
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
ViewsDelegate::ViewsDelegate() {}
|
||||
|
||||
|
@ -112,4 +112,4 @@ bool ViewsDelegate::WindowManagerProvidesTitleBar(bool maximized) {
|
|||
#endif
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include "base/compiler_specific.h"
|
||||
#include "ui/views/views_delegate.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class ViewsDelegate : public views::ViewsDelegate {
|
||||
public:
|
||||
|
@ -53,6 +53,6 @@ class ViewsDelegate : public views::ViewsDelegate {
|
|||
DISALLOW_COPY_AND_ASSIGN(ViewsDelegate);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_UI_VIEWS_ATOM_VIEWS_DELEGATE_H_
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "ui/views/focus/focus_manager.h"
|
||||
#include "ui/views/widget/widget.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
void AutofillPopupChildView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
|
||||
node_data->role = ax::mojom::Role::kMenuItem;
|
||||
|
@ -489,4 +489,4 @@ void AutofillPopupView::RemoveObserver() {
|
|||
views::WidgetFocusManager::GetInstance()->RemoveFocusChangeListener(this);
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include "shell/browser/osr/osr_view_proxy.h"
|
||||
#endif
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
const int kPopupBorderThickness = 1;
|
||||
const int kSmallerFontSizeDelta = -1;
|
||||
|
@ -150,6 +150,6 @@ class AutofillPopupView : public views::WidgetDelegateView,
|
|||
base::WeakPtrFactory<AutofillPopupView> weak_ptr_factory_;
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_UI_VIEWS_AUTOFILL_POPUP_VIEW_H_
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include "ui/views/widget/widget.h"
|
||||
#include "ui/views/widget/widget_delegate.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -111,4 +111,4 @@ const char* FramelessView::GetClassName() const {
|
|||
return kViewClassName;
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace views {
|
|||
class Widget;
|
||||
}
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class NativeWindowViews;
|
||||
|
||||
|
@ -52,6 +52,6 @@ class FramelessView : public views::NonClientFrameView {
|
|||
DISALLOW_COPY_AND_ASSIGN(FramelessView);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_UI_VIEWS_FRAMELESS_VIEW_H_
|
||||
|
|
|
@ -51,7 +51,7 @@ typedef DbusmenuServer* (*dbusmenu_server_new_func)(const char* object);
|
|||
typedef void (*dbusmenu_server_set_root_func)(DbusmenuServer* self,
|
||||
DbusmenuMenuitem* root);
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -333,4 +333,4 @@ void GlobalMenuBarX11::OnSubMenuShow(DbusmenuMenuitem* item) {
|
|||
BuildMenuFromModel(model->GetSubmenuModelAt(id), item);
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace ui {
|
|||
class Accelerator;
|
||||
}
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class NativeWindowViews;
|
||||
|
||||
|
@ -76,6 +76,6 @@ class GlobalMenuBarX11 {
|
|||
DISALLOW_COPY_AND_ASSIGN(GlobalMenuBarX11);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_UI_VIEWS_GLOBAL_MENU_BAR_X11_H_
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include "ui/views/widget/widget_delegate.h"
|
||||
#include "ui/views/window/client_view.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -232,4 +232,4 @@ void InspectableWebContentsViewViews::Layout() {
|
|||
contents_web_view_->SetBoundsRect(new_contents_bounds);
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
|
|
@ -18,7 +18,7 @@ class Widget;
|
|||
class WidgetDelegate;
|
||||
} // namespace views
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class InspectableWebContentsImpl;
|
||||
|
||||
|
@ -67,6 +67,6 @@ class InspectableWebContentsViewViews : public InspectableWebContentsView,
|
|||
DISALLOW_COPY_AND_ASSIGN(InspectableWebContentsViewViews);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_UI_VIEWS_INSPECTABLE_WEB_CONTENTS_VIEW_VIEWS_H_
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include "ui/gfx/color_utils.h"
|
||||
#endif
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -161,7 +161,7 @@ bool MenuBar::AcceleratorPressed(const ui::Accelerator& accelerator) {
|
|||
auto* button = static_cast<SubmenuButton*>(children[i]);
|
||||
bool shifted = false;
|
||||
auto keycode =
|
||||
atom::KeyboardCodeFromCharCode(button->accelerator(), &shifted);
|
||||
electron::KeyboardCodeFromCharCode(button->accelerator(), &shifted);
|
||||
|
||||
if (keycode == accelerator.key_code()) {
|
||||
const gfx::Point p(0, 0);
|
||||
|
@ -191,7 +191,7 @@ bool MenuBar::SetPaneFocus(views::View* initial_focus) {
|
|||
// views::View::Focus
|
||||
// views::FocusManager::SetFocusedViewWithReason
|
||||
// views::AccessiblePaneView::SetPaneFocus
|
||||
// atom::MenuBar::SetPaneFocus
|
||||
// electron::MenuBar::SetPaneFocus
|
||||
if (initial_focus && initial_focus->GetWidget()) {
|
||||
aura::Window* window = initial_focus->GetWidget()->GetNativeWindow();
|
||||
if (!window || !window->GetRootWindow())
|
||||
|
@ -207,7 +207,7 @@ bool MenuBar::SetPaneFocus(views::View* initial_focus) {
|
|||
auto* button = static_cast<SubmenuButton*>(children[i]);
|
||||
bool shifted = false;
|
||||
auto keycode =
|
||||
atom::KeyboardCodeFromCharCode(button->accelerator(), &shifted);
|
||||
electron::KeyboardCodeFromCharCode(button->accelerator(), &shifted);
|
||||
|
||||
// We want the menu items to activate if the user presses the accelerator
|
||||
// key, even without alt, since we are now focused on the menu bar
|
||||
|
@ -238,7 +238,7 @@ void MenuBar::RemovePaneFocus() {
|
|||
auto* button = static_cast<SubmenuButton*>(children[i]);
|
||||
bool shifted = false;
|
||||
auto keycode =
|
||||
atom::KeyboardCodeFromCharCode(button->accelerator(), &shifted);
|
||||
electron::KeyboardCodeFromCharCode(button->accelerator(), &shifted);
|
||||
|
||||
if (keycode != ui::VKEY_UNKNOWN && unreg.find(keycode) != unreg.end()) {
|
||||
unreg.insert(keycode);
|
||||
|
@ -346,4 +346,4 @@ void MenuBar::UpdateViewColors() {
|
|||
#endif
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
|
|
@ -20,7 +20,7 @@ class Button;
|
|||
class MenuButton;
|
||||
} // namespace views
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class MenuBarColorUpdater : public views::FocusChangeListener {
|
||||
public:
|
||||
|
@ -38,7 +38,7 @@ class MenuBarColorUpdater : public views::FocusChangeListener {
|
|||
|
||||
class MenuBar : public views::AccessiblePaneView,
|
||||
public views::MenuButtonListener,
|
||||
public atom::MenuDelegate::Observer {
|
||||
public electron::MenuDelegate::Observer {
|
||||
public:
|
||||
static const char kViewClassName[];
|
||||
|
||||
|
@ -65,7 +65,7 @@ class MenuBar : public views::AccessiblePaneView,
|
|||
AtomMenuModel** menu_model,
|
||||
views::MenuButton** button);
|
||||
|
||||
// atom::MenuDelegate::Observer:
|
||||
// electron::MenuDelegate::Observer:
|
||||
void OnBeforeExecuteCommand() override;
|
||||
void OnMenuClosed() override;
|
||||
|
||||
|
@ -109,6 +109,6 @@ class MenuBar : public views::AccessiblePaneView,
|
|||
DISALLOW_COPY_AND_ASSIGN(MenuBar);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_UI_VIEWS_MENU_BAR_H_
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include "ui/views/controls/menu/menu_runner.h"
|
||||
#include "ui/views/widget/widget.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
MenuDelegate::MenuDelegate(MenuBar* menu_bar)
|
||||
: menu_bar_(menu_bar), id_(-1), hold_first_switch_(false) {}
|
||||
|
@ -140,4 +140,4 @@ views::MenuItemView* MenuDelegate::GetSiblingMenu(
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
|
|
@ -16,7 +16,7 @@ class MenuRunner;
|
|||
class Button;
|
||||
} // namespace views
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class MenuBar;
|
||||
|
||||
|
@ -75,6 +75,6 @@ class MenuDelegate : public views::MenuDelegate {
|
|||
DISALLOW_COPY_AND_ASSIGN(MenuDelegate);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_UI_VIEWS_MENU_DELEGATE_H_
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
#include "shell/browser/ui/views/menu_model_adapter.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
MenuModelAdapter::MenuModelAdapter(AtomMenuModel* menu_model)
|
||||
: views::MenuModelAdapter(menu_model), menu_model_(menu_model) {}
|
||||
|
@ -22,4 +22,4 @@ bool MenuModelAdapter::GetAccelerator(int id,
|
|||
return false;
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "shell/browser/ui/atom_menu_model.h"
|
||||
#include "ui/views/controls/menu/menu_model_adapter.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class MenuModelAdapter : public views::MenuModelAdapter {
|
||||
public:
|
||||
|
@ -24,6 +24,6 @@ class MenuModelAdapter : public views::MenuModelAdapter {
|
|||
DISALLOW_COPY_AND_ASSIGN(MenuModelAdapter);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_UI_VIEWS_MENU_MODEL_ADAPTER_H_
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "shell/browser/native_window.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
const char NativeFrameView::kViewClassName[] = "AtomNativeFrameView";
|
||||
|
||||
|
@ -25,4 +25,4 @@ const char* NativeFrameView::GetClassName() const {
|
|||
return kViewClassName;
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include "ui/views/window/native_frame_view.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class NativeWindow;
|
||||
|
||||
|
@ -30,6 +30,6 @@ class NativeFrameView : public views::NativeFrameView {
|
|||
DISALLOW_COPY_AND_ASSIGN(NativeFrameView);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_UI_VIEWS_NATIVE_FRAME_VIEW_H_
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "shell/browser/native_window.h"
|
||||
#include "shell/browser/ui/views/menu_bar.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -230,4 +230,4 @@ void RootView::SetInsets(const gfx::Insets& insets) {
|
|||
}
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace content {
|
|||
struct NativeWebKeyboardEvent;
|
||||
}
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class AtomMenuModel;
|
||||
class MenuBar;
|
||||
|
@ -69,6 +69,6 @@ class RootView : public views::View {
|
|||
DISALLOW_COPY_AND_ASSIGN(RootView);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_UI_VIEWS_ROOT_VIEW_H_
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#include "ui/views/animation/ink_drop_impl.h"
|
||||
#include "ui/views/controls/button/label_button_border.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
SubmenuButton::SubmenuButton(const base::string16& title,
|
||||
views::MenuButtonListener* menu_button_listener,
|
||||
|
@ -113,4 +113,4 @@ void SubmenuButton::GetCharacterPosition(const base::string16& text,
|
|||
&height, 0, 0);
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include "ui/views/animation/ink_drop_highlight.h"
|
||||
#include "ui/views/controls/button/menu_button.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
// Special button that used by menu bar to show submenus.
|
||||
class SubmenuButton : public views::MenuButton {
|
||||
|
@ -58,6 +58,6 @@ class SubmenuButton : public views::MenuButton {
|
|||
DISALLOW_COPY_AND_ASSIGN(SubmenuButton);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_UI_VIEWS_SUBMENU_BUTTON_H_
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "ui/views/widget/widget.h"
|
||||
#include "ui/views/win/hwnd_util.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
const char WinFrameView::kViewClassName[] = "WinFrameView";
|
||||
|
||||
|
@ -34,4 +34,4 @@ const char* WinFrameView::GetClassName() const {
|
|||
return kViewClassName;
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include "shell/browser/ui/views/frameless_view.h"
|
||||
|
||||
namespace atom {
|
||||
namespace electron {
|
||||
|
||||
class WinFrameView : public FramelessView {
|
||||
public:
|
||||
|
@ -27,6 +27,6 @@ class WinFrameView : public FramelessView {
|
|||
DISALLOW_COPY_AND_ASSIGN(WinFrameView);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
} // namespace electron
|
||||
|
||||
#endif // SHELL_BROWSER_UI_VIEWS_WIN_FRAME_VIEW_H_
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue