OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 #include "chrome/browser/translate/chrome_translate_client.h" | 5 #include "chrome/browser/translate/chrome_translate_client.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 TranslateAcceptLanguages* ChromeTranslateClient::GetTranslateAcceptLanguages() { | 235 TranslateAcceptLanguages* ChromeTranslateClient::GetTranslateAcceptLanguages() { |
236 DCHECK(web_contents()); | 236 DCHECK(web_contents()); |
237 return GetTranslateAcceptLanguages(web_contents()->GetBrowserContext()); | 237 return GetTranslateAcceptLanguages(web_contents()->GetBrowserContext()); |
238 } | 238 } |
239 | 239 |
240 int ChromeTranslateClient::GetInfobarIconID() const { | 240 int ChromeTranslateClient::GetInfobarIconID() const { |
241 return IDR_INFOBAR_TRANSLATE; | 241 return IDR_INFOBAR_TRANSLATE; |
242 } | 242 } |
243 | 243 |
244 // ChromeTranslateClient::CreateInfoBar() is implemented in platform-specific | 244 // ChromeTranslateClient::CreateInfoBar() is implemented in platform-specific |
245 // files, except the TOOLKIT_VIEWS implementation, which has been removed. | 245 // files, except the TOOLKIT_VIEWS implementation, which has been removed. Note |
246 #if defined(TOOLKIT_VIEWS) | 246 // for Mac, Cocoa is still providing the infobar in a toolkit-views build. |
| 247 #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX) |
247 scoped_ptr<infobars::InfoBar> ChromeTranslateClient::CreateInfoBar( | 248 scoped_ptr<infobars::InfoBar> ChromeTranslateClient::CreateInfoBar( |
248 scoped_ptr<TranslateInfoBarDelegate> delegate) const { | 249 scoped_ptr<TranslateInfoBarDelegate> delegate) const { |
249 return scoped_ptr<infobars::InfoBar>(); | 250 return scoped_ptr<infobars::InfoBar>(); |
250 } | 251 } |
251 #endif | 252 #endif |
252 | 253 |
253 bool ChromeTranslateClient::IsTranslatableURL(const GURL& url) { | 254 bool ChromeTranslateClient::IsTranslatableURL(const GURL& url) { |
254 return TranslateService::IsTranslatableURL(url); | 255 return TranslateService::IsTranslatableURL(url); |
255 } | 256 } |
256 | 257 |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 if (GetLanguageState().InTranslateNavigation()) | 450 if (GetLanguageState().InTranslateNavigation()) |
450 return; | 451 return; |
451 } | 452 } |
452 | 453 |
453 TranslateBubbleFactory::Show( | 454 TranslateBubbleFactory::Show( |
454 browser->window(), web_contents(), step, error_type); | 455 browser->window(), web_contents(), step, error_type); |
455 #else | 456 #else |
456 NOTREACHED(); | 457 NOTREACHED(); |
457 #endif | 458 #endif |
458 } | 459 } |
OLD | NEW |