Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(522)

Side by Side Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 420713003: Translate: Don't show 'Translated' bubble when the user dismisses the bubble (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cocoa Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after
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( 1159 void BrowserView::ShowTranslateBubble(
1160 content::WebContents* web_contents, 1160 content::WebContents* web_contents,
1161 translate::TranslateStep step, 1161 translate::TranslateStep step,
1162 translate::TranslateErrors::Type error_type) { 1162 translate::TranslateErrors::Type error_type,
1163 bool is_user_gesture) {
1163 if (contents_web_view_->HasFocus() && 1164 if (contents_web_view_->HasFocus() &&
1164 !GetLocationBarView()->IsMouseHovered()) { 1165 !GetLocationBarView()->IsMouseHovered()) {
1165 content::RenderViewHost* rvh = web_contents->GetRenderViewHost(); 1166 content::RenderViewHost* rvh = web_contents->GetRenderViewHost();
1166 if (rvh->IsFocusedElementEditable()) 1167 if (rvh->IsFocusedElementEditable())
1167 return; 1168 return;
1168 } 1169 }
1169 1170
1170 ChromeTranslateClient* chrome_translate_client = 1171 ChromeTranslateClient* chrome_translate_client =
1171 ChromeTranslateClient::FromWebContents(web_contents); 1172 ChromeTranslateClient::FromWebContents(web_contents);
1172 translate::LanguageState& language_state = 1173 translate::LanguageState& language_state =
1173 chrome_translate_client->GetLanguageState(); 1174 chrome_translate_client->GetLanguageState();
1174 language_state.SetTranslateEnabled(true); 1175 language_state.SetTranslateEnabled(true);
1175 1176
1176 if (!IsActive()) 1177 if (!IsActive())
1177 return; 1178 return;
1178 1179
1179 TranslateBubbleView::ShowBubble( 1180 TranslateBubbleView::ShowBubble(
1180 GetToolbarView()->GetTranslateBubbleAnchor(), web_contents, step, 1181 GetToolbarView()->GetTranslateBubbleAnchor(), web_contents, step,
1181 error_type); 1182 error_type, is_user_gesture);
1182 } 1183 }
1183 1184
1184 #if defined(ENABLE_ONE_CLICK_SIGNIN) 1185 #if defined(ENABLE_ONE_CLICK_SIGNIN)
1185 void BrowserView::ShowOneClickSigninBubble( 1186 void BrowserView::ShowOneClickSigninBubble(
1186 OneClickSigninBubbleType type, 1187 OneClickSigninBubbleType type,
1187 const base::string16& email, 1188 const base::string16& email,
1188 const base::string16& error_message, 1189 const base::string16& error_message,
1189 const StartSyncCallback& start_sync_callback) { 1190 const StartSyncCallback& start_sync_callback) {
1190 scoped_ptr<OneClickSigninBubbleDelegate> delegate; 1191 scoped_ptr<OneClickSigninBubbleDelegate> delegate;
1191 delegate.reset(new OneClickSigninBubbleLinksDelegate(browser())); 1192 delegate.reset(new OneClickSigninBubbleLinksDelegate(browser()));
(...skipping 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after
2535 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { 2536 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) {
2536 gfx::Point icon_bottom( 2537 gfx::Point icon_bottom(
2537 toolbar_->location_bar()->GetLocationBarAnchorPoint()); 2538 toolbar_->location_bar()->GetLocationBarAnchorPoint());
2538 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); 2539 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom);
2539 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); 2540 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL));
2540 ConvertPointToTarget(infobar_container_, this, &infobar_top); 2541 ConvertPointToTarget(infobar_container_, this, &infobar_top);
2541 top_arrow_height = infobar_top.y() - icon_bottom.y(); 2542 top_arrow_height = infobar_top.y() - icon_bottom.y();
2542 } 2543 }
2543 return top_arrow_height; 2544 return top_arrow_height;
2544 } 2545 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.h ('k') | chrome/browser/ui/views/translate/translate_bubble_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698