OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "chrome/browser/ui/browser_commands.h" | 5 #include "chrome/browser/ui/browser_commands.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 ChromeTranslateClient::FromWebContents(web_contents); | 772 ChromeTranslateClient::FromWebContents(web_contents); |
773 | 773 |
774 translate::TranslateStep step = translate::TRANSLATE_STEP_BEFORE_TRANSLATE; | 774 translate::TranslateStep step = translate::TRANSLATE_STEP_BEFORE_TRANSLATE; |
775 if (chrome_translate_client) { | 775 if (chrome_translate_client) { |
776 if (chrome_translate_client->GetLanguageState().translation_pending()) | 776 if (chrome_translate_client->GetLanguageState().translation_pending()) |
777 step = translate::TRANSLATE_STEP_TRANSLATING; | 777 step = translate::TRANSLATE_STEP_TRANSLATING; |
778 else if (chrome_translate_client->GetLanguageState().IsPageTranslated()) | 778 else if (chrome_translate_client->GetLanguageState().IsPageTranslated()) |
779 step = translate::TRANSLATE_STEP_AFTER_TRANSLATE; | 779 step = translate::TRANSLATE_STEP_AFTER_TRANSLATE; |
780 } | 780 } |
781 browser->window()->ShowTranslateBubble( | 781 browser->window()->ShowTranslateBubble( |
782 web_contents, step, TranslateErrors::NONE); | 782 web_contents, step, translate::TranslateErrors::NONE); |
783 } | 783 } |
784 | 784 |
785 void ManagePasswordsForPage(Browser* browser) { | 785 void ManagePasswordsForPage(Browser* browser) { |
786 // TODO(mkwst): Implement this feature on Mac: http://crbug.com/261628 | 786 // TODO(mkwst): Implement this feature on Mac: http://crbug.com/261628 |
787 #if !defined(OS_MACOSX) | 787 #if !defined(OS_MACOSX) |
788 if (!browser->window()->IsActive()) | 788 if (!browser->window()->IsActive()) |
789 return; | 789 return; |
790 | 790 |
791 WebContents* web_contents = | 791 WebContents* web_contents = |
792 browser->tab_strip_model()->GetActiveWebContents(); | 792 browser->tab_strip_model()->GetActiveWebContents(); |
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1266 browser->profile(), | 1266 browser->profile(), |
1267 browser->host_desktop_type())); | 1267 browser->host_desktop_type())); |
1268 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1268 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
1269 | 1269 |
1270 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1270 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
1271 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1271 contents->GetRenderViewHost()->SyncRendererPrefs(); |
1272 app_browser->window()->Show(); | 1272 app_browser->window()->Show(); |
1273 } | 1273 } |
1274 | 1274 |
1275 } // namespace chrome | 1275 } // namespace chrome |
OLD | NEW |