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 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1205 void BrowserView::ShowTranslateBubble( | 1205 void BrowserView::ShowTranslateBubble( |
1206 content::WebContents* web_contents, | 1206 content::WebContents* web_contents, |
1207 TranslateBubbleModel::ViewState view_state, | 1207 TranslateBubbleModel::ViewState view_state, |
1208 TranslateErrors::Type error_type) { | 1208 TranslateErrors::Type error_type) { |
1209 TranslateTabHelper* translate_tab_helper = | 1209 TranslateTabHelper* translate_tab_helper = |
1210 TranslateTabHelper::FromWebContents(web_contents); | 1210 TranslateTabHelper::FromWebContents(web_contents); |
1211 LanguageState& language_state = translate_tab_helper->language_state(); | 1211 LanguageState& language_state = translate_tab_helper->language_state(); |
1212 language_state.SetTranslateEnabled(true); | 1212 language_state.SetTranslateEnabled(true); |
1213 | 1213 |
1214 TranslateBubbleView::ShowBubble(GetToolbarView()->GetTranslateBubbleAnchor(), | 1214 TranslateBubbleView::ShowBubble(GetToolbarView()->GetTranslateBubbleAnchor(), |
1215 web_contents, view_state, error_type, | 1215 web_contents, view_state, error_type); |
1216 browser_.get()); | |
1217 } | 1216 } |
1218 | 1217 |
1219 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 1218 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
1220 void BrowserView::ShowOneClickSigninBubble( | 1219 void BrowserView::ShowOneClickSigninBubble( |
1221 OneClickSigninBubbleType type, | 1220 OneClickSigninBubbleType type, |
1222 const base::string16& email, | 1221 const base::string16& email, |
1223 const base::string16& error_message, | 1222 const base::string16& error_message, |
1224 const StartSyncCallback& start_sync_callback) { | 1223 const StartSyncCallback& start_sync_callback) { |
1225 scoped_ptr<OneClickSigninBubbleDelegate> delegate; | 1224 scoped_ptr<OneClickSigninBubbleDelegate> delegate; |
1226 delegate.reset(new OneClickSigninBubbleLinksDelegate(browser())); | 1225 delegate.reset(new OneClickSigninBubbleLinksDelegate(browser())); |
(...skipping 1445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2672 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { | 2671 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { |
2673 gfx::Point icon_bottom( | 2672 gfx::Point icon_bottom( |
2674 toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 2673 toolbar_->location_bar()->GetLocationBarAnchorPoint()); |
2675 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); | 2674 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); |
2676 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2675 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
2677 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2676 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
2678 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2677 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
2679 } | 2678 } |
2680 return top_arrow_height; | 2679 return top_arrow_height; |
2681 } | 2680 } |
OLD | NEW |