Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef CRASHREPORTER_OSX_H__ |
michael@0 | 7 | #define CRASHREPORTER_OSX_H__ |
michael@0 | 8 | |
michael@0 | 9 | #include <Cocoa/Cocoa.h> |
michael@0 | 10 | #include "HTTPMultipartUpload.h" |
michael@0 | 11 | #include "crashreporter.h" |
michael@0 | 12 | |
michael@0 | 13 | // Defined below |
michael@0 | 14 | @class TextViewWithPlaceHolder; |
michael@0 | 15 | |
michael@0 | 16 | @interface CrashReporterUI : NSObject |
michael@0 | 17 | { |
michael@0 | 18 | IBOutlet NSWindow* mWindow; |
michael@0 | 19 | |
michael@0 | 20 | /* Crash reporter view */ |
michael@0 | 21 | IBOutlet NSTextField* mHeaderLabel; |
michael@0 | 22 | IBOutlet NSTextField* mDescriptionLabel; |
michael@0 | 23 | IBOutlet NSButton* mViewReportButton; |
michael@0 | 24 | IBOutlet NSScrollView* mCommentScrollView; |
michael@0 | 25 | IBOutlet TextViewWithPlaceHolder* mCommentText; |
michael@0 | 26 | IBOutlet NSButton* mSubmitReportButton; |
michael@0 | 27 | IBOutlet NSButton* mIncludeURLButton; |
michael@0 | 28 | IBOutlet NSButton* mEmailMeButton; |
michael@0 | 29 | IBOutlet NSTextField* mEmailText; |
michael@0 | 30 | IBOutlet NSButton* mCloseButton; |
michael@0 | 31 | IBOutlet NSButton* mRestartButton; |
michael@0 | 32 | IBOutlet NSProgressIndicator* mProgressIndicator; |
michael@0 | 33 | IBOutlet NSTextField* mProgressText; |
michael@0 | 34 | |
michael@0 | 35 | /* Error view */ |
michael@0 | 36 | IBOutlet NSView* mErrorView; |
michael@0 | 37 | IBOutlet NSTextField* mErrorHeaderLabel; |
michael@0 | 38 | IBOutlet NSTextField* mErrorLabel; |
michael@0 | 39 | IBOutlet NSButton* mErrorCloseButton; |
michael@0 | 40 | |
michael@0 | 41 | /* For "show info" alert */ |
michael@0 | 42 | IBOutlet NSWindow* mViewReportWindow; |
michael@0 | 43 | IBOutlet NSTextView* mViewReportTextView; |
michael@0 | 44 | IBOutlet NSButton* mViewReportOkButton; |
michael@0 | 45 | |
michael@0 | 46 | HTTPMultipartUpload* mPost; |
michael@0 | 47 | } |
michael@0 | 48 | |
michael@0 | 49 | - (void)showCrashUI:(const std::string&)dumpfile |
michael@0 | 50 | queryParameters:(const StringTable&)queryParameters |
michael@0 | 51 | sendURL:(const std::string&)sendURL; |
michael@0 | 52 | - (void)showErrorUI:(const std::string&)dumpfile; |
michael@0 | 53 | - (void)showReportInfo; |
michael@0 | 54 | - (void)maybeSubmitReport; |
michael@0 | 55 | - (void)closeMeDown:(id)unused; |
michael@0 | 56 | |
michael@0 | 57 | - (IBAction)submitReportClicked:(id)sender; |
michael@0 | 58 | - (IBAction)viewReportClicked:(id)sender; |
michael@0 | 59 | - (IBAction)viewReportOkClicked:(id)sender; |
michael@0 | 60 | - (IBAction)closeClicked:(id)sender; |
michael@0 | 61 | - (IBAction)restartClicked:(id)sender; |
michael@0 | 62 | - (IBAction)includeURLClicked:(id)sender; |
michael@0 | 63 | - (IBAction)emailMeClicked:(id)sender; |
michael@0 | 64 | |
michael@0 | 65 | - (void)controlTextDidChange:(NSNotification *)note; |
michael@0 | 66 | - (void)textDidChange:(NSNotification *)aNotification; |
michael@0 | 67 | - (BOOL)textView:(NSTextView *)aTextView shouldChangeTextInRange:(NSRange)affectedCharRange replacementString:(NSString *)replacementString; |
michael@0 | 68 | |
michael@0 | 69 | - (void)doInitialResizing; |
michael@0 | 70 | - (float)setStringFitVertically:(NSControl*)control |
michael@0 | 71 | string:(NSString*)str |
michael@0 | 72 | resizeWindow:(BOOL)resizeWindow; |
michael@0 | 73 | - (void)setView:(NSView*)v animate: (BOOL) animate; |
michael@0 | 74 | - (void)enableControls:(BOOL)enabled; |
michael@0 | 75 | - (void)updateSubmit; |
michael@0 | 76 | - (void)updateURL; |
michael@0 | 77 | - (void)updateEmail; |
michael@0 | 78 | - (void)sendReport; |
michael@0 | 79 | - (bool)setupPost; |
michael@0 | 80 | - (void)uploadThread:(HTTPMultipartUpload*)post; |
michael@0 | 81 | - (void)uploadComplete:(NSData*)data; |
michael@0 | 82 | |
michael@0 | 83 | -(BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)theApplication; |
michael@0 | 84 | -(void)applicationWillTerminate:(NSNotification *)aNotification; |
michael@0 | 85 | |
michael@0 | 86 | @end |
michael@0 | 87 | |
michael@0 | 88 | /* |
michael@0 | 89 | * Subclass NSTextView to provide a text view with placeholder text. |
michael@0 | 90 | * Also provide a setEnabled implementation. |
michael@0 | 91 | */ |
michael@0 | 92 | @interface TextViewWithPlaceHolder : NSTextView { |
michael@0 | 93 | NSMutableAttributedString *mPlaceHolderString; |
michael@0 | 94 | } |
michael@0 | 95 | |
michael@0 | 96 | - (BOOL)becomeFirstResponder; |
michael@0 | 97 | - (void)drawRect:(NSRect)rect; |
michael@0 | 98 | - (BOOL)resignFirstResponder; |
michael@0 | 99 | - (void)setPlaceholder:(NSString*)placeholder; |
michael@0 | 100 | - (void)insertTab:(id)sender; |
michael@0 | 101 | - (void)insertBacktab:(id)sender; |
michael@0 | 102 | - (void)setEnabled:(BOOL)enabled; |
michael@0 | 103 | - (void)dealloc; |
michael@0 | 104 | |
michael@0 | 105 | @end |
michael@0 | 106 | |
michael@0 | 107 | #endif |