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

Side by Side Diff: chrome/browser/translate/translate_infobar_delegate.h

Issue 7589002: Fix a crash in the translate info bar. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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) 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 #ifndef CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_
6 #define CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_ 6 #define CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 21 matching lines...) Expand all
32 NONE, 32 NONE,
33 NORMAL_TO_ERROR, 33 NORMAL_TO_ERROR,
34 ERROR_TO_NORMAL 34 ERROR_TO_NORMAL
35 }; 35 };
36 36
37 static const size_t kNoIndex; 37 static const size_t kNoIndex;
38 38
39 // Factory method to create a non-error translate infobar. 39 // Factory method to create a non-error translate infobar.
40 // The original and target language specified are the ASCII language codes 40 // The original and target language specified are the ASCII language codes
41 // (ex: en, fr...). 41 // (ex: en, fr...).
42 // Returns NULL if it failed, typically if |original_language| or 42 // CHECK if |original_language| or |target_language| is not a supported
43 // |target_language| is not a supported language. 43 // language, though |original_language| can be unknown if type is TRANSLATING.
44 static TranslateInfoBarDelegate* CreateDelegate( 44 static TranslateInfoBarDelegate* CreateDelegate(
45 Type infobar_type, 45 Type infobar_type,
46 TabContents* tab_contents, 46 TabContents* tab_contents,
47 const std::string& original_language, 47 const std::string& original_language,
48 const std::string& target_language); 48 const std::string& target_language);
49 49
50 // Factory method to create an error translate infobar. 50 // Factory method to create an error translate infobar.
51 static TranslateInfoBarDelegate* CreateErrorDelegate( 51 static TranslateInfoBarDelegate* CreateErrorDelegate(
52 TranslateErrors::Type error_type, 52 TranslateErrors::Type error_type,
53 TabContents* tab_contents, 53 TabContents* tab_contents,
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 // The current infobar view. 203 // The current infobar view.
204 TranslateInfoBarView* infobar_view_; 204 TranslateInfoBarView* infobar_view_;
205 205
206 // The translation related preferences. 206 // The translation related preferences.
207 TranslatePrefs prefs_; 207 TranslatePrefs prefs_;
208 208
209 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate); 209 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate);
210 }; 210 };
211 211
212 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_ 212 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_INFOBAR_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698