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

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

Issue 246393004: Password bubble: Introduce a command to open the bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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
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"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "chrome/browser/ui/browser_command_controller.h" 44 #include "chrome/browser/ui/browser_command_controller.h"
45 #include "chrome/browser/ui/browser_commands.h" 45 #include "chrome/browser/ui/browser_commands.h"
46 #include "chrome/browser/ui/browser_dialogs.h" 46 #include "chrome/browser/ui/browser_dialogs.h"
47 #include "chrome/browser/ui/browser_finder.h" 47 #include "chrome/browser/ui/browser_finder.h"
48 #include "chrome/browser/ui/browser_list.h" 48 #include "chrome/browser/ui/browser_list.h"
49 #include "chrome/browser/ui/browser_window_state.h" 49 #include "chrome/browser/ui/browser_window_state.h"
50 #include "chrome/browser/ui/ntp_background_util.h" 50 #include "chrome/browser/ui/ntp_background_util.h"
51 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h" 51 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h"
52 #include "chrome/browser/ui/omnibox/omnibox_popup_view.h" 52 #include "chrome/browser/ui/omnibox/omnibox_popup_view.h"
53 #include "chrome/browser/ui/omnibox/omnibox_view.h" 53 #include "chrome/browser/ui/omnibox/omnibox_view.h"
54 #include "chrome/browser/ui/passwords/manage_passwords_bubble_ui_controller.h"
54 #include "chrome/browser/ui/search/search_delegate.h" 55 #include "chrome/browser/ui/search/search_delegate.h"
55 #include "chrome/browser/ui/search/search_model.h" 56 #include "chrome/browser/ui/search/search_model.h"
56 #include "chrome/browser/ui/search/search_ui.h" 57 #include "chrome/browser/ui/search/search_ui.h"
57 #include "chrome/browser/ui/tabs/tab_menu_model.h" 58 #include "chrome/browser/ui/tabs/tab_menu_model.h"
58 #include "chrome/browser/ui/tabs/tab_strip_model.h" 59 #include "chrome/browser/ui/tabs/tab_strip_model.h"
59 #include "chrome/browser/ui/view_ids.h" 60 #include "chrome/browser/ui/view_ids.h"
60 #include "chrome/browser/ui/views/accelerator_table.h" 61 #include "chrome/browser/ui/views/accelerator_table.h"
61 #include "chrome/browser/ui/views/accessibility/invert_bubble_view.h" 62 #include "chrome/browser/ui/views/accessibility/invert_bubble_view.h"
62 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" 63 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h"
63 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" 64 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h"
64 #include "chrome/browser/ui/views/browser_dialogs.h" 65 #include "chrome/browser/ui/views/browser_dialogs.h"
65 #include "chrome/browser/ui/views/download/download_in_progress_dialog_view.h" 66 #include "chrome/browser/ui/views/download/download_in_progress_dialog_view.h"
66 #include "chrome/browser/ui/views/download/download_shelf_view.h" 67 #include "chrome/browser/ui/views/download/download_shelf_view.h"
67 #include "chrome/browser/ui/views/extensions/bookmark_app_bubble_view.h" 68 #include "chrome/browser/ui/views/extensions/bookmark_app_bubble_view.h"
68 #include "chrome/browser/ui/views/frame/browser_view_layout.h" 69 #include "chrome/browser/ui/views/frame/browser_view_layout.h"
69 #include "chrome/browser/ui/views/frame/browser_view_layout_delegate.h" 70 #include "chrome/browser/ui/views/frame/browser_view_layout_delegate.h"
70 #include "chrome/browser/ui/views/frame/contents_layout_manager.h" 71 #include "chrome/browser/ui/views/frame/contents_layout_manager.h"
71 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" 72 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h"
72 #include "chrome/browser/ui/views/frame/native_browser_frame_factory.h" 73 #include "chrome/browser/ui/views/frame/native_browser_frame_factory.h"
73 #include "chrome/browser/ui/views/frame/top_container_view.h" 74 #include "chrome/browser/ui/views/frame/top_container_view.h"
74 #include "chrome/browser/ui/views/frame/web_contents_close_handler.h" 75 #include "chrome/browser/ui/views/frame/web_contents_close_handler.h"
75 #include "chrome/browser/ui/views/fullscreen_exit_bubble_views.h" 76 #include "chrome/browser/ui/views/fullscreen_exit_bubble_views.h"
76 #include "chrome/browser/ui/views/infobars/infobar_container_view.h" 77 #include "chrome/browser/ui/views/infobars/infobar_container_view.h"
77 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" 78 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
78 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" 79 #include "chrome/browser/ui/views/location_bar/location_icon_view.h"
79 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" 80 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h"
80 #include "chrome/browser/ui/views/password_generation_bubble_view.h" 81 #include "chrome/browser/ui/views/password_generation_bubble_view.h"
82 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h"
81 #include "chrome/browser/ui/views/profiles/avatar_menu_bubble_view.h" 83 #include "chrome/browser/ui/views/profiles/avatar_menu_bubble_view.h"
82 #include "chrome/browser/ui/views/profiles/avatar_menu_button.h" 84 #include "chrome/browser/ui/views/profiles/avatar_menu_button.h"
83 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" 85 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h"
84 #include "chrome/browser/ui/views/status_bubble_views.h" 86 #include "chrome/browser/ui/views/status_bubble_views.h"
85 #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h" 87 #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h"
86 #include "chrome/browser/ui/views/tabs/tab.h" 88 #include "chrome/browser/ui/views/tabs/tab.h"
87 #include "chrome/browser/ui/views/tabs/tab_strip.h" 89 #include "chrome/browser/ui/views/tabs/tab_strip.h"
88 #include "chrome/browser/ui/views/toolbar/reload_button.h" 90 #include "chrome/browser/ui/views/toolbar/reload_button.h"
89 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" 91 #include "chrome/browser/ui/views/toolbar/toolbar_view.h"
90 #include "chrome/browser/ui/views/translate/translate_bubble_view.h" 92 #include "chrome/browser/ui/views/translate/translate_bubble_view.h"
(...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after
1197 TranslateTabHelper* translate_tab_helper = 1199 TranslateTabHelper* translate_tab_helper =
1198 TranslateTabHelper::FromWebContents(web_contents); 1200 TranslateTabHelper::FromWebContents(web_contents);
1199 LanguageState& language_state = translate_tab_helper->GetLanguageState(); 1201 LanguageState& language_state = translate_tab_helper->GetLanguageState();
1200 language_state.SetTranslateEnabled(true); 1202 language_state.SetTranslateEnabled(true);
1201 1203
1202 TranslateBubbleView::ShowBubble( 1204 TranslateBubbleView::ShowBubble(
1203 GetToolbarView()->GetTranslateBubbleAnchor(), web_contents, step, 1205 GetToolbarView()->GetTranslateBubbleAnchor(), web_contents, step,
1204 error_type); 1206 error_type);
1205 } 1207 }
1206 1208
1209 void BrowserView::ShowManagePasswordsBubble(
1210 content::WebContents* web_contents) {
1211 ManagePasswordsBubbleUIController* controller =
1212 ManagePasswordsBubbleUIController::FromWebContents(web_contents);
1213 bool is_automatic_display =
1214 controller->manage_passwords_bubble_needs_showing();
1215 ManagePasswordsBubbleView::ShowBubble(web_contents,
1216 is_automatic_display ? ManagePasswordsBubbleView::AUTOMATIC
1217 : ManagePasswordsBubbleView::USER_ACTION);
1218 }
1219
1207 #if defined(ENABLE_ONE_CLICK_SIGNIN) 1220 #if defined(ENABLE_ONE_CLICK_SIGNIN)
1208 void BrowserView::ShowOneClickSigninBubble( 1221 void BrowserView::ShowOneClickSigninBubble(
1209 OneClickSigninBubbleType type, 1222 OneClickSigninBubbleType type,
1210 const base::string16& email, 1223 const base::string16& email,
1211 const base::string16& error_message, 1224 const base::string16& error_message,
1212 const StartSyncCallback& start_sync_callback) { 1225 const StartSyncCallback& start_sync_callback) {
1213 scoped_ptr<OneClickSigninBubbleDelegate> delegate; 1226 scoped_ptr<OneClickSigninBubbleDelegate> delegate;
1214 delegate.reset(new OneClickSigninBubbleLinksDelegate(browser())); 1227 delegate.reset(new OneClickSigninBubbleLinksDelegate(browser()));
1215 1228
1216 views::View* anchor_view; 1229 views::View* anchor_view;
(...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after
2556 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { 2569 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) {
2557 gfx::Point icon_bottom( 2570 gfx::Point icon_bottom(
2558 toolbar_->location_bar()->GetLocationBarAnchorPoint()); 2571 toolbar_->location_bar()->GetLocationBarAnchorPoint());
2559 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); 2572 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom);
2560 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); 2573 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL));
2561 ConvertPointToTarget(infobar_container_, this, &infobar_top); 2574 ConvertPointToTarget(infobar_container_, this, &infobar_top);
2562 top_arrow_height = infobar_top.y() - icon_bottom.y(); 2575 top_arrow_height = infobar_top.y() - icon_bottom.y();
2563 } 2576 }
2564 return top_arrow_height; 2577 return top_arrow_height;
2565 } 2578 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698