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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1149 | 1149 |
1150 void BrowserView::ShowBookmarkAppBubble( | 1150 void BrowserView::ShowBookmarkAppBubble( |
1151 const WebApplicationInfo& web_app_info, | 1151 const WebApplicationInfo& web_app_info, |
1152 const std::string& extension_id) { | 1152 const std::string& extension_id) { |
1153 BookmarkAppBubbleView::ShowBubble(GetToolbarView(), | 1153 BookmarkAppBubbleView::ShowBubble(GetToolbarView(), |
1154 browser_->profile(), | 1154 browser_->profile(), |
1155 web_app_info, | 1155 web_app_info, |
1156 extension_id); | 1156 extension_id); |
1157 } | 1157 } |
1158 | 1158 |
1159 void BrowserView::ShowTranslateBubble(content::WebContents* web_contents, | 1159 void BrowserView::ShowTranslateBubble( |
1160 translate::TranslateStep step, | 1160 content::WebContents* web_contents, |
1161 TranslateErrors::Type error_type) { | 1161 translate::TranslateStep step, |
| 1162 translate::TranslateErrors::Type error_type) { |
1162 if (contents_web_view_->HasFocus() && | 1163 if (contents_web_view_->HasFocus() && |
1163 !GetLocationBarView()->IsMouseHovered()) { | 1164 !GetLocationBarView()->IsMouseHovered()) { |
1164 content::RenderViewHost* rvh = web_contents->GetRenderViewHost(); | 1165 content::RenderViewHost* rvh = web_contents->GetRenderViewHost(); |
1165 if (rvh->IsFocusedElementEditable()) | 1166 if (rvh->IsFocusedElementEditable()) |
1166 return; | 1167 return; |
1167 } | 1168 } |
1168 | 1169 |
1169 ChromeTranslateClient* chrome_translate_client = | 1170 ChromeTranslateClient* chrome_translate_client = |
1170 ChromeTranslateClient::FromWebContents(web_contents); | 1171 ChromeTranslateClient::FromWebContents(web_contents); |
1171 LanguageState& language_state = chrome_translate_client->GetLanguageState(); | 1172 translate::LanguageState& language_state = |
| 1173 chrome_translate_client->GetLanguageState(); |
1172 language_state.SetTranslateEnabled(true); | 1174 language_state.SetTranslateEnabled(true); |
1173 | 1175 |
1174 if (!IsActive()) | 1176 if (!IsActive()) |
1175 return; | 1177 return; |
1176 | 1178 |
1177 TranslateBubbleView::ShowBubble( | 1179 TranslateBubbleView::ShowBubble( |
1178 GetToolbarView()->GetTranslateBubbleAnchor(), web_contents, step, | 1180 GetToolbarView()->GetTranslateBubbleAnchor(), web_contents, step, |
1179 error_type); | 1181 error_type); |
1180 } | 1182 } |
1181 | 1183 |
(...skipping 1351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2533 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { | 2535 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { |
2534 gfx::Point icon_bottom( | 2536 gfx::Point icon_bottom( |
2535 toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 2537 toolbar_->location_bar()->GetLocationBarAnchorPoint()); |
2536 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); | 2538 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); |
2537 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2539 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
2538 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2540 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
2539 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2541 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
2540 } | 2542 } |
2541 return top_arrow_height; | 2543 return top_arrow_height; |
2542 } | 2544 } |
OLD | NEW |