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

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

Issue 25373009: Translate: New Bubble UX (for the view toolkit) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bug fix: view id on tests Created 7 years, 1 month 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
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 #ifndef CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_ 5 #ifndef CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_
6 #define CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_ 6 #define CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/gtest_prod_util.h" 12 #include "base/gtest_prod_util.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/observer_list.h" 15 #include "base/observer_list.h"
16 #include "base/time/time.h" 16 #include "base/time/time.h"
17 #include "chrome/browser/ui/translate/translate_bubble_model.h"
17 #include "chrome/common/translate/translate_errors.h" 18 #include "chrome/common/translate/translate_errors.h"
18 #include "content/public/browser/notification_observer.h" 19 #include "content/public/browser/notification_observer.h"
19 #include "content/public/browser/notification_registrar.h" 20 #include "content/public/browser/notification_registrar.h"
20 21
21 template <typename T> struct DefaultSingletonTraits; 22 template <typename T> struct DefaultSingletonTraits;
22 class GURL; 23 class GURL;
23 struct LanguageDetectionDetails; 24 struct LanguageDetectionDetails;
24 struct PageTranslatedDetails; 25 struct PageTranslatedDetails;
25 class PrefService; 26 class PrefService;
26 class Profile; 27 class Profile;
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 PageTranslatedDetails* details); 185 PageTranslatedDetails* details);
185 186
186 void OnTranslateScriptFetchComplete(bool success, const std::string& data); 187 void OnTranslateScriptFetchComplete(bool success, const std::string& data);
187 188
188 // Notifies to the observers when a language is detected. 189 // Notifies to the observers when a language is detected.
189 void NotifyLanguageDetection(const LanguageDetectionDetails& details); 190 void NotifyLanguageDetection(const LanguageDetectionDetails& details);
190 191
191 // Notifies to the observers when translate failed. 192 // Notifies to the observers when translate failed.
192 void NotifyTranslateError(const TranslateErrorDetails& details); 193 void NotifyTranslateError(const TranslateErrorDetails& details);
193 194
195 // Shows the translate bubble.
196 void ShowBubble(content::WebContents* web_contents,
197 TranslateBubbleModel::ViewState view_state);
198
194 // Returns the different parameters used to decide whether extra shortcuts 199 // Returns the different parameters used to decide whether extra shortcuts
195 // are needed. 200 // are needed.
196 static ShortcutConfiguration ShortcutConfig(); 201 static ShortcutConfiguration ShortcutConfig();
197 202
198 content::NotificationRegistrar notification_registrar_; 203 content::NotificationRegistrar notification_registrar_;
199 204
200 // Max number of attempts before checking if a page has been reloaded. 205 // Max number of attempts before checking if a page has been reloaded.
201 int max_reload_check_attempts_; 206 int max_reload_check_attempts_;
202 207
203 // The list of pending translate requests. Translate requests are queued when 208 // The list of pending translate requests. Translate requests are queued when
(...skipping 14 matching lines...) Expand all
218 // An instance of TranslateAcceptLanguages which manages Accept languages of 223 // An instance of TranslateAcceptLanguages which manages Accept languages of
219 // each profiles. 224 // each profiles.
220 scoped_ptr<TranslateAcceptLanguages> accept_languages_; 225 scoped_ptr<TranslateAcceptLanguages> accept_languages_;
221 226
222 base::WeakPtrFactory<TranslateManager> weak_method_factory_; 227 base::WeakPtrFactory<TranslateManager> weak_method_factory_;
223 228
224 DISALLOW_COPY_AND_ASSIGN(TranslateManager); 229 DISALLOW_COPY_AND_ASSIGN(TranslateManager);
225 }; 230 };
226 231
227 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_ 232 #endif // CHROME_BROWSER_TRANSLATE_TRANSLATE_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/translate/page_translated_details.h ('k') | chrome/browser/translate/translate_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698