Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: chrome/browser/ui/cocoa/infobars/before_translate_infobar_controller.mm

Issue 23338005: Mac InfoBar: Use cross platform infobar classes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/ui/cocoa/infobars/before_translate_infobar_controller.h " 5 #include "chrome/browser/ui/cocoa/infobars/before_translate_infobar_controller.h "
6 6
7 #include "base/strings/sys_string_conversions.h" 7 #include "base/strings/sys_string_conversions.h"
8 #import "chrome/browser/ui/cocoa/infobars/infobar_utilities.h" 8 #import "chrome/browser/ui/cocoa/infobars/infobar_utilities.h"
9 #include "grit/generated_resources.h" 9 #include "grit/generated_resources.h"
10 #include "ui/base/l10n/l10n_util.h" 10 #include "ui/base/l10n/l10n_util.h"
(...skipping 19 matching lines...) Expand all
30 } // namespace 30 } // namespace
31 31
32 @implementation BeforeTranslateInfobarController 32 @implementation BeforeTranslateInfobarController
33 33
34 - (void)dealloc { 34 - (void)dealloc {
35 [neverTranslateButton_ setTarget:nil]; 35 [neverTranslateButton_ setTarget:nil];
36 [alwaysTranslateButton_ setTarget:nil]; 36 [alwaysTranslateButton_ setTarget:nil];
37 [super dealloc]; 37 [super dealloc];
38 } 38 }
39 39
40 - (id)initWithDelegate:(InfoBarDelegate*)delegate 40 - (id)initWithInfoBar:(InfoBarCocoa*)infobar {
41 owner:(InfoBarService*)owner { 41 if ((self = [super initWithInfoBar:infobar])) {
42 if ((self = [super initWithDelegate:delegate owner:owner])) {
43 [self initializeExtraControls]; 42 [self initializeExtraControls];
44 } 43 }
45 return self; 44 return self;
46 } 45 }
47 46
48 - (void)initializeExtraControls { 47 - (void)initializeExtraControls {
49 TranslateInfoBarDelegate* delegate = [self delegate]; 48 TranslateInfoBarDelegate* delegate = [self delegate];
50 const string16& language = 49 const string16& language =
51 delegate->language_name_at(delegate->original_language_index()); 50 delegate->language_name_at(delegate->original_language_index());
52 neverTranslateButton_.reset( 51 neverTranslateButton_.reset(
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 @implementation BeforeTranslateInfobarController (TestingAPI) 129 @implementation BeforeTranslateInfobarController (TestingAPI)
131 130
132 - (NSButton*)alwaysTranslateButton { 131 - (NSButton*)alwaysTranslateButton {
133 return alwaysTranslateButton_.get(); 132 return alwaysTranslateButton_.get();
134 } 133 }
135 - (NSButton*)neverTranslateButton { 134 - (NSButton*)neverTranslateButton {
136 return neverTranslateButton_.get(); 135 return neverTranslateButton_.get();
137 } 136 }
138 137
139 @end 138 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698