| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "chrome/browser/ui/cocoa/bug_report_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/bug_report_window_controller.h" |
| 6 | 6 |
| 7 #include "base/mac/mac_util.h" | 7 #include "base/mac/mac_util.h" |
| 8 #include "base/sys_string_conversions.h" | 8 #include "base/sys_string_conversions.h" |
| 9 #include "chrome/browser/bug_report_util.h" | 9 #include "chrome/browser/bug_report_util.h" |
| 10 #include "chrome/browser/tab_contents/tab_contents.h" | 10 #include "chrome/browser/tab_contents/tab_contents.h" |
| 11 #include "chrome/browser/tab_contents/tab_contents_view.h" | 11 #include "chrome/browser/tab_contents/tab_contents_view.h" |
| 12 #include "chrome/browser/ui/window_snapshot/window_snapshot.h" |
| 12 #include "grit/chromium_strings.h" | 13 #include "grit/chromium_strings.h" |
| 13 #include "grit/generated_resources.h" | 14 #include "grit/generated_resources.h" |
| 14 #include "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" | 15 #include "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" |
| 15 #include "ui/base/l10n/l10n_util_mac.h" | 16 #include "ui/base/l10n/l10n_util_mac.h" |
| 16 | 17 |
| 17 @implementation BugReportWindowController | 18 @implementation BugReportWindowController |
| 18 | 19 |
| 19 @synthesize bugDescription = bugDescription_; | 20 @synthesize bugDescription = bugDescription_; |
| 20 @synthesize bugTypeIndex = bugTypeIndex_; | 21 @synthesize bugTypeIndex = bugTypeIndex_; |
| 21 @synthesize pageURL = pageURL_; | 22 @synthesize pageURL = pageURL_; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 l10n_util::GetNSStringWithFixup(IDS_BUGREPORT_PAGE_WONT_LOAD), | 56 l10n_util::GetNSStringWithFixup(IDS_BUGREPORT_PAGE_WONT_LOAD), |
| 56 l10n_util::GetNSStringWithFixup(IDS_BUGREPORT_PAGE_LOOKS_ODD), | 57 l10n_util::GetNSStringWithFixup(IDS_BUGREPORT_PAGE_LOOKS_ODD), |
| 57 l10n_util::GetNSStringWithFixup(IDS_BUGREPORT_PHISHING_PAGE), | 58 l10n_util::GetNSStringWithFixup(IDS_BUGREPORT_PHISHING_PAGE), |
| 58 l10n_util::GetNSStringWithFixup(IDS_BUGREPORT_CANT_SIGN_IN), | 59 l10n_util::GetNSStringWithFixup(IDS_BUGREPORT_CANT_SIGN_IN), |
| 59 nil] | 60 nil] |
| 60 atIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, 4)]]; | 61 atIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, 4)]]; |
| 61 | 62 |
| 62 [self setPageURL:base::SysUTF8ToNSString( | 63 [self setPageURL:base::SysUTF8ToNSString( |
| 63 currentTab_->controller().GetActiveEntry()->url().spec())]; | 64 currentTab_->controller().GetActiveEntry()->url().spec())]; |
| 64 [self setPageTitle:base::SysUTF16ToNSString(currentTab_->GetTitle())]; | 65 [self setPageTitle:base::SysUTF16ToNSString(currentTab_->GetTitle())]; |
| 65 base::mac::GrabWindowSnapshot( | 66 browser::GrabWindowSnapshot( |
| 66 currentTab_->view()->GetTopLevelNativeWindow(), &pngData_, | 67 currentTab_->view()->GetTopLevelNativeWindow(), &pngData_, |
| 67 &pngWidth_, &pngHeight_); | 68 &pngWidth_, &pngHeight_); |
| 68 } else { | 69 } else { |
| 69 // If no current tab exists, create a menu without the "broken page" | 70 // If no current tab exists, create a menu without the "broken page" |
| 70 // options, with page URL and title empty, and screenshot disabled. | 71 // options, with page URL and title empty, and screenshot disabled. |
| 71 [self setSendScreenshot:NO]; | 72 [self setSendScreenshot:NO]; |
| 72 [self setDisableScreenshotCheckbox:YES]; | 73 [self setDisableScreenshotCheckbox:YES]; |
| 73 } | 74 } |
| 74 | 75 |
| 75 pngHeight_ = 0; | 76 pngHeight_ = 0; |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 + (NSSet*)keyPathsForValuesAffectingValueForKey:(NSString*)key { | 222 + (NSSet*)keyPathsForValuesAffectingValueForKey:(NSString*)key { |
| 222 NSSet* paths = [super keyPathsForValuesAffectingValueForKey:key]; | 223 NSSet* paths = [super keyPathsForValuesAffectingValueForKey:key]; |
| 223 if ([key isEqualToString:@"isPhishingReport"]) { | 224 if ([key isEqualToString:@"isPhishingReport"]) { |
| 224 paths = [paths setByAddingObject:@"bugTypeIndex"]; | 225 paths = [paths setByAddingObject:@"bugTypeIndex"]; |
| 225 } | 226 } |
| 226 return paths; | 227 return paths; |
| 227 } | 228 } |
| 228 | 229 |
| 229 @end | 230 @end |
| 230 | 231 |
| OLD | NEW |