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