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

Side by Side Diff: chrome/browser/tab_contents/language_state.h

Issue 14392011: [Translate] Expose whether the user is within a navigation session as part of the infobar delegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/tab_contents/language_state.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_TAB_CONTENTS_LANGUAGE_STATE_H_ 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_LANGUAGE_STATE_H_
6 #define CHROME_BROWSER_TAB_CONTENTS_LANGUAGE_STATE_H_ 6 #define CHROME_BROWSER_TAB_CONTENTS_LANGUAGE_STATE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 26 matching lines...) Expand all
37 // to translate the page. 37 // to translate the page.
38 void LanguageDetermined(const std::string& page_language, 38 void LanguageDetermined(const std::string& page_language,
39 bool page_translatable); 39 bool page_translatable);
40 40
41 // Returns the language the current page should be translated to, based on the 41 // Returns the language the current page should be translated to, based on the
42 // previous page languages and the transition. This should be called after 42 // previous page languages and the transition. This should be called after
43 // the language page has been determined. 43 // the language page has been determined.
44 // Returns an empty string if the page should not be auto-translated. 44 // Returns an empty string if the page should not be auto-translated.
45 std::string AutoTranslateTo() const; 45 std::string AutoTranslateTo() const;
46 46
47 // Returns true if the user is navigating through translated links.
48 bool InTranslateNavigation() const;
49
47 // Returns true if the current page in the associated tab has been translated. 50 // Returns true if the current page in the associated tab has been translated.
48 bool IsPageTranslated() const { return original_lang_ != current_lang_; } 51 bool IsPageTranslated() const { return original_lang_ != current_lang_; }
49 52
50 const std::string& original_language() const { return original_lang_; } 53 const std::string& original_language() const { return original_lang_; }
51 54
52 void set_current_language(const std::string& language) { 55 void set_current_language(const std::string& language) {
53 current_lang_ = language; 56 current_lang_ = language;
54 } 57 }
55 const std::string& current_language() const { return current_lang_; } 58 const std::string& current_language() const { return current_lang_; }
56 59
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 // load happens in the page after the user closed the infobar. 106 // load happens in the page after the user closed the infobar.
104 bool translation_declined_; 107 bool translation_declined_;
105 108
106 // Whether the current navigation is a fragment navigation (in page). 109 // Whether the current navigation is a fragment navigation (in page).
107 bool in_page_navigation_; 110 bool in_page_navigation_;
108 111
109 DISALLOW_COPY_AND_ASSIGN(LanguageState); 112 DISALLOW_COPY_AND_ASSIGN(LanguageState);
110 }; 113 };
111 114
112 #endif // CHROME_BROWSER_TAB_CONTENTS_LANGUAGE_STATE_H_ 115 #endif // CHROME_BROWSER_TAB_CONTENTS_LANGUAGE_STATE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/tab_contents/language_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698