| 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" |
| 11 #include "base/i18n/rtl.h" | 11 #include "base/i18n/rtl.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
| 14 #include "base/prefs/pref_service.h" | 14 #include "base/prefs/pref_service.h" |
| 15 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
| 16 #include "chrome/app/chrome_command_ids.h" | 16 #include "chrome/app/chrome_command_ids.h" |
| 17 #include "chrome/app/chrome_dll_resource.h" | 17 #include "chrome/app/chrome_dll_resource.h" |
| 18 #include "chrome/browser/app_mode/app_mode_utils.h" | 18 #include "chrome/browser/app_mode/app_mode_utils.h" |
| 19 #include "chrome/browser/bookmarks/bookmark_stats.h" | 19 #include "chrome/browser/bookmarks/bookmark_stats.h" |
| 20 #include "chrome/browser/browser_process.h" | 20 #include "chrome/browser/browser_process.h" |
| 21 #include "chrome/browser/chrome_notification_types.h" | 21 #include "chrome/browser/chrome_notification_types.h" |
| 22 #include "chrome/browser/extensions/tab_helper.h" | 22 #include "chrome/browser/extensions/tab_helper.h" |
| 23 #include "chrome/browser/infobars/infobar_service.h" | 23 #include "chrome/browser/infobars/infobar_service.h" |
| 24 #include "chrome/browser/native_window_notification_source.h" | 24 #include "chrome/browser/native_window_notification_source.h" |
| 25 #include "chrome/browser/password_manager/password_manager.h" | 25 #include "chrome/browser/password_manager/password_manager.h" |
| 26 #include "chrome/browser/password_manager/password_manager_delegate_impl.h" |
| 26 #include "chrome/browser/profiles/avatar_menu.h" | 27 #include "chrome/browser/profiles/avatar_menu.h" |
| 27 #include "chrome/browser/profiles/profile.h" | 28 #include "chrome/browser/profiles/profile.h" |
| 28 #include "chrome/browser/profiles/profile_info_cache.h" | 29 #include "chrome/browser/profiles/profile_info_cache.h" |
| 29 #include "chrome/browser/profiles/profile_manager.h" | 30 #include "chrome/browser/profiles/profile_manager.h" |
| 30 #include "chrome/browser/profiles/profiles_state.h" | 31 #include "chrome/browser/profiles/profiles_state.h" |
| 31 #include "chrome/browser/search/search.h" | 32 #include "chrome/browser/search/search.h" |
| 32 #include "chrome/browser/sessions/tab_restore_service.h" | 33 #include "chrome/browser/sessions/tab_restore_service.h" |
| 33 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 34 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
| 34 #include "chrome/browser/speech/tts_controller.h" | 35 #include "chrome/browser/speech/tts_controller.h" |
| 35 #include "chrome/browser/themes/theme_properties.h" | 36 #include "chrome/browser/themes/theme_properties.h" |
| (...skipping 2395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2431 // Create a rect in the content bounds that the bubble will point to. | 2432 // Create a rect in the content bounds that the bubble will point to. |
| 2432 gfx::Point origin(rect.origin()); | 2433 gfx::Point origin(rect.origin()); |
| 2433 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); | 2434 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); |
| 2434 gfx::Rect bounds(origin, rect.size()); | 2435 gfx::Rect bounds(origin, rect.size()); |
| 2435 | 2436 |
| 2436 // Create the bubble. | 2437 // Create the bubble. |
| 2437 WebContents* web_contents = GetActiveWebContents(); | 2438 WebContents* web_contents = GetActiveWebContents(); |
| 2438 if (!web_contents) | 2439 if (!web_contents) |
| 2439 return; | 2440 return; |
| 2440 | 2441 |
| 2441 PasswordGenerationBubbleView* bubble = | 2442 PasswordGenerationBubbleView* bubble = new PasswordGenerationBubbleView( |
| 2442 new PasswordGenerationBubbleView( | 2443 form, |
| 2443 form, | 2444 bounds, |
| 2444 bounds, | 2445 this, |
| 2445 this, | 2446 web_contents->GetRenderViewHost(), |
| 2446 web_contents->GetRenderViewHost(), | 2447 PasswordManagerDelegateImpl::GetManagerFromWebContents(web_contents), |
| 2447 PasswordManager::FromWebContents(web_contents), | 2448 password_generator, |
| 2448 password_generator, | 2449 browser_.get(), |
| 2449 browser_.get(), | 2450 GetWidget()->GetThemeProvider()); |
| 2450 GetWidget()->GetThemeProvider()); | |
| 2451 | 2451 |
| 2452 views::BubbleDelegateView::CreateBubble(bubble); | 2452 views::BubbleDelegateView::CreateBubble(bubble); |
| 2453 bubble->SetAlignment(views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR); | 2453 bubble->SetAlignment(views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR); |
| 2454 bubble->GetWidget()->Show(); | 2454 bubble->GetWidget()->Show(); |
| 2455 } | 2455 } |
| 2456 | 2456 |
| 2457 void BrowserView::OverscrollUpdate(int delta_y) { | 2457 void BrowserView::OverscrollUpdate(int delta_y) { |
| 2458 if (scroll_end_effect_controller_) | 2458 if (scroll_end_effect_controller_) |
| 2459 scroll_end_effect_controller_->OverscrollUpdate(delta_y); | 2459 scroll_end_effect_controller_->OverscrollUpdate(delta_y); |
| 2460 } | 2460 } |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2538 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { | 2538 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { |
| 2539 gfx::Point icon_bottom( | 2539 gfx::Point icon_bottom( |
| 2540 toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 2540 toolbar_->location_bar()->GetLocationBarAnchorPoint()); |
| 2541 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); | 2541 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); |
| 2542 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2542 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
| 2543 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2543 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
| 2544 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2544 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
| 2545 } | 2545 } |
| 2546 return top_arrow_height; | 2546 return top_arrow_height; |
| 2547 } | 2547 } |
| OLD | NEW |