Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / applescript / tab_applescript.h
blob17b72504b8cd2c8655c321b29c8be8a602c44ffb
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_COCOA_APPLESCRIPT_TAB_APPLESCRIPT_H_
6 #define CHROME_BROWSER_UI_COCOA_APPLESCRIPT_TAB_APPLESCRIPT_H_
8 #import <Cocoa/Cocoa.h>
10 #import "chrome/browser/ui/cocoa/applescript/element_applescript.h"
12 namespace content {
13 class WebContents;
16 // Represents a tab scriptable item in applescript.
17 @interface TabAppleScript : ElementAppleScript {
18 @private
19 content::WebContents* webContents_; // weak.
20 // Contains the temporary URL when a user creates a new folder/item with
21 // url specified like
22 // |make new tab with properties {url:"http://google.com"}|.
23 NSString* tempURL_;
26 // Doesn't actually create the tab here but just assigns the ID, tab is created
27 // when it calls insertInTabs: of a particular window, it is used in cases
28 // where user assigns a tab to a variable like |set var to make new tab|.
29 - (id)init;
31 // Does not create a new tab but uses an existing one.
32 - (id)initWithWebContents:(content::WebContents*)webContents;
34 // Assigns a tab, sets its unique ID and also copies temporary values.
35 - (void)setWebContents:(content::WebContents*)webContents;
37 // Return the URL currently visible to the user in the location bar.
38 - (NSString*)URL;
40 // Sets the URL, returns an error if it is invalid.
41 - (void)setURL:(NSString*)aURL;
43 // The title of the tab.
44 - (NSString*)title;
46 // Is the tab loading any resource?
47 - (NSNumber*)loading;
49 // Standard user commands.
50 - (void)handlesUndoScriptCommand:(NSScriptCommand*)command;
51 - (void)handlesRedoScriptCommand:(NSScriptCommand*)command;
53 // Edit operations on the page.
54 - (void)handlesCutScriptCommand:(NSScriptCommand*)command;
55 - (void)handlesCopyScriptCommand:(NSScriptCommand*)command;
56 - (void)handlesPasteScriptCommand:(NSScriptCommand*)command;
58 // Selects all contents on the page.
59 - (void)handlesSelectAllScriptCommand:(NSScriptCommand*)command;
61 // Navigation operations.
62 - (void)handlesGoBackScriptCommand:(NSScriptCommand*)command;
63 - (void)handlesGoForwardScriptCommand:(NSScriptCommand*)command;
64 - (void)handlesReloadScriptCommand:(NSScriptCommand*)command;
65 - (void)handlesStopScriptCommand:(NSScriptCommand*)command;
67 // Used to print a tab.
68 - (void)handlesPrintScriptCommand:(NSScriptCommand*)command;
70 // Used to save a tab, if no file is specified, prompts the user to enter it.
71 - (void)handlesSaveScriptCommand:(NSScriptCommand*)command;
73 // Used to close a tab.
74 - (void)handlesCloseScriptCommand:(NSScriptCommand*)command;
76 // Displays the HTML of the tab in a new tab.
77 - (void)handlesViewSourceScriptCommand:(NSScriptCommand*)command;
79 // Executes a piece of javascript in the tab.
80 - (id)handlesExecuteJavascriptScriptCommand:(NSScriptCommand*)command;
82 @end
84 #endif // CHROME_BROWSER_UI_COCOA_APPLESCRIPT_TAB_APPLESCRIPT_H_