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 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 ChromeTranslateClient::FromWebContents(web_contents); | 777 ChromeTranslateClient::FromWebContents(web_contents); |
778 | 778 |
779 translate::TranslateStep step = translate::TRANSLATE_STEP_BEFORE_TRANSLATE; | 779 translate::TranslateStep step = translate::TRANSLATE_STEP_BEFORE_TRANSLATE; |
780 if (chrome_translate_client) { | 780 if (chrome_translate_client) { |
781 if (chrome_translate_client->GetLanguageState().translation_pending()) | 781 if (chrome_translate_client->GetLanguageState().translation_pending()) |
782 step = translate::TRANSLATE_STEP_TRANSLATING; | 782 step = translate::TRANSLATE_STEP_TRANSLATING; |
783 else if (chrome_translate_client->GetLanguageState().IsPageTranslated()) | 783 else if (chrome_translate_client->GetLanguageState().IsPageTranslated()) |
784 step = translate::TRANSLATE_STEP_AFTER_TRANSLATE; | 784 step = translate::TRANSLATE_STEP_AFTER_TRANSLATE; |
785 } | 785 } |
786 browser->window()->ShowTranslateBubble( | 786 browser->window()->ShowTranslateBubble( |
787 web_contents, step, TranslateErrors::NONE); | 787 web_contents, step, translate::TranslateErrors::NONE); |
788 } | 788 } |
789 | 789 |
790 void ManagePasswordsForPage(Browser* browser) { | 790 void ManagePasswordsForPage(Browser* browser) { |
791 // TODO(mkwst): Implement this feature on Mac: http://crbug.com/261628 | 791 // TODO(mkwst): Implement this feature on Mac: http://crbug.com/261628 |
792 #if !defined(OS_MACOSX) | 792 #if !defined(OS_MACOSX) |
793 if (!browser->window()->IsActive()) | 793 if (!browser->window()->IsActive()) |
794 return; | 794 return; |
795 | 795 |
796 WebContents* web_contents = | 796 WebContents* web_contents = |
797 browser->tab_strip_model()->GetActiveWebContents(); | 797 browser->tab_strip_model()->GetActiveWebContents(); |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1286 browser->profile(), | 1286 browser->profile(), |
1287 browser->host_desktop_type())); | 1287 browser->host_desktop_type())); |
1288 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1288 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
1289 | 1289 |
1290 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1290 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
1291 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1291 contents->GetRenderViewHost()->SyncRendererPrefs(); |
1292 app_browser->window()->Show(); | 1292 app_browser->window()->Show(); |
1293 } | 1293 } |
1294 | 1294 |
1295 } // namespace chrome | 1295 } // namespace chrome |
OLD | NEW |