Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
838da3a
Fix for launching Chrome with temporary profile in OSX.
fungl164 Sep 26, 2013
8e0fa25
Fix Chrome Live Development open/close issues on OSX
fungl164 Oct 1, 2013
107ce80
Use profile consistent with other platforms.
fungl164 Oct 1, 2013
5e61b90
Code cleanup
fungl164 Oct 1, 2013
bb3415a
Fix early break out when getting startup arguments for running proces…
fungl164 Oct 1, 2013
9f57515
Fix missing url while opening LiveBrowser.
fungl164 Oct 1, 2013
032f240
Fix extra tab with interstitial page on initial launch.
fungl164 Oct 1, 2013
fdedc42
Ensure LiveBrowser is running before opening a Live Dev url.
fungl164 Oct 1, 2013
3c199db
Fix inconsistencies with calls to LiveBrowserMgrMac::...
fungl164 Oct 1, 2013
fae94e9
Modified LiveBrowser instance lookups to use NSRunningApplication dat…
fungl164 Oct 2, 2013
9ceeba4
Tighter controls for meaningless NotificationCenter messages.
fungl164 Oct 3, 2013
bdea9db
Remove extraneous header file.
fungl164 Oct 3, 2013
3508209
Removed calls to NSLog(...)
fungl164 Oct 3, 2013
8527759
Using ScriptingBridge to locate and manage LiveBrowser windows and tabs
fungl164 Oct 13, 2013
8caec09
Adding missing frameworks to fix compilation issues
fungl164 Oct 14, 2013
e0f84e9
Remove LiveBrowser window caching + some code clean up
fungl164 Oct 14, 2013
c9d54c6
Disabling locks using @try/@finally constructs for now. Needs furthe…
fungl164 Oct 14, 2013
c5de458
Reinstating LiveBrowser window caching
fungl164 Oct 15, 2013
821c6e5
Minor fixes for LiveBrowser window caching.
fungl164 Oct 15, 2013
03a404d
Merge branch 'master' into chrome-brackets-profile
fungl164 Oct 15, 2013
34c65c1
Tweaks to Open/CloseLiveBrowser calls
fungl164 Oct 17, 2013
6ca3539
Code cleanup. synced with Brackets Sprint 33 src tree
fungl164 Oct 18, 2013
0591980
Shutdown Chrome when CloseLiveBrowser() detects last tab being closed.
fungl164 Oct 19, 2013
f778ebc
Remove unnecessary window caching.
fungl164 Oct 19, 2013
7fb7641
Enable real-time LiveBrowser process id lookups + other fixes/cleanups.
fungl164 Oct 19, 2013
52412b5
Fix bug causing Brackets to crash when closing another running instan…
fungl164 Oct 22, 2013
f984943
Stop listening for workspace notifications after successful LD CloseL…
fungl164 Oct 22, 2013
fd3a4c9
Ensure shutdown notifications are properly set/unset on calls to Clos…
fungl164 Oct 22, 2013
3fc499e
Fix XCode 4 compilation problems with @try/@catch constructs + potent…
fungl164 Oct 23, 2013
01e4b4f
Minor cleanup + additional error checking
fungl164 Oct 26, 2013
5cd80dd
Stricter filtering for LD debug port launch parameters.
fungl164 Oct 26, 2013
a915f44
Merge branch 'master' into fungl164/chrome-live-osx
fungl164 Oct 31, 2013
b56f2af
Fix Brackets crash when calling OpenLiveBrowser(argUrl, false)
fungl164 Nov 1, 2013
ac6df00
Code cleanup (as per @redmunds suggestions)
fungl164 Nov 4, 2013
99f0ce8
Minor fix for OpenLiveBrowser(...) retry count
fungl164 Nov 5, 2013
f36054d
Rename google_chrome_mac.h back to GoogleChrome.h (original name)
fungl164 Nov 5, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions appshell.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@
'link_settings': {
'libraries': [
'$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
'$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
'$(SDKROOT)/System/Library/Frameworks/ScriptingBridge.framework',
'$(CONFIGURATION)/libcef.dylib',
],
},
Expand Down Expand Up @@ -359,6 +361,8 @@
'link_settings': {
'libraries': [
'$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
'$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
'$(SDKROOT)/System/Library/Frameworks/ScriptingBridge.framework',
'$(CONFIGURATION)/libcef.dylib',
],
},
Expand Down
191 changes: 191 additions & 0 deletions appshell/GoogleChrome.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
/*
* GoogleChrome.h
*/

