Chromium Code Reviews| 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_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 44 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 44 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
| 45 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 45 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
| 46 #include "chrome/browser/ui/location_bar/location_bar.h" | 46 #include "chrome/browser/ui/location_bar/location_bar.h" |
| 47 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" | 47 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" |
| 48 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 48 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
| 49 #include "chrome/browser/ui/search/search_tab_helper.h" | 49 #include "chrome/browser/ui/search/search_tab_helper.h" |
| 50 #include "chrome/browser/ui/status_bubble.h" | 50 #include "chrome/browser/ui/status_bubble.h" |
| 51 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" | 51 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
| 52 #include "chrome/browser/ui/tab_dialogs.h" | 52 #include "chrome/browser/ui/tab_dialogs.h" |
| 53 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 53 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 54 #include "chrome/browser/ui/translate/translate_bubble_view_state_transition.h" | |
| 54 #include "chrome/browser/upgrade_detector.h" | 55 #include "chrome/browser/upgrade_detector.h" |
| 55 #include "chrome/common/content_restriction.h" | 56 #include "chrome/common/content_restriction.h" |
| 56 #include "chrome/common/features.h" | 57 #include "chrome/common/features.h" |
| 57 #include "chrome/common/pref_names.h" | 58 #include "chrome/common/pref_names.h" |
| 58 #include "components/bookmarks/browser/bookmark_model.h" | 59 #include "components/bookmarks/browser/bookmark_model.h" |
| 59 #include "components/bookmarks/browser/bookmark_utils.h" | 60 #include "components/bookmarks/browser/bookmark_utils.h" |
| 60 #include "components/bookmarks/common/bookmark_pref_names.h" | 61 #include "components/bookmarks/common/bookmark_pref_names.h" |
| 61 #include "components/favicon/content/content_favicon_driver.h" | 62 #include "components/favicon/content/content_favicon_driver.h" |
| 62 #include "components/google/core/browser/google_util.h" | 63 #include "components/google/core/browser/google_util.h" |
| 63 #include "components/prefs/pref_service.h" | 64 #include "components/prefs/pref_service.h" |
| (...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 820 ChromeTranslateClient* chrome_translate_client = | 821 ChromeTranslateClient* chrome_translate_client = |
| 821 ChromeTranslateClient::FromWebContents(web_contents); | 822 ChromeTranslateClient::FromWebContents(web_contents); |
| 822 | 823 |
| 823 translate::TranslateStep step = translate::TRANSLATE_STEP_BEFORE_TRANSLATE; | 824 translate::TranslateStep step = translate::TRANSLATE_STEP_BEFORE_TRANSLATE; |
| 824 if (chrome_translate_client) { | 825 if (chrome_translate_client) { |
| 825 if (chrome_translate_client->GetLanguageState().translation_pending()) | 826 if (chrome_translate_client->GetLanguageState().translation_pending()) |
| 826 step = translate::TRANSLATE_STEP_TRANSLATING; | 827 step = translate::TRANSLATE_STEP_TRANSLATING; |
| 827 else if (chrome_translate_client->GetLanguageState().IsPageTranslated()) | 828 else if (chrome_translate_client->GetLanguageState().IsPageTranslated()) |
| 828 step = translate::TRANSLATE_STEP_AFTER_TRANSLATE; | 829 step = translate::TRANSLATE_STEP_AFTER_TRANSLATE; |
| 829 } | 830 } |
| 830 browser->window()->ShowTranslateBubble( | 831 ShowTranslateBubbleResult result = browser->window()->ShowTranslateBubble( |
| 831 web_contents, step, translate::TranslateErrors::NONE, true); | 832 web_contents, step, translate::TranslateErrors::NONE, true); |
| 833 if (result != ShowTranslateBubbleResult::SUCCESS) { | |
|
sky
2016/11/11 19:07:40
no {}
Roger McFarlane (Chromium)
2016/11/11 19:55:09
Done.
| |
| 834 translate::ReportUiAction(translate::BUBBLE_REQUESTED_BUT_NOT_SHOWN); | |
|
sky
2016/11/11 19:07:40
How come you don't pass through result here?
Roger McFarlane (Chromium)
2016/11/11 19:55:09
Done.
This required expanding the translate::Tran
| |
| 835 } | |
| 832 } | 836 } |
| 833 | 837 |
| 834 void ManagePasswordsForPage(Browser* browser) { | 838 void ManagePasswordsForPage(Browser* browser) { |
| 835 WebContents* web_contents = | 839 WebContents* web_contents = |
| 836 browser->tab_strip_model()->GetActiveWebContents(); | 840 browser->tab_strip_model()->GetActiveWebContents(); |
| 837 ManagePasswordsUIController* controller = | 841 ManagePasswordsUIController* controller = |
| 838 ManagePasswordsUIController::FromWebContents(web_contents); | 842 ManagePasswordsUIController::FromWebContents(web_contents); |
| 839 TabDialogs::FromWebContents(web_contents)->ShowManagePasswordsBubble( | 843 TabDialogs::FromWebContents(web_contents)->ShowManagePasswordsBubble( |
| 840 !controller->IsAutomaticallyOpeningBubble()); | 844 !controller->IsAutomaticallyOpeningBubble()); |
| 841 } | 845 } |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1298 app_name, true /* trusted_source */, gfx::Rect(), browser->profile())); | 1302 app_name, true /* trusted_source */, gfx::Rect(), browser->profile())); |
| 1299 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1303 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
| 1300 | 1304 |
| 1301 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1305 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
| 1302 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1306 contents->GetRenderViewHost()->SyncRendererPrefs(); |
| 1303 app_browser->window()->Show(); | 1307 app_browser->window()->Show(); |
| 1304 } | 1308 } |
| 1305 #endif // defined(ENABLE_EXTENSIONS) | 1309 #endif // defined(ENABLE_EXTENSIONS) |
| 1306 | 1310 |
| 1307 } // namespace chrome | 1311 } // namespace chrome |
| OLD | NEW |