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 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1185 url, | 1185 url, |
1186 !already_bookmarked); | 1186 !already_bookmarked); |
1187 } | 1187 } |
1188 | 1188 |
1189 void BrowserView::ShowBookmarkPrompt() { | 1189 void BrowserView::ShowBookmarkPrompt() { |
1190 GetLocationBarView()->ShowBookmarkPrompt(); | 1190 GetLocationBarView()->ShowBookmarkPrompt(); |
1191 } | 1191 } |
1192 | 1192 |
1193 void BrowserView::ShowTranslateBubble( | 1193 void BrowserView::ShowTranslateBubble( |
1194 content::WebContents* web_contents, | 1194 content::WebContents* web_contents, |
1195 TranslateBubbleModel::ViewState view_state) { | 1195 TranslateBubbleModel::ViewState view_state, |
| 1196 TranslateErrors::Type error_type) { |
1196 TranslateTabHelper* translate_tab_helper = | 1197 TranslateTabHelper* translate_tab_helper = |
1197 TranslateTabHelper::FromWebContents(web_contents); | 1198 TranslateTabHelper::FromWebContents(web_contents); |
1198 LanguageState& language_state = translate_tab_helper->language_state(); | 1199 LanguageState& language_state = translate_tab_helper->language_state(); |
1199 language_state.SetTranslateEnabled(true); | 1200 language_state.SetTranslateEnabled(true); |
1200 | 1201 |
1201 TranslateBubbleView::ShowBubble(GetToolbarView()->GetTranslateBubbleAnchor(), | 1202 TranslateBubbleView::ShowBubble(GetToolbarView()->GetTranslateBubbleAnchor(), |
1202 web_contents, view_state, browser_.get()); | 1203 web_contents, view_state, error_type, |
| 1204 browser_.get()); |
1203 } | 1205 } |
1204 | 1206 |
1205 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 1207 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
1206 void BrowserView::ShowOneClickSigninBubble( | 1208 void BrowserView::ShowOneClickSigninBubble( |
1207 OneClickSigninBubbleType type, | 1209 OneClickSigninBubbleType type, |
1208 const string16& email, | 1210 const string16& email, |
1209 const string16& error_message, | 1211 const string16& error_message, |
1210 const StartSyncCallback& start_sync_callback) { | 1212 const StartSyncCallback& start_sync_callback) { |
1211 scoped_ptr<OneClickSigninBubbleDelegate> delegate; | 1213 scoped_ptr<OneClickSigninBubbleDelegate> delegate; |
1212 delegate.reset(new OneClickSigninBubbleLinksDelegate(browser())); | 1214 delegate.reset(new OneClickSigninBubbleLinksDelegate(browser())); |
(...skipping 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2653 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { | 2655 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { |
2654 gfx::Point icon_bottom( | 2656 gfx::Point icon_bottom( |
2655 toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 2657 toolbar_->location_bar()->GetLocationBarAnchorPoint()); |
2656 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); | 2658 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); |
2657 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2659 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
2658 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2660 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
2659 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2661 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
2660 } | 2662 } |
2661 return top_arrow_height; | 2663 return top_arrow_height; |
2662 } | 2664 } |
OLD | NEW |