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

Side by Side Diff: components/translate/content/browser/content_translate_driver.h

Issue 133273029: Move LanguageState to the translate component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix more compile issues Created 6 years, 11 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
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_TRANSLATE_CONTENT_BROWSER_CONTENT_TRANSLATE_DRIVER_H_
6 #define COMPONENTS_TRANSLATE_CONTENT_BROWSER_CONTENT_TRANSLATE_DRIVER_H_
7
8 #include "components/translate/core/browser/translate_driver.h"
9
10 #include "components/translate/core/browser/language_state.h"
11
12 namespace content {
13 struct LoadCommittedDetails;
14 class NavigationController;
15 }
16
17 class LanguageStateObserver;
18
19 // Content implementation of TranslateDriver.
20 class ContentTranslateDriver : public TranslateDriver {
21 public:
22 ContentTranslateDriver(content::NavigationController* nav_controller);
23 virtual ~ContentTranslateDriver();
24
25 // Gets the language state.
26 LanguageState& GetLanguageState();
MAD 2014/01/20 16:12:25 As per Chromium Coding Style: Simple accessors sho
27
28 // Sets the LanguageStateObserver. Calling this method is optional.
29 void SetLanguageStateObserver(LanguageStateObserver* observer);
30
31 // Must be called on navigations.
32 void DidNavigate(const content::LoadCommittedDetails& details);
33
34 private:
35 // TranslateDriver methods
36 virtual void OnIsPageTranslatedChanged() OVERRIDE;
37 virtual void OnTranslateEnabledChanged() OVERRIDE;
38 virtual bool IsLinkNavigation() OVERRIDE;
39
40 // The navigation controller of the tab we are associated with.
41 content::NavigationController* navigation_controller_;
42
43 LanguageState language_state_;
44 LanguageStateObserver* language_state_observer_;
45
46 DISALLOW_COPY_AND_ASSIGN(ContentTranslateDriver);
47 };
48
49 #endif // COMPONENTS_TRANSLATE_CONTENT_BROWSER_CONTENT_TRANSLATE_DRIVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698