clang-format atom files
This commit is contained in:
parent
717f55b012
commit
53bdf22c85
128 changed files with 771 additions and 753 deletions
|
@ -13,7 +13,10 @@
|
|||
|
||||
namespace accelerator_util {
|
||||
|
||||
typedef struct { int position; atom::AtomMenuModel* model; } MenuItem;
|
||||
typedef struct {
|
||||
int position;
|
||||
atom::AtomMenuModel* model;
|
||||
} MenuItem;
|
||||
typedef std::map<ui::Accelerator, MenuItem> AcceleratorTable;
|
||||
|
||||
// Parse a string as an accelerator.
|
||||
|
|
|
@ -27,8 +27,8 @@ class AtomMenuModel : public ui::SimpleMenuModel {
|
|||
// ui::SimpleMenuModel::Delegate:
|
||||
bool GetAcceleratorForCommandId(int command_id,
|
||||
ui::Accelerator* accelerator) const {
|
||||
return GetAcceleratorForCommandIdWithParams(
|
||||
command_id, false, accelerator);
|
||||
return GetAcceleratorForCommandIdWithParams(command_id, false,
|
||||
accelerator);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface NSColor(Hex)
|
||||
@interface NSColor (Hex)
|
||||
+ (NSColor*)colorWithHexColorString:(NSString*)hex;
|
||||
@end
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface NSString(ANSI)
|
||||
@interface NSString (ANSI)
|
||||
- (BOOL)containsANSICodes;
|
||||
- (NSMutableAttributedString*)attributedStringParsingANSICodes;
|
||||
@end
|
||||
|
|
|
@ -26,7 +26,8 @@ class AtomBundleMover {
|
|||
static void Relaunch(NSString* destinationPath);
|
||||
static NSString* ShellQuotedString(NSString* string);
|
||||
static bool CopyBundle(NSString* srcPath, NSString* dstPath);
|
||||
static bool AuthorizedInstall(NSString* srcPath, NSString* dstPath,
|
||||
static bool AuthorizedInstall(NSString* srcPath,
|
||||
NSString* dstPath,
|
||||
bool* canceled);
|
||||
static bool IsApplicationAtPathRunning(NSString* bundlePath);
|
||||
static bool DeleteOrTrash(NSString* path);
|
||||
|
|
|
@ -22,7 +22,7 @@ class AtomMenuModel;
|
|||
// allow for hierarchical menus). The tag is the index into that model for
|
||||
// that particular item. It is important that the model outlives this object
|
||||
// as it only maintains weak references.
|
||||
@interface AtomMenuController : NSObject<NSMenuDelegate> {
|
||||
@interface AtomMenuController : NSObject <NSMenuDelegate> {
|
||||
@protected
|
||||
atom::AtomMenuModel* model_; // weak
|
||||
base::scoped_nsobject<NSMenu> menu_;
|
||||
|
|
|
@ -17,7 +17,9 @@
|
|||
#include "native_mate/constructor.h"
|
||||
#include "native_mate/persistent_dictionary.h"
|
||||
|
||||
@interface AtomTouchBar : NSObject<NSScrubberDelegate, NSScrubberDataSource, NSScrubberFlowLayoutDelegate> {
|
||||
@interface AtomTouchBar : NSObject <NSScrubberDelegate,
|
||||
NSScrubberDataSource,
|
||||
NSScrubberFlowLayoutDelegate> {
|
||||
@protected
|
||||
std::vector<mate::PersistentDictionary> ordered_settings_;
|
||||
std::map<std::string, mate::PersistentDictionary> settings_;
|
||||
|
@ -25,18 +27,25 @@
|
|||
atom::NativeWindow* window_;
|
||||
}
|
||||
|
||||
- (id)initWithDelegate:(id<NSTouchBarDelegate>)delegate window:(atom::NativeWindow*)window settings:(const std::vector<mate::PersistentDictionary>&)settings;
|
||||
- (id)initWithDelegate:(id<NSTouchBarDelegate>)delegate
|
||||
window:(atom::NativeWindow*)window
|
||||
settings:(const std::vector<mate::PersistentDictionary>&)settings;
|
||||
|
||||
- (NSTouchBar*)makeTouchBar;
|
||||
- (NSTouchBar*)touchBarFromItemIdentifiers:(NSMutableArray*)items;
|
||||
- (NSMutableArray*)identifiersFromSettings:(const std::vector<mate::PersistentDictionary>&)settings;
|
||||
- (void)refreshTouchBarItem:(NSTouchBar*)touchBar id:(const std::string&)item_id;
|
||||
- (void)addNonDefaultTouchBarItems:(const std::vector<mate::PersistentDictionary>&)items;
|
||||
- (void)setEscapeTouchBarItem:(const mate::PersistentDictionary&)item forTouchBar:(NSTouchBar*)touchBar;
|
||||
- (NSMutableArray*)identifiersFromSettings:
|
||||
(const std::vector<mate::PersistentDictionary>&)settings;
|
||||
- (void)refreshTouchBarItem:(NSTouchBar*)touchBar
|
||||
id:(const std::string&)item_id;
|
||||
- (void)addNonDefaultTouchBarItems:
|
||||
(const std::vector<mate::PersistentDictionary>&)items;
|
||||
- (void)setEscapeTouchBarItem:(const mate::PersistentDictionary&)item
|
||||
forTouchBar:(NSTouchBar*)touchBar;
|
||||
|
||||
|
||||
- (NSString*)idFromIdentifier:(NSString*)identifier withPrefix:(NSString*)prefix;
|
||||
- (NSTouchBarItemIdentifier)identifierFromID:(const std::string&)item_id type:(const std::string&)typere;
|
||||
- (NSString*)idFromIdentifier:(NSString*)identifier
|
||||
withPrefix:(NSString*)prefix;
|
||||
- (NSTouchBarItemIdentifier)identifierFromID:(const std::string&)item_id
|
||||
type:(const std::string&)typere;
|
||||
- (bool)hasItemWithID:(const std::string&)item_id;
|
||||
- (NSColor*)colorFromHexColorString:(const std::string&)colorString;
|
||||
|
||||
|
@ -47,19 +56,30 @@
|
|||
|
||||
// Helpers to create touch bar items
|
||||
- (NSTouchBarItem*)makeItemForIdentifier:(NSTouchBarItemIdentifier)identifier;
|
||||
- (NSTouchBarItem*)makeButtonForID:(NSString*)id withIdentifier:(NSString*)identifier;
|
||||
- (NSTouchBarItem*)makeLabelForID:(NSString*)id withIdentifier:(NSString*)identifier;
|
||||
- (NSTouchBarItem*)makeColorPickerForID:(NSString*)id withIdentifier:(NSString*)identifier;
|
||||
- (NSTouchBarItem*)makeSliderForID:(NSString*)id withIdentifier:(NSString*)identifier;
|
||||
- (NSTouchBarItem*)makePopoverForID:(NSString*)id withIdentifier:(NSString*)identifier;
|
||||
- (NSTouchBarItem*)makeGroupForID:(NSString*)id withIdentifier:(NSString*)identifier;
|
||||
- (NSTouchBarItem*)makeButtonForID:(NSString*)id
|
||||
withIdentifier:(NSString*)identifier;
|
||||
- (NSTouchBarItem*)makeLabelForID:(NSString*)id
|
||||
withIdentifier:(NSString*)identifier;
|
||||
- (NSTouchBarItem*)makeColorPickerForID:(NSString*)id
|
||||
withIdentifier:(NSString*)identifier;
|
||||
- (NSTouchBarItem*)makeSliderForID:(NSString*)id
|
||||
withIdentifier:(NSString*)identifier;
|
||||
- (NSTouchBarItem*)makePopoverForID:(NSString*)id
|
||||
withIdentifier:(NSString*)identifier;
|
||||
- (NSTouchBarItem*)makeGroupForID:(NSString*)id
|
||||
withIdentifier:(NSString*)identifier;
|
||||
|
||||
// Helpers to update touch bar items
|
||||
- (void)updateButton:(NSCustomTouchBarItem*)item withSettings:(const mate::PersistentDictionary&)settings;
|
||||
- (void)updateLabel:(NSCustomTouchBarItem*)item withSettings:(const mate::PersistentDictionary&)settings;
|
||||
- (void)updateColorPicker:(NSColorPickerTouchBarItem*)item withSettings:(const mate::PersistentDictionary&)settings;
|
||||
- (void)updateSlider:(NSSliderTouchBarItem*)item withSettings:(const mate::PersistentDictionary&)settings;
|
||||
- (void)updatePopover:(NSPopoverTouchBarItem*)item withSettings:(const mate::PersistentDictionary&)settings;
|
||||
- (void)updateButton:(NSCustomTouchBarItem*)item
|
||||
withSettings:(const mate::PersistentDictionary&)settings;
|
||||
- (void)updateLabel:(NSCustomTouchBarItem*)item
|
||||
withSettings:(const mate::PersistentDictionary&)settings;
|
||||
- (void)updateColorPicker:(NSColorPickerTouchBarItem*)item
|
||||
withSettings:(const mate::PersistentDictionary&)settings;
|
||||
- (void)updateSlider:(NSSliderTouchBarItem*)item
|
||||
withSettings:(const mate::PersistentDictionary&)settings;
|
||||
- (void)updatePopover:(NSPopoverTouchBarItem*)item
|
||||
withSettings:(const mate::PersistentDictionary&)settings;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -14,18 +14,18 @@
|
|||
#pragma clang assume_nonnull begin
|
||||
|
||||
@class NSTouchBar, NSTouchBarItem;
|
||||
@class NSScrubber, NSScrubberItemView, NSScrubberArrangedView, NSScrubberTextItemView, NSScrubberImageItemView, NSScrubberSelectionStyle;
|
||||
@protocol NSTouchBarDelegate, NSScrubberDelegate, NSScrubberDataSource, NSScrubberFlowLayoutDelegate, NSScrubberFlowLayout;
|
||||
@class NSScrubber, NSScrubberItemView, NSScrubberArrangedView,
|
||||
NSScrubberTextItemView, NSScrubberImageItemView, NSScrubberSelectionStyle;
|
||||
@protocol NSTouchBarDelegate
|
||||
, NSScrubberDelegate, NSScrubberDataSource, NSScrubberFlowLayoutDelegate,
|
||||
NSScrubberFlowLayout;
|
||||
|
||||
typedef float NSTouchBarItemPriority;
|
||||
static const NSTouchBarItemPriority NSTouchBarItemPriorityHigh = 1000;
|
||||
static const NSTouchBarItemPriority NSTouchBarItemPriorityNormal = 0;
|
||||
static const NSTouchBarItemPriority NSTouchBarItemPriorityLow = -1000;
|
||||
|
||||
enum NSScrubberMode {
|
||||
NSScrubberModeFixed = 0,
|
||||
NSScrubberModeFree
|
||||
};
|
||||
enum NSScrubberMode { NSScrubberModeFixed = 0, NSScrubberModeFree };
|
||||
|
||||
typedef NSString* NSTouchBarItemIdentifier;
|
||||
typedef NSString* NSTouchBarCustomizationIdentifier;
|
||||
|
@ -42,7 +42,7 @@ static const NSTouchBarItemIdentifier NSTouchBarItemIdentifierFlexibleSpace =
|
|||
static const NSTouchBarItemIdentifier NSTouchBarItemIdentifierOtherItemsProxy =
|
||||
@"NSTouchBarItemIdentifierOtherItemsProxy";
|
||||
|
||||
@interface NSTouchBar : NSObject<NSCoding>
|
||||
@interface NSTouchBar : NSObject <NSCoding>
|
||||
|
||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
|
||||
- (nullable instancetype)initWithCoder:(NSCoder*)aDecoder
|
||||
|
@ -55,7 +55,8 @@ static const NSTouchBarItemIdentifier NSTouchBarItemIdentifierOtherItemsProxy =
|
|||
@property(copy) NSArray* defaultItemIdentifiers;
|
||||
@property(copy, readonly) NSArray* itemIdentifiers;
|
||||
@property(copy, nullable) NSTouchBarItemIdentifier principalItemIdentifier;
|
||||
@property(copy, nullable) NSTouchBarItemIdentifier escapeKeyReplacementItemIdentifier;
|
||||
@property(copy, nullable)
|
||||
NSTouchBarItemIdentifier escapeKeyReplacementItemIdentifier;
|
||||
@property(copy) NSSet* templateItems;
|
||||
@property(nullable, weak) id<NSTouchBarDelegate> delegate;
|
||||
|
||||
|
@ -66,7 +67,7 @@ static const NSTouchBarItemIdentifier NSTouchBarItemIdentifierOtherItemsProxy =
|
|||
|
||||
@end
|
||||
|
||||
@interface NSTouchBarItem : NSObject<NSCoding>
|
||||
@interface NSTouchBarItem : NSObject <NSCoding>
|
||||
|
||||
- (instancetype)initWithIdentifier:(NSTouchBarItemIdentifier)identifier
|
||||
NS_DESIGNATED_INITIALIZER;
|
||||
|
@ -149,13 +150,15 @@ static const NSTouchBarItemIdentifier NSTouchBarItemIdentifierOtherItemsProxy =
|
|||
|
||||
@end
|
||||
|
||||
@interface NSScrubberFlowLayout: NSObject
|
||||
@interface NSScrubberFlowLayout : NSObject
|
||||
@end
|
||||
|
||||
@interface NSScrubberSelectionStyle : NSObject<NSCoding>
|
||||
@interface NSScrubberSelectionStyle : NSObject <NSCoding>
|
||||
|
||||
@property(class, strong, readonly) NSScrubberSelectionStyle* outlineOverlayStyle;
|
||||
@property(class, strong, readonly) NSScrubberSelectionStyle* roundedBackgroundStyle;
|
||||
@property(class, strong, readonly)
|
||||
NSScrubberSelectionStyle* outlineOverlayStyle;
|
||||
@property(class, strong, readonly)
|
||||
NSScrubberSelectionStyle* roundedBackgroundStyle;
|
||||
|
||||
@end
|
||||
|
||||
|
@ -209,7 +212,7 @@ static const NSTouchBarItemIdentifier NSTouchBarItemIdentifierOtherItemsProxy =
|
|||
|
||||
@end
|
||||
|
||||
@protocol NSTouchBarDelegate<NSObject>
|
||||
@protocol NSTouchBarDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
- (nullable NSTouchBarItem*)touchBar:(NSTouchBar*)touchBar
|
||||
|
@ -217,24 +220,28 @@ static const NSTouchBarItemIdentifier NSTouchBarItemIdentifierOtherItemsProxy =
|
|||
|
||||
@end
|
||||
|
||||
@protocol NSScrubberDelegate<NSObject>
|
||||
@protocol NSScrubberDelegate <NSObject>
|
||||
|
||||
- (void)scrubber:(NSScrubber*)scrubber didHighlightItemAtIndex:(NSInteger)highlightedIndex;
|
||||
- (void)scrubber:(NSScrubber*)scrubber didSelectItemAtIndex:(NSInteger)selectedIndex;
|
||||
- (void)scrubber:(NSScrubber*)scrubber
|
||||
didHighlightItemAtIndex:(NSInteger)highlightedIndex;
|
||||
- (void)scrubber:(NSScrubber*)scrubber
|
||||
didSelectItemAtIndex:(NSInteger)selectedIndex;
|
||||
|
||||
@end
|
||||
|
||||
@protocol NSScrubberDataSource<NSObject>
|
||||
@protocol NSScrubberDataSource <NSObject>
|
||||
|
||||
- (NSInteger)numberOfItemsForScrubber:(NSScrubber*)scrubber;
|
||||
- (__kindof NSScrubberItemView*)scrubber:(NSScrubber*)scrubber
|
||||
viewForItemAtIndex:(NSInteger)index;
|
||||
viewForItemAtIndex:(NSInteger)index;
|
||||
|
||||
@end
|
||||
|
||||
@protocol NSScrubberFlowLayoutDelegate<NSObject>
|
||||
@protocol NSScrubberFlowLayoutDelegate <NSObject>
|
||||
|
||||
- (NSSize)scrubber:(NSScrubber *)scrubber layout:(NSScrubberFlowLayout *)layout sizeForItemAtIndex:(NSInteger)itemIndex;
|
||||
- (NSSize)scrubber:(NSScrubber*)scrubber
|
||||
layout:(NSScrubberFlowLayout*)layout
|
||||
sizeForItemAtIndex:(NSInteger)itemIndex;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -19,38 +19,37 @@ class NativeWindow;
|
|||
namespace file_dialog {
|
||||
|
||||
// <description, extensions>
|
||||
typedef std::pair<std::string, std::vector<std::string> > Filter;
|
||||
typedef std::pair<std::string, std::vector<std::string>> Filter;
|
||||
typedef std::vector<Filter> Filters;
|
||||
|
||||
enum FileDialogProperty {
|
||||
FILE_DIALOG_OPEN_FILE = 1 << 0,
|
||||
FILE_DIALOG_OPEN_DIRECTORY = 1 << 1,
|
||||
FILE_DIALOG_MULTI_SELECTIONS = 1 << 2,
|
||||
FILE_DIALOG_CREATE_DIRECTORY = 1 << 3,
|
||||
FILE_DIALOG_SHOW_HIDDEN_FILES = 1 << 4,
|
||||
FILE_DIALOG_PROMPT_TO_CREATE = 1 << 5,
|
||||
FILE_DIALOG_OPEN_FILE = 1 << 0,
|
||||
FILE_DIALOG_OPEN_DIRECTORY = 1 << 1,
|
||||
FILE_DIALOG_MULTI_SELECTIONS = 1 << 2,
|
||||
FILE_DIALOG_CREATE_DIRECTORY = 1 << 3,
|
||||
FILE_DIALOG_SHOW_HIDDEN_FILES = 1 << 4,
|
||||
FILE_DIALOG_PROMPT_TO_CREATE = 1 << 5,
|
||||
FILE_DIALOG_NO_RESOLVE_ALIASES = 1 << 6,
|
||||
FILE_DIALOG_TREAT_PACKAGE_APP_AS_DIRECTORY = 1 << 7,
|
||||
};
|
||||
|
||||
#if defined(MAS_BUILD)
|
||||
typedef base::Callback<void(
|
||||
bool result,
|
||||
const std::vector<base::FilePath>& paths,
|
||||
const std::vector<std::string>& bookmarkData)> OpenDialogCallback;
|
||||
typedef base::Callback<void(bool result,
|
||||
const std::vector<base::FilePath>& paths,
|
||||
const std::vector<std::string>& bookmarkData)>
|
||||
OpenDialogCallback;
|
||||
|
||||
typedef base::Callback<void(
|
||||
bool result,
|
||||
const base::FilePath& path,
|
||||
const std::string& bookmarkData)> SaveDialogCallback;
|
||||
typedef base::Callback<void(bool result,
|
||||
const base::FilePath& path,
|
||||
const std::string& bookmarkData)>
|
||||
SaveDialogCallback;
|
||||
#else
|
||||
typedef base::Callback<void(
|
||||
bool result,
|
||||
const std::vector<base::FilePath>& paths)> OpenDialogCallback;
|
||||
typedef base::Callback<void(bool result,
|
||||
const std::vector<base::FilePath>& paths)>
|
||||
OpenDialogCallback;
|
||||
|
||||
typedef base::Callback<void(
|
||||
bool result,
|
||||
const base::FilePath& path)> SaveDialogCallback;
|
||||
typedef base::Callback<void(bool result, const base::FilePath& path)>
|
||||
SaveDialogCallback;
|
||||
#endif
|
||||
|
||||
struct DialogSettings {
|
||||
|
@ -73,8 +72,7 @@ bool ShowOpenDialog(const DialogSettings& settings,
|
|||
void ShowOpenDialog(const DialogSettings& settings,
|
||||
const OpenDialogCallback& callback);
|
||||
|
||||
bool ShowSaveDialog(const DialogSettings& settings,
|
||||
base::FilePath* path);
|
||||
bool ShowSaveDialog(const DialogSettings& settings, base::FilePath* path);
|
||||
|
||||
void ShowSaveDialog(const DialogSettings& settings,
|
||||
const SaveDialogCallback& callback);
|
||||
|
|
|
@ -28,7 +28,7 @@ enum MessageBoxType {
|
|||
};
|
||||
|
||||
enum MessageBoxOptions {
|
||||
MESSAGE_BOX_NONE = 0,
|
||||
MESSAGE_BOX_NONE = 0,
|
||||
MESSAGE_BOX_NO_LINK = 1 << 0,
|
||||
};
|
||||
|
||||
|
|
|
@ -45,8 +45,8 @@ class TrayIcon {
|
|||
|
||||
// Sets the status icon highlight mode. This only works on macOS.
|
||||
enum HighlightMode {
|
||||
ALWAYS, // Always highlight the tray icon
|
||||
NEVER, // Never highlight the tray icon
|
||||
ALWAYS, // Always highlight the tray icon
|
||||
NEVER, // Never highlight the tray icon
|
||||
SELECTION // Highlight the tray icon when clicked or the menu is opened
|
||||
};
|
||||
virtual void SetHighlightMode(HighlightMode mode);
|
||||
|
@ -90,7 +90,7 @@ class TrayIcon {
|
|||
void NotifyMouseExited(const gfx::Point& location = gfx::Point(),
|
||||
int modifiers = 0);
|
||||
void NotifyMouseMoved(const gfx::Point& location = gfx::Point(),
|
||||
int modifiers = 0);
|
||||
int modifiers = 0);
|
||||
|
||||
protected:
|
||||
TrayIcon();
|
||||
|
|
|
@ -17,8 +17,7 @@
|
|||
|
||||
namespace atom {
|
||||
|
||||
class TrayIconCocoa : public TrayIcon,
|
||||
public AtomMenuModel::Observer {
|
||||
class TrayIconCocoa : public TrayIcon, public AtomMenuModel::Observer {
|
||||
public:
|
||||
TrayIconCocoa();
|
||||
virtual ~TrayIconCocoa();
|
||||
|
|
|
@ -16,8 +16,7 @@ class StatusIconLinux;
|
|||
|
||||
namespace atom {
|
||||
|
||||
class TrayIconGtk : public TrayIcon,
|
||||
public views::StatusIconLinux::Delegate {
|
||||
class TrayIconGtk : public TrayIcon, public views::StatusIconLinux::Delegate {
|
||||
public:
|
||||
TrayIconGtk();
|
||||
virtual ~TrayIconGtk();
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
namespace gfx {
|
||||
class Rect;
|
||||
class Point;
|
||||
}
|
||||
} // namespace gfx
|
||||
|
||||
namespace atom {
|
||||
|
||||
|
|
|
@ -68,13 +68,15 @@ class AutofillPopupView : public views::WidgetDelegateView,
|
|||
|
||||
int GetSelectedLine() { return selected_line_.value_or(-1); }
|
||||
|
||||
void WriteDragDataForView(
|
||||
views::View*, const gfx::Point&, ui::OSExchangeData*) override {}
|
||||
void WriteDragDataForView(views::View*,
|
||||
const gfx::Point&,
|
||||
ui::OSExchangeData*) override {}
|
||||
int GetDragOperationsForView(views::View*, const gfx::Point&) override {
|
||||
return ui::DragDropTypes::DRAG_NONE;
|
||||
}
|
||||
bool CanStartDragForView(
|
||||
views::View*, const gfx::Point&, const gfx::Point&) override {
|
||||
bool CanStartDragForView(views::View*,
|
||||
const gfx::Point&,
|
||||
const gfx::Point&) override {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,8 +31,7 @@ class FramelessView : public views::NonClientFrameView {
|
|||
gfx::Rect GetWindowBoundsForClientBounds(
|
||||
const gfx::Rect& client_bounds) const override;
|
||||
int NonClientHitTest(const gfx::Point& point) override;
|
||||
void GetWindowMask(const gfx::Size& size,
|
||||
gfx::Path* window_mask) override;
|
||||
void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override;
|
||||
void ResetWindowControls() override;
|
||||
void UpdateWindowIcon() override;
|
||||
void UpdateWindowTitle() override;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include "ui/gfx/native_widget_types.h"
|
||||
|
||||
typedef struct _DbusmenuMenuitem DbusmenuMenuitem;
|
||||
typedef struct _DbusmenuServer DbusmenuServer;
|
||||
typedef struct _DbusmenuServer DbusmenuServer;
|
||||
|
||||
namespace ui {
|
||||
class Accelerator;
|
||||
|
@ -61,7 +61,10 @@ class GlobalMenuBarX11 {
|
|||
void RegisterAccelerator(DbusmenuMenuitem* item,
|
||||
const ui::Accelerator& accelerator);
|
||||
|
||||
CHROMEG_CALLBACK_1(GlobalMenuBarX11, void, OnItemActivated, DbusmenuMenuitem*,
|
||||
CHROMEG_CALLBACK_1(GlobalMenuBarX11,
|
||||
void,
|
||||
OnItemActivated,
|
||||
DbusmenuMenuitem*,
|
||||
unsigned int);
|
||||
CHROMEG_CALLBACK_0(GlobalMenuBarX11, void, OnSubMenuShow, DbusmenuMenuitem*);
|
||||
|
||||
|
|
|
@ -41,12 +41,11 @@ class MenuDelegate : public views::MenuDelegate {
|
|||
void WillShowMenu(views::MenuItemView* menu) override;
|
||||
void WillHideMenu(views::MenuItemView* menu) override;
|
||||
void OnMenuClosed(views::MenuItemView* menu) override;
|
||||
views::MenuItemView* GetSiblingMenu(
|
||||
views::MenuItemView* menu,
|
||||
const gfx::Point& screen_point,
|
||||
views::MenuAnchorPosition* anchor,
|
||||
bool* has_mnemonics,
|
||||
views::MenuButton** button) override;
|
||||
views::MenuItemView* GetSiblingMenu(views::MenuItemView* menu,
|
||||
const gfx::Point& screen_point,
|
||||
views::MenuAnchorPosition* anchor,
|
||||
bool* has_mnemonics,
|
||||
views::MenuButton** button) override;
|
||||
|
||||
private:
|
||||
MenuBar* menu_bar_;
|
||||
|
|
|
@ -33,9 +33,11 @@ class SubmenuButton : public views::MenuButton {
|
|||
private:
|
||||
bool GetUnderlinePosition(const base::string16& text,
|
||||
base::char16* accelerator,
|
||||
int* start, int* end) const;
|
||||
void GetCharacterPosition(
|
||||
const base::string16& text, int index, int* pos) const;
|
||||
int* start,
|
||||
int* end) const;
|
||||
void GetCharacterPosition(const base::string16& text,
|
||||
int index,
|
||||
int* pos) const;
|
||||
|
||||
base::char16 accelerator_;
|
||||
|
||||
|
|
|
@ -47,8 +47,9 @@ class PdfViewerHandler : public content::WebUIMessageHandler,
|
|||
void SetZoom(const base::ListValue* args);
|
||||
void GetStrings(const base::ListValue* args);
|
||||
void Reload(const base::ListValue* args);
|
||||
void OnZoomLevelChanged(content::WebContents* web_contents, double level,
|
||||
bool is_temporary);
|
||||
void OnZoomLevelChanged(content::WebContents* web_contents,
|
||||
double level,
|
||||
bool is_temporary);
|
||||
void AddObserver();
|
||||
void RemoveObserver();
|
||||
std::unique_ptr<base::Value> initialize_callback_id_;
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
namespace content {
|
||||
class BrowserContext;
|
||||
struct StreamInfo;
|
||||
}
|
||||
} // namespace content
|
||||
|
||||
namespace atom {
|
||||
|
||||
|
|
|
@ -19,10 +19,9 @@ class AtomDesktopNativeWidgetAura : public views::DesktopNativeWidgetAura {
|
|||
void Activate() override;
|
||||
|
||||
private:
|
||||
void OnWindowActivated(
|
||||
wm::ActivationChangeObserver::ActivationReason reason,
|
||||
aura::Window* gained_active,
|
||||
aura::Window* lost_active) override;
|
||||
void OnWindowActivated(wm::ActivationChangeObserver::ActivationReason reason,
|
||||
aura::Window* gained_active,
|
||||
aura::Window* lost_active) override;
|
||||
DISALLOW_COPY_AND_ASSIGN(AtomDesktopNativeWidgetAura);
|
||||
};
|
||||
|
||||
|
|
|
@ -25,8 +25,10 @@ class AtomDesktopWindowTreeHostWin : public views::DesktopWindowTreeHostWin {
|
|||
~AtomDesktopWindowTreeHostWin() override;
|
||||
|
||||
protected:
|
||||
bool PreHandleMSG(
|
||||
UINT message, WPARAM w_param, LPARAM l_param, LRESULT* result) override;
|
||||
bool PreHandleMSG(UINT message,
|
||||
WPARAM w_param,
|
||||
LPARAM l_param,
|
||||
LRESULT* result) override;
|
||||
bool HasNativeFrame() const override;
|
||||
|
||||
private:
|
||||
|
|
|
@ -98,7 +98,7 @@ class JumpList {
|
|||
JumpListResult AppendCategory(const JumpListCategory& category);
|
||||
// Appends categories to the custom Jump List.
|
||||
JumpListResult AppendCategories(
|
||||
const std::vector<JumpListCategory>& categories);
|
||||
const std::vector<JumpListCategory>& categories);
|
||||
|
||||
private:
|
||||
base::string16 app_id_;
|
||||
|
|
|
@ -17,8 +17,10 @@ class MessageHandlerDelegate {
|
|||
// message was consumed by the delegate and should not be processed further
|
||||
// by the HWNDMessageHandler. In this case, |result| is returned. |result| is
|
||||
// not modified otherwise.
|
||||
virtual bool PreHandleMSG(
|
||||
UINT message, WPARAM w_param, LPARAM l_param, LRESULT* result);
|
||||
virtual bool PreHandleMSG(UINT message,
|
||||
WPARAM w_param,
|
||||
LPARAM l_param,
|
||||
LRESULT* result);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
|
|
|
@ -27,11 +27,15 @@ class NotifyIconHost {
|
|||
typedef std::vector<NotifyIcon*> NotifyIcons;
|
||||
|
||||
// Static callback invoked when a message comes in to our messaging window.
|
||||
static LRESULT CALLBACK
|
||||
WndProcStatic(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
|
||||
static LRESULT CALLBACK WndProcStatic(HWND hwnd,
|
||||
UINT message,
|
||||
WPARAM wparam,
|
||||
LPARAM lparam);
|
||||
|
||||
LRESULT CALLBACK
|
||||
WndProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
|
||||
LRESULT CALLBACK WndProc(HWND hwnd,
|
||||
UINT message,
|
||||
WPARAM wparam,
|
||||
LPARAM lparam);
|
||||
|
||||
UINT NextIconId();
|
||||
|
||||
|
|
|
@ -32,18 +32,20 @@ class TaskbarHost {
|
|||
virtual ~TaskbarHost();
|
||||
|
||||
// Add or update the buttons in thumbar.
|
||||
bool SetThumbarButtons(
|
||||
HWND window, const std::vector<ThumbarButton>& buttons);
|
||||
bool SetThumbarButtons(HWND window,
|
||||
const std::vector<ThumbarButton>& buttons);
|
||||
|
||||
void RestoreThumbarButtons(HWND window);
|
||||
|
||||
// Set the progress state in taskbar.
|
||||
bool SetProgressBar(
|
||||
HWND window, double value, const NativeWindow::ProgressState state);
|
||||
bool SetProgressBar(HWND window,
|
||||
double value,
|
||||
const NativeWindow::ProgressState state);
|
||||
|
||||
// Set the overlay icon in taskbar.
|
||||
bool SetOverlayIcon(
|
||||
HWND window, const gfx::Image& overlay, const std::string& text);
|
||||
bool SetOverlayIcon(HWND window,
|
||||
const gfx::Image& overlay,
|
||||
const std::string& text);
|
||||
|
||||
// Set the region of the window to show as a thumbnail in taskbar.
|
||||
bool SetThumbnailClip(HWND window, const gfx::Rect& region);
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
#ifndef ATOM_BROWSER_UI_X_X_WINDOW_UTILS_H_
|
||||
#define ATOM_BROWSER_UI_X_X_WINDOW_UTILS_H_
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/extensions/XInput2.h>
|
||||
#include <X11/extensions/Xrandr.h>
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue