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

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

Issue 151413008: Move ownership of Password(Generation)Manager to ContentPasswordDriver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Handle WebContents having no PasswordManagerDelegateImpl attached Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/tab_helpers.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
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 2399 matching lines...) Expand 10 before | Expand all | Expand 10 after
2435 // Create a rect in the content bounds that the bubble will point to. 2436 // Create a rect in the content bounds that the bubble will point to.
2436 gfx::Point origin(rect.origin()); 2437 gfx::Point origin(rect.origin());
2437 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); 2438 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin);
2438 gfx::Rect bounds(origin, rect.size()); 2439 gfx::Rect bounds(origin, rect.size());
2439 2440
2440 // Create the bubble. 2441 // Create the bubble.
2441 WebContents* web_contents = GetActiveWebContents(); 2442 WebContents* web_contents = GetActiveWebContents();
2442 if (!web_contents) 2443 if (!web_contents)
2443 return; 2444 return;
2444 2445
2445 PasswordGenerationBubbleView* bubble = 2446 PasswordGenerationBubbleView* bubble = new PasswordGenerationBubbleView(
2446 new PasswordGenerationBubbleView( 2447 form,
2447 form, 2448 bounds,
2448 bounds, 2449 this,
2449 this, 2450 web_contents->GetRenderViewHost(),
2450 web_contents->GetRenderViewHost(), 2451 PasswordManagerDelegateImpl::GetManagerFromWebContents(web_contents),
2451 PasswordManager::FromWebContents(web_contents), 2452 password_generator,
2452 password_generator, 2453 browser_.get(),
2453 browser_.get(), 2454 GetWidget()->GetThemeProvider());
2454 GetWidget()->GetThemeProvider());
2455 2455
2456 views::BubbleDelegateView::CreateBubble(bubble); 2456 views::BubbleDelegateView::CreateBubble(bubble);
2457 bubble->SetAlignment(views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR); 2457 bubble->SetAlignment(views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR);
2458 bubble->GetWidget()->Show(); 2458 bubble->GetWidget()->Show();
2459 } 2459 }
2460 2460
2461 void BrowserView::OverscrollUpdate(int delta_y) { 2461 void BrowserView::OverscrollUpdate(int delta_y) {
2462 if (scroll_end_effect_controller_) 2462 if (scroll_end_effect_controller_)
2463 scroll_end_effect_controller_->OverscrollUpdate(delta_y); 2463 scroll_end_effect_controller_->OverscrollUpdate(delta_y);
2464 } 2464 }
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
2542 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { 2542 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) {
2543 gfx::Point icon_bottom( 2543 gfx::Point icon_bottom(
2544 toolbar_->location_bar()->GetLocationBarAnchorPoint()); 2544 toolbar_->location_bar()->GetLocationBarAnchorPoint());
2545 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); 2545 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom);
2546 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); 2546 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL));
2547 ConvertPointToTarget(infobar_container_, this, &infobar_top); 2547 ConvertPointToTarget(infobar_container_, this, &infobar_top);
2548 top_arrow_height = infobar_top.y() - icon_bottom.y(); 2548 top_arrow_height = infobar_top.y() - icon_bottom.y();
2549 } 2549 }
2550 return top_arrow_height; 2550 return top_arrow_height;
2551 } 2551 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/tab_helpers.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698