| 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 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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(content::WebContents* web_contents, |
| 1160 translate::TranslateStep step, | 1160 translate::TranslateStep step, |
| 1161 TranslateErrors::Type error_type) { | 1161 TranslateErrors::Type error_type, |
| 1162 bool is_explicit) { |
| 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 LanguageState& language_state = chrome_translate_client->GetLanguageState(); |
| 1172 language_state.SetTranslateEnabled(true); | 1173 language_state.SetTranslateEnabled(true); |
| 1173 | 1174 |
| 1174 if (!IsActive()) | 1175 if (!IsActive()) |
| 1175 return; | 1176 return; |
| 1176 | 1177 |
| 1177 TranslateBubbleView::ShowBubble( | 1178 TranslateBubbleView::ShowBubble( |
| 1178 GetToolbarView()->GetTranslateBubbleAnchor(), web_contents, step, | 1179 GetToolbarView()->GetTranslateBubbleAnchor(), web_contents, step, |
| 1179 error_type); | 1180 error_type, is_explicit); |
| 1180 } | 1181 } |
| 1181 | 1182 |
| 1182 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 1183 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
| 1183 void BrowserView::ShowOneClickSigninBubble( | 1184 void BrowserView::ShowOneClickSigninBubble( |
| 1184 OneClickSigninBubbleType type, | 1185 OneClickSigninBubbleType type, |
| 1185 const base::string16& email, | 1186 const base::string16& email, |
| 1186 const base::string16& error_message, | 1187 const base::string16& error_message, |
| 1187 const StartSyncCallback& start_sync_callback) { | 1188 const StartSyncCallback& start_sync_callback) { |
| 1188 scoped_ptr<OneClickSigninBubbleDelegate> delegate; | 1189 scoped_ptr<OneClickSigninBubbleDelegate> delegate; |
| 1189 delegate.reset(new OneClickSigninBubbleLinksDelegate(browser())); | 1190 delegate.reset(new OneClickSigninBubbleLinksDelegate(browser())); |
| (...skipping 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2533 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { | 2534 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { |
| 2534 gfx::Point icon_bottom( | 2535 gfx::Point icon_bottom( |
| 2535 toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 2536 toolbar_->location_bar()->GetLocationBarAnchorPoint()); |
| 2536 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); | 2537 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); |
| 2537 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2538 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
| 2538 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2539 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
| 2539 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2540 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
| 2540 } | 2541 } |
| 2541 return top_arrow_height; | 2542 return top_arrow_height; |
| 2542 } | 2543 } |
| OLD | NEW |