diff options
author | kuan@chromium.org <kuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-29 16:41:53 +0000 |
---|---|---|
committer | kuan@chromium.org <kuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-29 16:41:53 +0000 |
commit | 8db841ac0528a7eba71e89260526da9ba33dbb54 (patch) | |
tree | 79501d52aa828b2bbaf87e91064f978851d702d2 /chrome/browser/translate/translate_manager.h | |
parent | 89e29d25efa776ed1f564e576d764fd3e9ddecfc (diff) | |
download | chromium_src-8db841ac0528a7eba71e89260526da9ba33dbb54.zip chromium_src-8db841ac0528a7eba71e89260526da9ba33dbb54.tar.gz chromium_src-8db841ac0528a7eba71e89260526da9ba33dbb54.tar.bz2 |
implement error state for translate infobar
- this cl implements the UI on Windows and the partial backend of IPC messaging to include error type
- implement error state
- add translate error types
- use a structure as details for IPC messaging between render view and browser so as to include error type (was using std::pair)
- translate delegate handles error state and provides mapping to error messages
- infobar handles visual error states
- modify background painting to handle normal and error backgrounds, and animation of cross-fading between the 2 backgrounds
- infobar now stores state (and translation_pending flag) that it's currently displaying to user, instead of just relying on TransateInfoBarDelegate's
- if infobar receives PAGE_TRANSLAED notification before delegate does (possible because order is not fixed), delegate's state won't be updated to be used by infobar.
- after all the observers have received the notification, both infobar and delegate will end up with matching states, so there's no worries of out-of-sync.
- update unittests accordingly
- update mac and linux code accordingly to make build pass
- jay will implement the remaining backend to pass actual translate error types to the IPC message (tracked by bug 37778)
BUG=38548
TEST=none yet, until bug 37778 is also fixed.
Review URL: http://codereview.chromium.org/1321003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42953 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/translate/translate_manager.h')
-rw-r--r-- | chrome/browser/translate/translate_manager.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/chrome/browser/translate/translate_manager.h b/chrome/browser/translate/translate_manager.h index fed522d..cf0e452 100644 --- a/chrome/browser/translate/translate_manager.h +++ b/chrome/browser/translate/translate_manager.h @@ -14,6 +14,7 @@ #include "chrome/browser/translate/translate_infobars_delegates.h" #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" +#include "chrome/common/translate_errors.h" class GURL; class PrefService; @@ -74,7 +75,8 @@ class TranslateManager : public NotificationObserver { TranslateInfoBarDelegate::TranslateState state, const GURL& url, const std::string& original_language, - const std::string& target_language); + const std::string& target_language, + TranslateErrors::Type error_type); // Returns the language to translate to, which is the language the UI is // configured in. Returns an empty string if that language is not supported |