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/views/frame/browser_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1205 is_user_gesture); | 1205 is_user_gesture); |
| 1206 } | 1206 } |
| 1207 | 1207 |
| 1208 ShowTranslateBubbleResult BrowserView::ShowTranslateBubble( | 1208 ShowTranslateBubbleResult BrowserView::ShowTranslateBubble( |
| 1209 content::WebContents* web_contents, | 1209 content::WebContents* web_contents, |
| 1210 translate::TranslateStep step, | 1210 translate::TranslateStep step, |
| 1211 translate::TranslateErrors::Type error_type, | 1211 translate::TranslateErrors::Type error_type, |
| 1212 bool is_user_gesture) { | 1212 bool is_user_gesture) { |
| 1213 if (contents_web_view_->HasFocus() && | 1213 if (contents_web_view_->HasFocus() && |
| 1214 !GetLocationBarView()->IsMouseHovered()) { | 1214 !GetLocationBarView()->IsMouseHovered()) { |
| 1215 content::RenderViewHost* rvh = web_contents->GetRenderViewHost(); | 1215 if (web_contents->IsFocusedElementEditable()) |
|
sky
2017/01/24 22:08:06
Now that there is no temporary combine the if stat
EhsanK
2017/01/25 01:05:37
Done. Thanks!
| |
| 1216 if (rvh->IsFocusedElementEditable()) | |
| 1217 return ShowTranslateBubbleResult::EDITABLE_FIELD_IS_ACTIVE; | 1216 return ShowTranslateBubbleResult::EDITABLE_FIELD_IS_ACTIVE; |
| 1218 } | 1217 } |
| 1219 | 1218 |
| 1220 translate::LanguageState& language_state = | 1219 translate::LanguageState& language_state = |
| 1221 ChromeTranslateClient::FromWebContents(web_contents)->GetLanguageState(); | 1220 ChromeTranslateClient::FromWebContents(web_contents)->GetLanguageState(); |
| 1222 language_state.SetTranslateEnabled(true); | 1221 language_state.SetTranslateEnabled(true); |
| 1223 | 1222 |
| 1224 if (IsMinimized()) | 1223 if (IsMinimized()) |
| 1225 return ShowTranslateBubbleResult::BROWSER_WINDOW_MINIMIZED; | 1224 return ShowTranslateBubbleResult::BROWSER_WINDOW_MINIMIZED; |
| 1226 | 1225 |
| (...skipping 1417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2644 } | 2643 } |
| 2645 | 2644 |
| 2646 extensions::ActiveTabPermissionGranter* | 2645 extensions::ActiveTabPermissionGranter* |
| 2647 BrowserView::GetActiveTabPermissionGranter() { | 2646 BrowserView::GetActiveTabPermissionGranter() { |
| 2648 content::WebContents* web_contents = GetActiveWebContents(); | 2647 content::WebContents* web_contents = GetActiveWebContents(); |
| 2649 if (!web_contents) | 2648 if (!web_contents) |
| 2650 return nullptr; | 2649 return nullptr; |
| 2651 return extensions::TabHelper::FromWebContents(web_contents) | 2650 return extensions::TabHelper::FromWebContents(web_contents) |
| 2652 ->active_tab_permission_granter(); | 2651 ->active_tab_permission_granter(); |
| 2653 } | 2652 } |
| OLD | NEW |