Skip to content
Newer
Older
100644 75 lines (58 sloc) 2.25 KB
99ca328 @rsms initial commit (and the thing actually works)
authored Aug 29, 2010
1 #import "KBrowser.h"
2 #import "KTabContents.h"
8a5aa62 @rsms One big-ass change set, including The Great speed improvement of high…
authored Nov 27, 2010
3 #import "KConfig.h"
99ca328 @rsms initial commit (and the thing actually works)
authored Aug 29, 2010
4 #import "KBrowserWindowController.h"
8a5aa62 @rsms One big-ass change set, including The Great speed improvement of high…
authored Nov 27, 2010
5 #import "KToolbarController.h"
613a2fd @rsms new tabs appear after the selected tab
authored Aug 29, 2010
6 #import <ChromiumTabs/common.h>
99ca328 @rsms initial commit (and the thing actually works)
authored Aug 29, 2010
7
8 @implementation KBrowser
9
effeea5 @rsms added higher level API for opening of documents. adjusted ui of futur…
authored Nov 30, 2010
10 - (void) dealloc {
11 // fix for a bug where tabs keep lingering after their browser has died
12 for (KTabContents *tab in self) {
13 tab.browser = nil;
14 }
15 [super dealloc];
16 }
17
18
19
99ca328 @rsms initial commit (and the thing actually works)
authored Aug 29, 2010
20 // This method is called when a new tab is being created. We need to return a
21 // new CTTabContents object which will represent the contents of the new tab.
8a5aa62 @rsms One big-ass change set, including The Great speed improvement of high…
authored Nov 27, 2010
22 - (CTTabContents*)createBlankTabBasedOn:(CTTabContents*)baseContents {
99ca328 @rsms initial commit (and the thing actually works)
authored Aug 29, 2010
23 // Create a new instance of our tab type
ccd705f @rsms misc progress
authored Oct 9, 2010
24 return [[[KTabContents alloc]
25 initWithBaseTabContents:baseContents] autorelease];
99ca328 @rsms initial commit (and the thing actually works)
authored Aug 29, 2010
26 }
27
8a5aa62 @rsms One big-ass change set, including The Great speed improvement of high…
authored Nov 27, 2010
28
29 - (CTToolbarController*)createToolbarController {
30 // subclasses could override this -- returning nil means no toolbar
31 return [[[KToolbarController alloc] initWithNibName:@"Toolbar"
32 bundle:KConfig.bundle
33 browser:self] autorelease];
34 }
99ca328 @rsms initial commit (and the thing actually works)
authored Aug 29, 2010
35
613a2fd @rsms new tabs appear after the selected tab
authored Aug 29, 2010
36
8a5aa62 @rsms One big-ass change set, including The Great speed improvement of high…
authored Nov 27, 2010
37 - (CTTabContents*)addTabContents:(CTTabContents*)tab
613a2fd @rsms new tabs appear after the selected tab
authored Aug 29, 2010
38 atIndex:(int)index
39 inForeground:(BOOL)foreground {
40 if (index == -1) {
41 // -1 means "append" -- we add it after the currently selected tab
42 index = [self selectedTabIndex] + 1;
43 }
44 return [super addTabContents:tab atIndex:index inForeground:foreground];
45 }
46
e473907 @rsms its a loooong way to go...
authored Aug 30, 2010
47
f63d81c @rsms finally fixed the "retardedly slow to [textView_ setString:text] bug …
authored Nov 30, 2010
48 /*-(void)updateTabStateForContent:(CTTabContents*)contents {
daae0ba @rsms work on opening files (local and remote) + many small fixes and changes
authored Nov 22, 2010
49 DLOG("updateTabStateForContent:%@", contents);
50 int index = tabStripModel_->GetIndexOfTabContents(contents);
51 DLOG_EXPR(index);
52 if (index != -1) {
53 tabStripModel_->UpdateTabContentsStateAt(index, CTTabChangeTypeAll);
54 }
f63d81c @rsms finally fixed the "retardedly slow to [textView_ setString:text] bug …
authored Nov 30, 2010
55 }*/
daae0ba @rsms work on opening files (local and remote) + many small fixes and changes
authored Nov 22, 2010
56
57
e473907 @rsms its a loooong way to go...
authored Aug 30, 2010
58 /*-(void)newWindow {
59 [isa openEmptyWindow];
60 }
61
62 -(void)closeWindow {
63 [self.window orderOut:self];
64 [self.window performClose:self]; // Autoreleases the controller.
65 }
66
67 case CTBrowserCommandNewWindow: [self newWindow]; break;
68 //case CTBrowserCommandNewIncognitoWindow: break;
69 case CTBrowserCommandCloseWindow: [self closeWindow]; break;
70 //case CTBrowserCommandAlwaysOnTop: break;
71 case CTBrowserCommandNewTab: [self addBlankTab]; break;
72 case CTBrowserCommandCloseTab: [self closeTab]; break;*/
73
99ca328 @rsms initial commit (and the thing actually works)
authored Aug 29, 2010
74 @end
Something went wrong with that request. Please try again.