#import <AppKit/AppKit.h>
#import <ScriptingBridge/ScriptingBridge.h>


@class GoogleChromeApplication, GoogleChromeWindow, GoogleChromeTab, GoogleChromeBookmarkFolder, GoogleChromeBookmarkItem;



/*
* Standard Suite
*/

// The application's top-level scripting object.
@interface GoogleChromeApplication : SBApplication

- (SBElementArray *) windows;

@property (copy, readonly) NSString *name; // The name of the application.
@property (readonly) BOOL frontmost; // Is this the frontmost (active) application?
@property (copy, readonly) NSString *version; // The version of the application.

- (void) open:(NSArray *)x; // Open a document.
- (void) quit; // Quit the application.
- (BOOL) exists:(id)x; // Verify if an object exists.

@end

// A window.
@interface GoogleChromeWindow : SBObject

- (SBElementArray *) tabs;

@property (copy, readonly) NSString *name; // The full title of the window.
- (NSInteger) id; // The unique identifier of the window.
@property NSInteger index; // The index of the window, ordered front to back.
@property NSRect bounds; // The bounding rectangle of the window.
@property (readonly) BOOL closeable; // Whether the window has a close box.
@property (readonly) BOOL minimizable; // Whether the window can be minimized.
@property BOOL minimized; // Whether the window is currently minimized.
@property (readonly) BOOL resizable; // Whether the window can be resized.
@property BOOL visible; // Whether the window is currently visible.
@property (readonly) BOOL zoomable; // Whether the window can be zoomed.
@property BOOL zoomed; // Whether the window is currently zoomed.
@property (copy, readonly) GoogleChromeTab *activeTab; // Returns the currently selected tab
@property (copy) NSString *mode; // Represents the mode of the window which can be 'normal' or 'incognito', can be set only once during creation of the window.
@property NSInteger activeTabIndex; // The index of the active tab.

- (void) saveIn:(NSURL *)in_ as:(NSString *)as; // Save an object.
- (void) close; // Close a window.
- (void) delete; // Delete an object.
- (SBObject *) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location.
- (SBObject *) moveTo:(SBObject *)to; // Move object(s) to a new location.
- (void) print; // Print an object.
- (void) reload; // Reload a tab.
- (void) goBack; // Go Back (If Possible).
- (void) goForward; // Go Forward (If Possible).
- (void) selectAll; // Select all.
- (void) cutSelection; // Cut selected text (If Possible).
- (void) copySelection; // Copy text.
- (void) pasteSelection; // Paste text (If Possible).
- (void) undo; // Undo the last change.
- (void) redo; // Redo the last change.
- (void) stop; // Stop the current tab from loading.
- (void) viewSource; // View the HTML source of the tab.
- (id) executeJavascript:(NSString *)javascript; // Execute a piece of javascript.
- (void) enterPresentationMode; // Enter presentation mode in window.
- (void) exitPresentationMode; // Exit presentation mode in window.

@end



/*
* Chromium Suite
*/

// The application's top-level scripting object.
@interface GoogleChromeApplication (ChromiumSuite)

- (SBElementArray *) bookmarkFolders;

@property (copy, readonly) GoogleChromeBookmarkFolder *bookmarksBar; // The bookmarks bar bookmark folder.
@property (copy, readonly) GoogleChromeBookmarkFolder *otherBookmarks; // The other bookmarks bookmark folder.

@end

// A tab.
@interface GoogleChromeTab : SBObject

- (NSInteger) id; // Unique ID of the tab.
@property (copy, readonly) NSString *title; // The title of the tab.
@property (copy) NSString *URL; // The url visible to the user.
@property (readonly) BOOL loading; // Is loading?

