| OLD | NEW |
| 1 // Copyright (c) 2011 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 <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 #include <stddef.h> | 6 #include <stddef.h> |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #import "base/mac/scoped_nsobject.h" | 10 #import "base/mac/scoped_nsobject.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 : public translate::TranslateInfoBarDelegate { | 43 : public translate::TranslateInfoBarDelegate { |
| 44 public: | 44 public: |
| 45 MockTranslateInfoBarDelegate(content::WebContents* web_contents, | 45 MockTranslateInfoBarDelegate(content::WebContents* web_contents, |
| 46 translate::TranslateStep step, | 46 translate::TranslateStep step, |
| 47 translate::TranslateErrors::Type error) | 47 translate::TranslateErrors::Type error) |
| 48 : translate::TranslateInfoBarDelegate( | 48 : translate::TranslateInfoBarDelegate( |
| 49 ChromeTranslateClient::GetManagerFromWebContents(web_contents) | 49 ChromeTranslateClient::GetManagerFromWebContents(web_contents) |
| 50 ->GetWeakPtr(), | 50 ->GetWeakPtr(), |
| 51 false, | 51 false, |
| 52 step, | 52 step, |
| 53 NULL, | |
| 54 "en", | 53 "en", |
| 55 "es", | 54 "es", |
| 56 error, | 55 error, |
| 57 false) {} | 56 false) {} |
| 58 | 57 |
| 59 MOCK_METHOD0(Translate, void()); | 58 MOCK_METHOD0(Translate, void()); |
| 60 MOCK_METHOD0(RevertTranslation, void()); | 59 MOCK_METHOD0(RevertTranslation, void()); |
| 61 | 60 |
| 62 MOCK_METHOD0(TranslationDeclined, void()); | 61 MOCK_METHOD0(TranslationDeclined, void()); |
| 63 | 62 |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 translate_prefs->ResetTranslationDeniedCount("en"); | 269 translate_prefs->ResetTranslationDeniedCount("en"); |
| 271 for (int i = 0; i < 4; ++i) { | 270 for (int i = 0; i < 4; ++i) { |
| 272 translate_prefs->IncrementTranslationDeniedCount("en"); | 271 translate_prefs->IncrementTranslationDeniedCount("en"); |
| 273 } | 272 } |
| 274 CreateInfoBar(translate::TRANSLATE_STEP_BEFORE_TRANSLATE); | 273 CreateInfoBar(translate::TRANSLATE_STEP_BEFORE_TRANSLATE); |
| 275 BeforeTranslateInfobarController* controller = | 274 BeforeTranslateInfobarController* controller = |
| 276 (BeforeTranslateInfobarController*)infobar_controller_.get(); | 275 (BeforeTranslateInfobarController*)infobar_controller_.get(); |
| 277 EXPECT_TRUE([[controller alwaysTranslateButton] superview] == nil); | 276 EXPECT_TRUE([[controller alwaysTranslateButton] superview] == nil); |
| 278 EXPECT_TRUE([[controller neverTranslateButton] superview] != nil); | 277 EXPECT_TRUE([[controller neverTranslateButton] superview] != nil); |
| 279 } | 278 } |
| OLD | NEW |