- (void) saveIn:(NSURL *)in_ as:(NSString *)as; // Save an object.
- (void) close; // Close a window.
- (void) delete; // Delete an object.
- (SBObject *) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location.
- (SBObject *) moveTo:(SBObject *)to; // Move object(s) to a new location.
- (void) print; // Print an object.
- (void) reload; // Reload a tab.
- (void) goBack; // Go Back (If Possible).
- (void) goForward; // Go Forward (If Possible).
- (void) selectAll; // Select all.
- (void) cutSelection; // Cut selected text (If Possible).
- (void) copySelection; // Copy text.
- (void) pasteSelection; // Paste text (If Possible).
- (void) undo; // Undo the last change.
- (void) redo; // Redo the last change.
- (void) stop; // Stop the current tab from loading.
- (void) viewSource; // View the HTML source of the tab.
- (id) executeJavascript:(NSString *)javascript; // Execute a piece of javascript.
- (void) enterPresentationMode; // Enter presentation mode in window.
- (void) exitPresentationMode; // Exit presentation mode in window.

@end

// A bookmarks folder that contains other bookmarks folder and bookmark items.
@interface GoogleChromeBookmarkFolder : SBObject

- (SBElementArray *) bookmarkFolders;
- (SBElementArray *) bookmarkItems;

- (NSNumber *) id; // Unique ID of the bookmark folder.
@property (copy) NSString *title; // The title of the folder.
@property (copy, readonly) NSNumber *index; // Returns the index with respect to its parent bookmark folder

- (void) saveIn:(NSURL *)in_ as:(NSString *)as; // Save an object.
- (void) close; // Close a window.
- (void) delete; // Delete an object.
- (SBObject *) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location.
- (SBObject *) moveTo:(SBObject *)to; // Move object(s) to a new location.
- (void) print; // Print an object.
- (void) reload; // Reload a tab.
- (void) goBack; // Go Back (If Possible).
- (void) goForward; // Go Forward (If Possible).
- (void) selectAll; // Select all.
- (void) cutSelection; // Cut selected text (If Possible).
- (void) copySelection; // Copy text.
- (void) pasteSelection; // Paste text (If Possible).
- (void) undo; // Undo the last change.
- (void) redo; // Redo the last change.
- (void) stop; // Stop the current tab from loading.
- (void) viewSource; // View the HTML source of the tab.
- (id) executeJavascript:(NSString *)javascript; // Execute a piece of javascript.
- (void) enterPresentationMode; // Enter presentation mode in window.
- (void) exitPresentationMode; // Exit presentation mode in window.

@end

// An item consists of an URL and the title of a bookmark
@interface GoogleChromeBookmarkItem : SBObject

- (NSInteger) id; // Unique ID of the bookmark item.
@property (copy) NSString *title; // The title of the bookmark item.
@property (copy) NSString *URL; // The URL of the bookmark.
@property (copy, readonly) NSNumber *index; // Returns the index with respect to its parent bookmark folder

- (void) saveIn:(NSURL *)in_ as:(NSString *)as; // Save an object.
- (void) close; // Close a window.
- (void) delete; // Delete an object.
- (SBObject *) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location.
- (SBObject *) moveTo:(SBObject *)to; // Move object(s) to a new location.
- (void) print; // Print an object.
- (void) reload; // Reload a tab.
- (void) goBack; // Go Back (If Possible).
- (void) goForward; // Go Forward (If Possible).
- (void) selectAll; // Select all.
- (void) cutSelection; // Cut selected text (If Possible).
- (void) copySelection; // Copy text.
- (void) pasteSelection; // Paste text (If Possible).
- (void) undo; // Undo the last change.
- (void) redo; // Redo the last change.
- (void) stop; // Stop the current tab from loading.
- (void) viewSource; // View the HTML source of the tab.
- (id) executeJavascript:(NSString *)javascript; // Execute a piece of javascript.
- (void) enterPresentationMode; // Enter presentation mode in window.
- (void) exitPresentationMode; // Exit presentation mode in window.

@end

@interface GoogleChromeWindow (ChromiumSuite)

@property (readonly) BOOL presenting; // Whether the window is in presentation mode.

@end

Loading