summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/ui')
-rw-r--r--chrome/browser/ui/app_modal_dialogs/message_box_handler.cc2
-rw-r--r--chrome/browser/ui/browser.cc2
-rw-r--r--chrome/browser/ui/browser_init.cc2
-rw-r--r--chrome/browser/ui/browser_list.cc2
-rw-r--r--chrome/browser/ui/browser_navigator.cc2
-rw-r--r--chrome/browser/ui/browser_navigator_browsertest.cc2
-rw-r--r--chrome/browser/ui/cocoa/applescript/bookmark_item_applescript.mm2
-rw-r--r--chrome/browser/ui/cocoa/applescript/bookmark_node_applescript.mm2
-rw-r--r--chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript.mm2
-rw-r--r--chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript_test.mm2
-rw-r--r--chrome/browser/ui/cocoa/applescript/window_applescript.mm2
-rw-r--r--chrome/browser/ui/cocoa/applescript/window_applescript_test.mm2
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm2
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_drag_source.mm2
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.mm2
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm4
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.mm2
-rw-r--r--chrome/browser/ui/cocoa/browser_test_helper.h2
-rw-r--r--chrome/browser/ui/cocoa/browser_window_cocoa.mm2
-rw-r--r--chrome/browser/ui/cocoa/browser_window_controller.mm2
-rw-r--r--chrome/browser/ui/cocoa/browser_window_controller_private.mm2
-rw-r--r--chrome/browser/ui/cocoa/bug_report_window_controller_unittest.mm2
-rw-r--r--chrome/browser/ui/cocoa/clear_browsing_data_controller.mm2
-rw-r--r--chrome/browser/ui/cocoa/clear_browsing_data_controller_unittest.mm2
-rw-r--r--chrome/browser/ui/cocoa/collected_cookies_mac.mm2
-rw-r--r--chrome/browser/ui/cocoa/collected_cookies_mac_unittest.mm2
-rw-r--r--chrome/browser/ui/cocoa/constrained_html_delegate_mac.mm2
-rw-r--r--chrome/browser/ui/cocoa/content_settings_dialog_controller.mm2
-rw-r--r--chrome/browser/ui/cocoa/cookies_window_controller.mm2
-rw-r--r--chrome/browser/ui/cocoa/cookies_window_controller_unittest.mm2
-rw-r--r--chrome/browser/ui/cocoa/download/download_shelf_controller.mm2
-rw-r--r--chrome/browser/ui/cocoa/encoding_menu_controller_delegate_mac.mm2
-rw-r--r--chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm2
-rw-r--r--chrome/browser/ui/cocoa/extensions/extension_action_context_menu.mm2
-rw-r--r--chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm2
-rw-r--r--chrome/browser/ui/cocoa/font_language_settings_controller.mm2
-rw-r--r--chrome/browser/ui/cocoa/font_language_settings_controller_unittest.mm2
-rw-r--r--chrome/browser/ui/cocoa/history_menu_bridge.mm2
-rw-r--r--chrome/browser/ui/cocoa/history_menu_cocoa_controller.mm2
-rw-r--r--chrome/browser/ui/cocoa/html_dialog_window_controller.mm2
-rw-r--r--chrome/browser/ui/cocoa/import_settings_dialog.mm2
-rw-r--r--chrome/browser/ui/cocoa/instant_confirm_window_controller.mm2
-rw-r--r--chrome/browser/ui/cocoa/keystone_infobar.mm2
-rw-r--r--chrome/browser/ui/cocoa/keyword_editor_cocoa_controller.mm2
-rw-r--r--chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm2
-rw-r--r--chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm2
-rw-r--r--chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm2
-rw-r--r--chrome/browser/ui/cocoa/notifications/balloon_controller.mm2
-rw-r--r--chrome/browser/ui/cocoa/page_info_bubble_controller.mm2
-rw-r--r--chrome/browser/ui/cocoa/preferences_window_controller.mm2
-rw-r--r--chrome/browser/ui/cocoa/search_engine_dialog_controller.mm2
-rw-r--r--chrome/browser/ui/cocoa/search_engine_list_model_unittest.mm2
-rw-r--r--chrome/browser/ui/cocoa/tab_strip_controller.mm2
-rw-r--r--chrome/browser/ui/cocoa/toolbar_controller.mm2
-rw-r--r--chrome/browser/ui/cocoa/view_id_util_browsertest.mm2
-rw-r--r--chrome/browser/ui/find_bar/find_bar_host_browsertest.cc2
-rw-r--r--chrome/browser/ui/find_bar/find_bar_state.cc2
-rw-r--r--chrome/browser/ui/login/login_model.h35
-rw-r--r--chrome/browser/ui/login/login_prompt.cc453
-rw-r--r--chrome/browser/ui/login/login_prompt.h214
-rw-r--r--chrome/browser/ui/login/login_prompt_gtk.cc199
-rw-r--r--chrome/browser/ui/login/login_prompt_mac.h34
-rw-r--r--chrome/browser/ui/login/login_prompt_mac.mm191
-rw-r--r--chrome/browser/ui/login/login_prompt_uitest.cc280
-rw-r--r--chrome/browser/ui/login/login_prompt_unittest.cc42
-rw-r--r--chrome/browser/ui/login/login_prompt_win.cc147
-rw-r--r--chrome/browser/ui/omnibox/location_bar_util.cc2
-rw-r--r--chrome/browser/ui/options/options_util.cc2
-rw-r--r--chrome/browser/ui/options/show_options_url.cc2
-rw-r--r--chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc2
-rw-r--r--chrome/browser/ui/toolbar/encoding_menu_controller.cc2
-rw-r--r--chrome/browser/ui/toolbar/encoding_menu_controller_unittest.cc2
-rw-r--r--chrome/browser/ui/toolbar/toolbar_model.cc2
-rw-r--r--chrome/browser/ui/toolbar/wrench_menu_model.cc2
-rw-r--r--chrome/browser/ui/views/accessibility_event_router_views.cc4
-rw-r--r--chrome/browser/ui/views/accessible_view_helper.cc2
-rw-r--r--chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc2
-rw-r--r--chrome/browser/ui/views/autofill_profiles_view_win.cc2
-rw-r--r--chrome/browser/ui/views/bookmark_bar_view.cc2
-rw-r--r--chrome/browser/ui/views/bookmark_bar_view_test.cc2
-rw-r--r--chrome/browser/ui/views/bookmark_bubble_view.cc2
-rw-r--r--chrome/browser/ui/views/bookmark_context_menu.cc2
-rw-r--r--chrome/browser/ui/views/bookmark_context_menu_controller_views.cc2
-rw-r--r--chrome/browser/ui/views/bookmark_context_menu_test.cc2
-rw-r--r--chrome/browser/ui/views/bookmark_editor_view.cc2
-rw-r--r--chrome/browser/ui/views/bookmark_editor_view_unittest.cc2
-rw-r--r--chrome/browser/ui/views/bookmark_menu_controller_views.cc2
-rw-r--r--chrome/browser/ui/views/browser_actions_container.cc2
-rw-r--r--chrome/browser/ui/views/browser_actions_container_browsertest.cc2
-rw-r--r--chrome/browser/ui/views/clear_browsing_data.cc2
-rw-r--r--chrome/browser/ui/views/clear_browsing_data_view.cc2
-rw-r--r--chrome/browser/ui/views/clear_data_view.cc2
-rw-r--r--chrome/browser/ui/views/clear_server_data.cc2
-rw-r--r--chrome/browser/ui/views/collected_cookies_win.cc2
-rw-r--r--chrome/browser/ui/views/constrained_html_delegate_gtk.cc2
-rw-r--r--chrome/browser/ui/views/constrained_html_delegate_win.cc2
-rw-r--r--chrome/browser/ui/views/constrained_window_win.cc2
-rw-r--r--chrome/browser/ui/views/content_setting_bubble_contents.cc2
-rw-r--r--chrome/browser/ui/views/cookie_info_view.cc2
-rw-r--r--chrome/browser/ui/views/create_application_shortcut_view.cc2
-rw-r--r--chrome/browser/ui/views/default_search_view.cc2
-rw-r--r--chrome/browser/ui/views/extensions/browser_action_drag_data.cc2
-rw-r--r--chrome/browser/ui/views/extensions/browser_action_drag_data.h2
-rw-r--r--chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.cc2
-rw-r--r--chrome/browser/ui/views/extensions/extension_installed_bubble.cc2
-rw-r--r--chrome/browser/ui/views/extensions/extension_popup.cc2
-rw-r--r--chrome/browser/ui/views/find_bar_view.cc2
-rw-r--r--chrome/browser/ui/views/first_run_search_engine_view.cc2
-rw-r--r--chrome/browser/ui/views/frame/browser_frame_gtk.cc2
-rw-r--r--chrome/browser/ui/views/frame/browser_frame_win.cc2
-rw-r--r--chrome/browser/ui/views/frame/browser_root_view.cc2
-rw-r--r--chrome/browser/ui/views/frame/browser_view.cc2
-rw-r--r--chrome/browser/ui/views/instant_confirm_view.cc2
-rw-r--r--chrome/browser/ui/views/keyword_editor_view.cc2
-rw-r--r--chrome/browser/ui/views/location_bar/keyword_hint_view.cc2
-rw-r--r--chrome/browser/ui/views/location_bar/location_bar_view.cc2
-rw-r--r--chrome/browser/ui/views/location_bar/page_action_image_view.cc2
-rw-r--r--chrome/browser/ui/views/location_bar/selected_keyword_view.cc2
-rw-r--r--chrome/browser/ui/views/login_view.h2
-rw-r--r--chrome/browser/ui/views/notifications/balloon_view.cc2
-rw-r--r--chrome/browser/ui/views/options/advanced_contents_view.cc2
-rw-r--r--chrome/browser/ui/views/options/advanced_page_view.cc2
-rw-r--r--chrome/browser/ui/views/options/content_filter_page_view.cc2
-rw-r--r--chrome/browser/ui/views/options/content_page_view.cc2
-rw-r--r--chrome/browser/ui/views/options/content_settings_window_view.cc2
-rw-r--r--chrome/browser/ui/views/options/cookie_filter_page_view.cc2
-rw-r--r--chrome/browser/ui/views/options/cookies_view.cc2
-rw-r--r--chrome/browser/ui/views/options/exceptions_page_view.cc2
-rw-r--r--chrome/browser/ui/views/options/fonts_languages_window_view.cc2
-rw-r--r--chrome/browser/ui/views/options/fonts_page_view.cc2
-rw-r--r--chrome/browser/ui/views/options/general_page_view.cc2
-rw-r--r--chrome/browser/ui/views/options/languages_page_view.cc2
-rw-r--r--chrome/browser/ui/views/options/options_window_view.cc2
-rw-r--r--chrome/browser/ui/views/options/passwords_page_view.cc2
-rw-r--r--chrome/browser/ui/views/options/passwords_page_view.h2
-rw-r--r--chrome/browser/ui/views/select_file_dialog.cc2
-rw-r--r--chrome/browser/ui/views/tab_contents/render_view_context_menu_views.cc2
-rw-r--r--chrome/browser/ui/views/tab_contents/tab_contents_drag_win.cc2
-rw-r--r--chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc2
-rw-r--r--chrome/browser/ui/views/theme_background.cc2
-rw-r--r--chrome/browser/ui/views/toolbar_view.cc2
-rw-r--r--chrome/browser/ui/views/url_picker.cc2
-rw-r--r--chrome/browser/ui/views/wrench_menu.cc2
143 files changed, 1731 insertions, 136 deletions
diff --git a/chrome/browser/ui/app_modal_dialogs/message_box_handler.cc b/chrome/browser/ui/app_modal_dialogs/message_box_handler.cc
index 751f85a..d40f924 100644
--- a/chrome/browser/ui/app_modal_dialogs/message_box_handler.cc
+++ b/chrome/browser/ui/app_modal_dialogs/message_box_handler.cc
@@ -12,7 +12,7 @@
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/extensions_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h"
#include "chrome/browser/ui/app_modal_dialogs/js_modal_dialog.h"
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 0a375ea..75e2e04 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -63,7 +63,7 @@
#include "chrome/browser/platform_util.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/renderer_host/site_instance.h"
#include "chrome/browser/sessions/session_service.h"
diff --git a/chrome/browser/ui/browser_init.cc b/chrome/browser/ui/browser_init.cc
index ff62f6f..cb1d465 100644
--- a/chrome/browser/ui/browser_init.cc
+++ b/chrome/browser/ui/browser_init.cc
@@ -38,7 +38,7 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/prefs/session_startup_pref.h"
#include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_host/render_process_host.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
diff --git a/chrome/browser/ui/browser_list.cc b/chrome/browser/ui/browser_list.cc
index f5965fb..162d14b 100644
--- a/chrome/browser/ui/browser_list.cc
+++ b/chrome/browser/ui/browser_list.cc
@@ -11,7 +11,7 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_shutdown.h"
#include "chrome/browser/browser_window.h"
-#include "chrome/browser/profile_manager.h"
+#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/renderer_host/render_process_host.h"
#include "chrome/browser/tab_contents/navigation_controller.h"
#include "chrome/common/notification_registrar.h"
diff --git a/chrome/browser/ui/browser_navigator.cc b/chrome/browser/ui/browser_navigator.cc
index 72d9d54..9f50a36 100644
--- a/chrome/browser/ui/browser_navigator.cc
+++ b/chrome/browser/ui/browser_navigator.cc
@@ -8,7 +8,7 @@
#include "chrome/browser/browser_list.h"
#include "chrome/browser/browser_url_handler.h"
#include "chrome/browser/browser_window.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_host/site_instance.h"
#include "chrome/browser/tabs/tab_strip_model.h"
#include "chrome/browser/tab_contents/tab_contents.h"
diff --git a/chrome/browser/ui/browser_navigator_browsertest.cc b/chrome/browser/ui/browser_navigator_browsertest.cc
index 87d38e5..37bb0de 100644
--- a/chrome/browser/ui/browser_navigator_browsertest.cc
+++ b/chrome/browser/ui/browser_navigator_browsertest.cc
@@ -3,7 +3,7 @@
// found in the LICENSE file.
#include "base/command_line.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents_view.h"
#include "chrome/browser/tabs/tab_strip_model.h"
diff --git a/chrome/browser/ui/cocoa/applescript/bookmark_item_applescript.mm b/chrome/browser/ui/cocoa/applescript/bookmark_item_applescript.mm
index 9df8a31..f077552 100644
--- a/chrome/browser/ui/cocoa/applescript/bookmark_item_applescript.mm
+++ b/chrome/browser/ui/cocoa/applescript/bookmark_item_applescript.mm
@@ -6,7 +6,7 @@
#include "base/sys_string_conversions.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
-#include "chrome/browser/profile_manager.h"
+#include "chrome/browser/profiles/profile_manager.h"
#import "chrome/browser/ui/cocoa/applescript/error_applescript.h"
@interface BookmarkItemAppleScript()
diff --git a/chrome/browser/ui/cocoa/applescript/bookmark_node_applescript.mm b/chrome/browser/ui/cocoa/applescript/bookmark_node_applescript.mm
index dc0c14e..3dabbbe 100644
--- a/chrome/browser/ui/cocoa/applescript/bookmark_node_applescript.mm
+++ b/chrome/browser/ui/cocoa/applescript/bookmark_node_applescript.mm
@@ -10,7 +10,7 @@
#import "chrome/browser/app_controller_mac.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#import "chrome/browser/chrome_browser_application_mac.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#import "chrome/browser/ui/cocoa/applescript/bookmark_item_applescript.h"
#import "chrome/browser/ui/cocoa/applescript/error_applescript.h"
diff --git a/chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript.mm b/chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript.mm
index 240ef0d..c8659b7 100644
--- a/chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript.mm
+++ b/chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript.mm
@@ -9,7 +9,7 @@
#import "chrome/browser/app_controller_mac.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/browser_list.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#import "chrome/browser/ui/cocoa/applescript/bookmark_folder_applescript.h"
#import "chrome/browser/ui/cocoa/applescript/constants_applescript.h"
#import "chrome/browser/ui/cocoa/applescript/error_applescript.h"
diff --git a/chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript_test.mm b/chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript_test.mm
index a2e0f48..269a9ec 100644
--- a/chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript_test.mm
+++ b/chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript_test.mm
@@ -4,7 +4,7 @@
#import <Cocoa/Cocoa.h>
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#import "chrome/browser/ui/cocoa/applescript/browsercrapplication+applescript.h"
#import "chrome/browser/ui/cocoa/applescript/constants_applescript.h"
diff --git a/chrome/browser/ui/cocoa/applescript/window_applescript.mm b/chrome/browser/ui/cocoa/applescript/window_applescript.mm
index 6a7ee4a..d6c7b5a 100644
--- a/chrome/browser/ui/cocoa/applescript/window_applescript.mm
+++ b/chrome/browser/ui/cocoa/applescript/window_applescript.mm
@@ -10,7 +10,7 @@
#include "base/time.h"
#import "chrome/browser/app_controller_mac.h"
#import "chrome/browser/chrome_browser_application_mac.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tabs/tab_strip_model.h"
#include "chrome/browser/ui/browser.h"
diff --git a/chrome/browser/ui/cocoa/applescript/window_applescript_test.mm b/chrome/browser/ui/cocoa/applescript/window_applescript_test.mm
index b40e5d5..96eb930 100644
--- a/chrome/browser/ui/cocoa/applescript/window_applescript_test.mm
+++ b/chrome/browser/ui/cocoa/applescript/window_applescript_test.mm
@@ -8,7 +8,7 @@
#include "base/sys_string_conversions.h"
#import "chrome/browser/app_controller_mac.h"
#import "chrome/browser/chrome_browser_application_mac.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#import "chrome/browser/ui/cocoa/applescript/constants_applescript.h"
#import "chrome/browser/ui/cocoa/applescript/error_applescript.h"
#import "chrome/browser/ui/cocoa/applescript/tab_applescript.h"
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
index f8ed23f..c08aae0 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
@@ -13,7 +13,7 @@
#include "chrome/browser/bookmarks/bookmark_utils.h"
#include "chrome/browser/metrics/user_metrics.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents_view.h"
#import "chrome/browser/themes/browser_theme_provider.h"
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_drag_source.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_drag_source.mm
index 64ae1d9..85ea1b9 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_drag_source.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_drag_source.mm
@@ -5,7 +5,7 @@
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_drag_source.h"
#include "chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/tab_contents_view_mac.h"
@implementation BookmarkDragSource
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.mm
index 14aa78e..ffc9d69 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller.mm
@@ -12,7 +12,7 @@
#include "base/mac_util.h"
#include "base/sys_string_conversions.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_all_tabs_controller.h"
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.h"
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_tree_browser_cell.h"
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm
index fbe5f10..2918b5f 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm
@@ -10,8 +10,8 @@
#include "base/sys_string_conversions.h"
#import "chrome/browser/app_controller_mac.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
-#include "chrome/browser/profile.h"
-#include "chrome/browser/profile_manager.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.h"
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.mm
index 8c34af2..b4f23d2 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.mm
@@ -8,7 +8,7 @@
#include "app/l10n_util_mac.h"
#include "base/mac_util.h"
#include "base/sys_string_conversions.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/cocoa/bookmarks/bookmark_model_observer_for_cocoa.h"
#include "grit/generated_resources.h"
diff --git a/chrome/browser/ui/cocoa/browser_test_helper.h b/chrome/browser/ui/cocoa/browser_test_helper.h
index 4b5b6a9..c8df25c 100644
--- a/chrome/browser/ui/cocoa/browser_test_helper.h
+++ b/chrome/browser/ui/cocoa/browser_test_helper.h
@@ -7,7 +7,7 @@
#pragma once
#include "chrome/browser/browser_thread.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/test/testing_profile.h"
diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.mm b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
index 08bdea0..d1e7f97 100644
--- a/chrome/browser/ui/cocoa/browser_window_cocoa.mm
+++ b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
@@ -15,7 +15,7 @@
#include "chrome/browser/global_keyboard_shortcuts_mac.h"
#include "chrome/browser/page_info_window.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sidebar/sidebar_container.h"
#include "chrome/browser/sidebar/sidebar_manager.h"
#include "chrome/browser/tab_contents/tab_contents.h"
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm
index a7ba862..56311bc 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -16,7 +16,7 @@
#include "chrome/app/chrome_command_ids.h" // IDC_*
#include "chrome/browser/bookmarks/bookmark_editor.h"
#include "chrome/browser/google/google_util.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_host/render_widget_host_view.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/sync_ui_util_mac.h"
diff --git a/chrome/browser/ui/cocoa/browser_window_controller_private.mm b/chrome/browser/ui/cocoa/browser_window_controller_private.mm
index 62d0a4f..73a4619 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller_private.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller_private.mm
@@ -8,7 +8,7 @@
#import "base/scoped_nsobject.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_host/render_widget_host_view.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents_view.h"
diff --git a/chrome/browser/ui/cocoa/bug_report_window_controller_unittest.mm b/chrome/browser/ui/cocoa/bug_report_window_controller_unittest.mm
index b95f251..9870639 100644
--- a/chrome/browser/ui/cocoa/bug_report_window_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/bug_report_window_controller_unittest.mm
@@ -6,7 +6,7 @@
#include "base/ref_counted.h"
#include "chrome/browser/browser_thread.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_host/site_instance.h"
#include "chrome/browser/renderer_host/test/test_render_view_host.h"
#include "chrome/browser/tab_contents/test_tab_contents.h"
diff --git a/chrome/browser/ui/cocoa/clear_browsing_data_controller.mm b/chrome/browser/ui/cocoa/clear_browsing_data_controller.mm
index 927c2e4..d59e89e 100644
--- a/chrome/browser/ui/cocoa/clear_browsing_data_controller.mm
+++ b/chrome/browser/ui/cocoa/clear_browsing_data_controller.mm
@@ -10,7 +10,7 @@
#include "base/singleton.h"
#include "chrome/browser/browsing_data_remover.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/common/pref_names.h"
diff --git a/chrome/browser/ui/cocoa/clear_browsing_data_controller_unittest.mm b/chrome/browser/ui/cocoa/clear_browsing_data_controller_unittest.mm
index 208cfa4..d5f238a 100644
--- a/chrome/browser/ui/cocoa/clear_browsing_data_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/clear_browsing_data_controller_unittest.mm
@@ -7,7 +7,7 @@
#include "base/scoped_nsobject.h"
#include "chrome/browser/browsing_data_remover.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/cocoa/browser_test_helper.h"
#import "chrome/browser/ui/cocoa/clear_browsing_data_controller.h"
#import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
diff --git a/chrome/browser/ui/cocoa/collected_cookies_mac.mm b/chrome/browser/ui/cocoa/collected_cookies_mac.mm
index 7a79680..b54c9d7 100644
--- a/chrome/browser/ui/cocoa/collected_cookies_mac.mm
+++ b/chrome/browser/ui/cocoa/collected_cookies_mac.mm
@@ -10,7 +10,7 @@
#include "app/resource_bundle.h"
#import "base/mac_util.h"
#include "base/sys_string_conversions.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#import "chrome/browser/ui/cocoa/vertical_gradient_view.h"
#include "chrome/common/notification_service.h"
diff --git a/chrome/browser/ui/cocoa/collected_cookies_mac_unittest.mm b/chrome/browser/ui/cocoa/collected_cookies_mac_unittest.mm
index f04c134..a7bc6b7 100644
--- a/chrome/browser/ui/cocoa/collected_cookies_mac_unittest.mm
+++ b/chrome/browser/ui/cocoa/collected_cookies_mac_unittest.mm
@@ -5,7 +5,7 @@
#import <Cocoa/Cocoa.h>
#include "base/ref_counted.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_host/site_instance.h"
#include "chrome/browser/renderer_host/test/test_render_view_host.h"
#include "chrome/browser/tab_contents/test_tab_contents.h"
diff --git a/chrome/browser/ui/cocoa/constrained_html_delegate_mac.mm b/chrome/browser/ui/cocoa/constrained_html_delegate_mac.mm
index 8d5b024..9e0344e 100644
--- a/chrome/browser/ui/cocoa/constrained_html_delegate_mac.mm
+++ b/chrome/browser/ui/cocoa/constrained_html_delegate_mac.mm
@@ -7,7 +7,7 @@
#include "base/scoped_nsobject.h"
#include "chrome/browser/dom_ui/html_dialog_ui.h"
#include "chrome/browser/dom_ui/html_dialog_tab_contents_delegate.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/ui/cocoa/constrained_window_mac.h"
#import <Cocoa/Cocoa.h>
diff --git a/chrome/browser/ui/cocoa/content_settings_dialog_controller.mm b/chrome/browser/ui/cocoa/content_settings_dialog_controller.mm
index 855dc3a..f61c77a 100644
--- a/chrome/browser/ui/cocoa/content_settings_dialog_controller.mm
+++ b/chrome/browser/ui/cocoa/content_settings_dialog_controller.mm
@@ -17,7 +17,7 @@
#import "chrome/browser/notifications/notification_exceptions_table_model.h"
#include "chrome/browser/plugin_exceptions_table_model.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
#import "chrome/browser/ui/cocoa/content_exceptions_window_controller.h"
diff --git a/chrome/browser/ui/cocoa/cookies_window_controller.mm b/chrome/browser/ui/cocoa/cookies_window_controller.mm
index ac95301..bf1bf68 100644
--- a/chrome/browser/ui/cocoa/cookies_window_controller.mm
+++ b/chrome/browser/ui/cocoa/cookies_window_controller.mm
@@ -12,7 +12,7 @@
#import "base/mac_util.h"
#include "base/sys_string_conversions.h"
#include "chrome/browser/browsing_data_remover.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/cocoa/clear_browsing_data_controller.h"
#include "chrome/browser/ui/cocoa/cookie_details_view_controller.h"
#include "grit/generated_resources.h"
diff --git a/chrome/browser/ui/cocoa/cookies_window_controller_unittest.mm b/chrome/browser/ui/cocoa/cookies_window_controller_unittest.mm
index 9f3f410..e88f4d3 100644
--- a/chrome/browser/ui/cocoa/cookies_window_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/cookies_window_controller_unittest.mm
@@ -14,7 +14,7 @@
#include "chrome/browser/mock_browsing_data_database_helper.h"
#include "chrome/browser/mock_browsing_data_local_storage_helper.h"
#include "chrome/browser/mock_browsing_data_appcache_helper.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/cocoa/browser_test_helper.h"
#include "chrome/browser/ui/cocoa/clear_browsing_data_controller.h"
#include "chrome/browser/ui/cocoa/cocoa_test_helper.h"
diff --git a/chrome/browser/ui/cocoa/download/download_shelf_controller.mm b/chrome/browser/ui/cocoa/download/download_shelf_controller.mm
index 436fb13..41b0b6a 100644
--- a/chrome/browser/ui/cocoa/download/download_shelf_controller.mm
+++ b/chrome/browser/ui/cocoa/download/download_shelf_controller.mm
@@ -10,7 +10,7 @@
#include "base/sys_string_conversions.h"
#include "chrome/browser/download/download_item.h"
#include "chrome/browser/download/download_manager.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/themes/browser_theme_provider.h"
#include "chrome/browser/ui/browser.h"
#import "chrome/browser/ui/cocoa/animatable_view.h"
diff --git a/chrome/browser/ui/cocoa/encoding_menu_controller_delegate_mac.mm b/chrome/browser/ui/cocoa/encoding_menu_controller_delegate_mac.mm
index 44d66b1..775ffdc 100644
--- a/chrome/browser/ui/cocoa/encoding_menu_controller_delegate_mac.mm
+++ b/chrome/browser/ui/cocoa/encoding_menu_controller_delegate_mac.mm
@@ -9,7 +9,7 @@
#include "base/string16.h"
#include "base/sys_string_conversions.h"
#include "chrome/app/chrome_command_ids.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/toolbar/encoding_menu_controller.h"
diff --git a/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm b/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm
index 2ae72a4..e0d7b87 100644
--- a/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm
+++ b/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm
@@ -14,7 +14,7 @@
#include "chrome/browser/extensions/extension_toolbar_model.h"
#include "chrome/browser/extensions/extensions_service.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/ui/browser.h"
#import "chrome/browser/ui/cocoa/extensions/browser_action_button.h"
diff --git a/chrome/browser/ui/cocoa/extensions/extension_action_context_menu.mm b/chrome/browser/ui/cocoa/extensions/extension_action_context_menu.mm
index df25dba..ff97fd7 100644
--- a/chrome/browser/ui/cocoa/extensions/extension_action_context_menu.mm
+++ b/chrome/browser/ui/cocoa/extensions/extension_action_context_menu.mm
@@ -13,7 +13,7 @@
#include "chrome/browser/extensions/extension_tabs_module.h"
#include "chrome/browser/prefs/pref_change_registrar.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/cocoa/browser_window_cocoa.h"
#include "chrome/browser/ui/cocoa/browser_window_controller.h"
#include "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h"
diff --git a/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm
index bf3408e..86516ba 100644
--- a/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm
+++ b/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm
@@ -9,7 +9,7 @@
#include "chrome/browser/debugger/devtools_manager.h"
#include "chrome/browser/extensions/extension_host.h"
#include "chrome/browser/extensions/extension_process_manager.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#import "chrome/browser/ui/cocoa/browser_window_cocoa.h"
#import "chrome/browser/ui/cocoa/extension_view_mac.h"
diff --git a/chrome/browser/ui/cocoa/font_language_settings_controller.mm b/chrome/browser/ui/cocoa/font_language_settings_controller.mm
index b3bdb980..4beff2a 100644
--- a/chrome/browser/ui/cocoa/font_language_settings_controller.mm
+++ b/chrome/browser/ui/cocoa/font_language_settings_controller.mm
@@ -10,7 +10,7 @@
#include "chrome/browser/character_encoding.h"
#include "chrome/browser/fonts_languages_window.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
NSString* const kCharacterInfoEncoding = @"encoding";
diff --git a/chrome/browser/ui/cocoa/font_language_settings_controller_unittest.mm b/chrome/browser/ui/cocoa/font_language_settings_controller_unittest.mm
index 9b0b259..48e4a24 100644
--- a/chrome/browser/ui/cocoa/font_language_settings_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/font_language_settings_controller_unittest.mm
@@ -4,7 +4,7 @@
#include "base/scoped_nsobject.h"
#include "chrome/browser/character_encoding.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/cocoa/browser_test_helper.h"
#import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
#import "chrome/browser/ui/cocoa/font_language_settings_controller.h"
diff --git a/chrome/browser/ui/cocoa/history_menu_bridge.mm b/chrome/browser/ui/cocoa/history_menu_bridge.mm
index 320632f..36cb9b7 100644
--- a/chrome/browser/ui/cocoa/history_menu_bridge.mm
+++ b/chrome/browser/ui/cocoa/history_menu_bridge.mm
@@ -14,7 +14,7 @@
#include "chrome/app/chrome_command_ids.h" // IDC_HISTORY_MENU
#import "chrome/browser/app_controller_mac.h"
#include "chrome/browser/history/page_usage_data.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sessions/session_types.h"
#import "chrome/browser/ui/cocoa/history_menu_cocoa_controller.h"
#include "chrome/common/notification_registrar.h"
diff --git a/chrome/browser/ui/cocoa/history_menu_cocoa_controller.mm b/chrome/browser/ui/cocoa/history_menu_cocoa_controller.mm
index 79aef69..e3dead5 100644
--- a/chrome/browser/ui/cocoa/history_menu_cocoa_controller.mm
+++ b/chrome/browser/ui/cocoa/history_menu_cocoa_controller.mm
@@ -10,7 +10,7 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/history/history.h"
#include "chrome/browser/history/history_types.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/cocoa/event_utils.h"
diff --git a/chrome/browser/ui/cocoa/html_dialog_window_controller.mm b/chrome/browser/ui/cocoa/html_dialog_window_controller.mm
index aa219b28..611ecdd 100644
--- a/chrome/browser/ui/cocoa/html_dialog_window_controller.mm
+++ b/chrome/browser/ui/cocoa/html_dialog_window_controller.mm
@@ -10,7 +10,7 @@
#include "base/sys_string_conversions.h"
#include "chrome/browser/dom_ui/html_dialog_ui.h"
#include "chrome/browser/dom_ui/html_dialog_tab_contents_delegate.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#import "chrome/browser/ui/cocoa/browser_command_executor.h"
#import "chrome/browser/ui/cocoa/chrome_event_processing_window.h"
diff --git a/chrome/browser/ui/cocoa/import_settings_dialog.mm b/chrome/browser/ui/cocoa/import_settings_dialog.mm
index 59a9140..2989d06 100644
--- a/chrome/browser/ui/cocoa/import_settings_dialog.mm
+++ b/chrome/browser/ui/cocoa/import_settings_dialog.mm
@@ -8,7 +8,7 @@
#include "base/sys_string_conversions.h"
#include "chrome/browser/importer/importer_data_types.h"
#include "chrome/browser/importer/importer_list.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
namespace {
diff --git a/chrome/browser/ui/cocoa/instant_confirm_window_controller.mm b/chrome/browser/ui/cocoa/instant_confirm_window_controller.mm
index 744a26e..6299170 100644
--- a/chrome/browser/ui/cocoa/instant_confirm_window_controller.mm
+++ b/chrome/browser/ui/cocoa/instant_confirm_window_controller.mm
@@ -8,7 +8,7 @@
#include "base/mac_util.h"
#include "chrome/browser/instant/instant_confirm_dialog.h"
#include "chrome/browser/instant/instant_controller.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/options/show_options_url.h"
#include "gfx/native_widget_types.h"
#include "googleurl/src/gurl.h"
diff --git a/chrome/browser/ui/cocoa/keystone_infobar.mm b/chrome/browser/ui/cocoa/keystone_infobar.mm
index 60635d6..09c0d8c 100644
--- a/chrome/browser/ui/cocoa/keystone_infobar.mm
+++ b/chrome/browser/ui/cocoa/keystone_infobar.mm
@@ -15,7 +15,7 @@
#include "base/task.h"
#include "chrome/browser/first_run/first_run.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/infobar_delegate.h"
#include "chrome/browser/tab_contents/navigation_controller.h"
#include "chrome/browser/tab_contents/tab_contents.h"
diff --git a/chrome/browser/ui/cocoa/keyword_editor_cocoa_controller.mm b/chrome/browser/ui/cocoa/keyword_editor_cocoa_controller.mm
index 109fcd9..0f2271e 100644
--- a/chrome/browser/ui/cocoa/keyword_editor_cocoa_controller.mm
+++ b/chrome/browser/ui/cocoa/keyword_editor_cocoa_controller.mm
@@ -11,7 +11,7 @@
#include "base/sys_string_conversions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/search_engines/template_url_table_model.h"
#import "chrome/browser/ui/cocoa/edit_search_engine_cocoa_controller.h"
diff --git a/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm b/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm
index af5339a..523eb6f 100644
--- a/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm
@@ -15,7 +15,7 @@
#include "chrome/browser/content_setting_image_model.h"
#include "chrome/browser/content_setting_bubble_model.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#import "chrome/browser/ui/cocoa/content_setting_bubble_cocoa.h"
#import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h"
diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
index 4ed6ba2..d9d394e 100644
--- a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
+++ b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
@@ -25,7 +25,7 @@
#include "chrome/browser/extensions/extensions_service.h"
#include "chrome/browser/extensions/extension_tabs_module.h"
#include "chrome/browser/instant/instant_controller.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
diff --git a/chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm b/chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm
index 610815c..9f4d801 100644
--- a/chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm
@@ -9,7 +9,7 @@
#include "base/sys_string_conversions.h"
#include "chrome/browser/extensions/extension_browser_event_router.h"
#include "chrome/browser/extensions/extensions_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#import "chrome/browser/ui/cocoa/extensions/extension_action_context_menu.h"
#import "chrome/browser/ui/cocoa/extensions/extension_popup_controller.h"
diff --git a/chrome/browser/ui/cocoa/notifications/balloon_controller.mm b/chrome/browser/ui/cocoa/notifications/balloon_controller.mm
index 2a80512..98bb473 100644
--- a/chrome/browser/ui/cocoa/notifications/balloon_controller.mm
+++ b/chrome/browser/ui/cocoa/notifications/balloon_controller.mm
@@ -15,7 +15,7 @@
#include "chrome/browser/notifications/desktop_notification_service.h"
#include "chrome/browser/notifications/notification.h"
#include "chrome/browser/notifications/notification_options_menu_model.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#import "chrome/browser/ui/cocoa/hover_image_button.h"
#import "chrome/browser/ui/cocoa/menu_controller.h"
diff --git a/chrome/browser/ui/cocoa/page_info_bubble_controller.mm b/chrome/browser/ui/cocoa/page_info_bubble_controller.mm
index 519c759..1e3bc94 100644
--- a/chrome/browser/ui/cocoa/page_info_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/page_info_bubble_controller.mm
@@ -13,7 +13,7 @@
#include "chrome/browser/cert_store.h"
#include "chrome/browser/certificate_viewer.h"
#include "chrome/browser/google/google_util.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#import "chrome/browser/ui/cocoa/browser_window_controller.h"
#import "chrome/browser/ui/cocoa/hyperlink_button_cell.h"
#import "chrome/browser/ui/cocoa/info_bubble_view.h"
diff --git a/chrome/browser/ui/cocoa/preferences_window_controller.mm b/chrome/browser/ui/cocoa/preferences_window_controller.mm
index e255f62..78e82df 100644
--- a/chrome/browser/ui/cocoa/preferences_window_controller.mm
+++ b/chrome/browser/ui/cocoa/preferences_window_controller.mm
@@ -31,7 +31,7 @@
#include "chrome/browser/policy/managed_prefs_banner_base.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/prefs/session_startup_pref.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/browser/shell_integration.h"
#include "chrome/browser/sync/profile_sync_service.h"
diff --git a/chrome/browser/ui/cocoa/search_engine_dialog_controller.mm b/chrome/browser/ui/cocoa/search_engine_dialog_controller.mm
index 6cf7911..9ee6ae8 100644
--- a/chrome/browser/ui/cocoa/search_engine_dialog_controller.mm
+++ b/chrome/browser/ui/cocoa/search_engine_dialog_controller.mm
@@ -12,7 +12,7 @@
#include "base/nsimage_cache_mac.h"
#include "base/sys_string_conversions.h"
#include "base/time.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/search_engines/template_url_model_observer.h"
diff --git a/chrome/browser/ui/cocoa/search_engine_list_model_unittest.mm b/chrome/browser/ui/cocoa/search_engine_list_model_unittest.mm
index c95c75c..a59bcec 100644
--- a/chrome/browser/ui/cocoa/search_engine_list_model_unittest.mm
+++ b/chrome/browser/ui/cocoa/search_engine_list_model_unittest.mm
@@ -3,7 +3,7 @@
// found in the LICENSE file.
#include "base/scoped_nsobject.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/ui/cocoa/browser_test_helper.h"
diff --git a/chrome/browser/ui/cocoa/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tab_strip_controller.mm
index 0b18213..7d4a5d9 100644
--- a/chrome/browser/ui/cocoa/tab_strip_controller.mm
+++ b/chrome/browser/ui/cocoa/tab_strip_controller.mm
@@ -16,7 +16,7 @@
#include "base/sys_string_conversions.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/metrics/user_metrics.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/debugger/devtools_window.h"
#include "chrome/browser/net/url_fixer_upper.h"
#include "chrome/browser/sidebar/sidebar_container.h"
diff --git a/chrome/browser/ui/cocoa/toolbar_controller.mm b/chrome/browser/ui/cocoa/toolbar_controller.mm
index 1383e08..669657b 100644
--- a/chrome/browser/ui/cocoa/toolbar_controller.mm
+++ b/chrome/browser/ui/cocoa/toolbar_controller.mm
@@ -18,7 +18,7 @@
#include "chrome/browser/autocomplete/autocomplete_edit_view.h"
#include "chrome/browser/net/url_fixer_upper.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/themes/browser_theme_provider.h"
diff --git a/chrome/browser/ui/cocoa/view_id_util_browsertest.mm b/chrome/browser/ui/cocoa/view_id_util_browsertest.mm
index ff4c35d..8d10b4c 100644
--- a/chrome/browser/ui/cocoa/view_id_util_browsertest.mm
+++ b/chrome/browser/ui/cocoa/view_id_util_browsertest.mm
@@ -8,7 +8,7 @@
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/download/download_shelf.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sidebar/sidebar_manager.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
diff --git a/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc b/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc
index e37e43a..ff392e4 100644
--- a/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc
+++ b/chrome/browser/ui/find_bar/find_bar_host_browsertest.cc
@@ -6,7 +6,7 @@
#include "base/message_loop.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents_view.h"
diff --git a/chrome/browser/ui/find_bar/find_bar_state.cc b/chrome/browser/ui/find_bar/find_bar_state.cc
index 667ac53..d4f2cc1 100644
--- a/chrome/browser/ui/find_bar/find_bar_state.cc
+++ b/chrome/browser/ui/find_bar/find_bar_state.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/find_bar/find_bar_state.h"
// static
diff --git a/chrome/browser/ui/login/login_model.h b/chrome/browser/ui/login/login_model.h
new file mode 100644
index 0000000..94d3478
--- /dev/null
+++ b/chrome/browser/ui/login/login_model.h
@@ -0,0 +1,35 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_LOGIN_LOGIN_MODEL_H_
+#define CHROME_BROWSER_UI_LOGIN_LOGIN_MODEL_H_
+#pragma once
+
+#include <string>
+
+// Simple Model & Observer interfaces for a LoginView to facilitate exchanging
+// information.
+class LoginModelObserver {
+ public:
+ // Called by the model when a username,password pair has been identified
+ // as a match for the pending login prompt.
+ virtual void OnAutofillDataAvailable(const std::wstring& username,
+ const std::wstring& password) = 0;
+
+ protected:
+ virtual ~LoginModelObserver() {}
+};
+
+class LoginModel {
+ public:
+ // Set the observer interested in the data from the model.
+ // observer can be null, signifying there is no longer any observer
+ // interested in the data.
+ virtual void SetObserver(LoginModelObserver* observer) = 0;
+
+ protected:
+ virtual ~LoginModel() {}
+};
+
+#endif // CHROME_BROWSER_UI_LOGIN_LOGIN_MODEL_H_
diff --git a/chrome/browser/ui/login/login_prompt.cc b/chrome/browser/ui/login/login_prompt.cc
new file mode 100644
index 0000000..d653457
--- /dev/null
+++ b/chrome/browser/ui/login/login_prompt.cc
@@ -0,0 +1,453 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/login/login_prompt.h"
+
+#include <vector>
+
+#include "app/l10n_util.h"
+#include "base/command_line.h"
+#include "base/lock.h"
+#include "base/utf_string_conversions.h"
+#include "chrome/browser/browser_thread.h"
+#include "chrome/browser/password_manager/password_manager.h"
+#include "chrome/browser/renderer_host/render_process_host.h"
+#include "chrome/browser/renderer_host/resource_dispatcher_host.h"
+#include "chrome/browser/renderer_host/resource_dispatcher_host_request_info.h"
+#include "chrome/browser/tab_contents/constrained_window.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
+#include "chrome/browser/tab_contents/tab_util.h"
+#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
+#include "chrome/common/chrome_switches.h"
+#include "chrome/common/notification_service.h"
+#include "grit/generated_resources.h"
+#include "net/base/auth.h"
+#include "net/base/net_util.h"
+#include "net/url_request/url_request.h"
+
+using webkit_glue::PasswordForm;
+
+class LoginHandlerImpl;
+
+// Helper to remove the ref from an net::URLRequest to the LoginHandler.
+// Should only be called from the IO thread, since it accesses an
+// net::URLRequest.
+void ResetLoginHandlerForRequest(net::URLRequest* request) {
+ ResourceDispatcherHostRequestInfo* info =
+ ResourceDispatcherHost::InfoForRequest(request);
+ if (!info)
+ return;
+
+ info->set_login_handler(NULL);
+}
+
+// Get the signon_realm under which this auth info should be stored.
+//
+// The format of the signon_realm for proxy auth is:
+// proxy-host/auth-realm
+// The format of the signon_realm for server auth is:
+// url-scheme://url-host[:url-port]/auth-realm
+//
+// Be careful when changing this function, since you could make existing
+// saved logins un-retrievable.
+std::string GetSignonRealm(const GURL& url,
+ const net::AuthChallengeInfo& auth_info) {
+ std::string signon_realm;
+ if (auth_info.is_proxy) {
+ signon_realm = WideToASCII(auth_info.host_and_port);
+ signon_realm.append("/");
+ } else {
+ // Take scheme, host, and port from the url.
+ signon_realm = url.GetOrigin().spec();
+ // This ends with a "/".
+ }
+ signon_realm.append(WideToUTF8(auth_info.realm));
+ return signon_realm;
+}
+
+// ----------------------------------------------------------------------------
+// LoginHandler
+
+LoginHandler::LoginHandler(net::AuthChallengeInfo* auth_info,
+ net::URLRequest* request)
+ : handled_auth_(false),
+ dialog_(NULL),
+ auth_info_(auth_info),
+ request_(request),
+ password_manager_(NULL),
+ login_model_(NULL) {
+ // This constructor is called on the I/O thread, so we cannot load the nib
+ // here. BuildViewForPasswordManager() will be invoked on the UI thread
+ // later, so wait with loading the nib until then.
+ DCHECK(request_) << "LoginHandler constructed with NULL request";
+ DCHECK(auth_info_) << "LoginHandler constructed with NULL auth info";
+
+ AddRef(); // matched by LoginHandler::ReleaseSoon().
+
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ NewRunnableMethod(this, &LoginHandler::AddObservers));
+
+ if (!ResourceDispatcherHost::RenderViewForRequest(
+ request_, &render_process_host_id_, &tab_contents_id_)) {
+ NOTREACHED();
+ }
+}
+
+LoginHandler::~LoginHandler() {
+ SetModel(NULL);
+}
+
+void LoginHandler::SetPasswordForm(const webkit_glue::PasswordForm& form) {
+ password_form_ = form;
+}
+
+void LoginHandler::SetPasswordManager(PasswordManager* password_manager) {
+ password_manager_ = password_manager;
+}
+
+TabContents* LoginHandler::GetTabContentsForLogin() const {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ return tab_util::GetTabContentsByID(render_process_host_id_,
+ tab_contents_id_);
+}
+
+void LoginHandler::SetAuth(const std::wstring& username,
+ const std::wstring& password) {
+ if (WasAuthHandled(true))
+ return;
+
+ // Tell the password manager the credentials were submitted / accepted.
+ if (password_manager_) {
+ password_form_.username_value = WideToUTF16Hack(username);
+ password_form_.password_value = WideToUTF16Hack(password);
+ password_manager_->ProvisionallySavePassword(password_form_);
+ }
+
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ NewRunnableMethod(this, &LoginHandler::CloseContentsDeferred));
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ NewRunnableMethod(
+ this, &LoginHandler::NotifyAuthSupplied, username, password));
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ NewRunnableMethod(
+ this, &LoginHandler::SetAuthDeferred, username, password));
+}
+
+void LoginHandler::CancelAuth() {
+ if (WasAuthHandled(true))
+ return;
+
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ NewRunnableMethod(this, &LoginHandler::CloseContentsDeferred));
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ NewRunnableMethod(this, &LoginHandler::NotifyAuthCancelled));
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ NewRunnableMethod(this, &LoginHandler::CancelAuthDeferred));
+}
+
+void LoginHandler::OnRequestCancelled() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)) <<
+ "Why is OnRequestCancelled called from the UI thread?";
+
+ // Reference is no longer valid.
+ request_ = NULL;
+
+ // Give up on auth if the request was cancelled.
+ CancelAuth();
+}
+
+void LoginHandler::AddObservers() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ registrar_.Add(this, NotificationType::AUTH_SUPPLIED,
+ NotificationService::AllSources());
+ registrar_.Add(this, NotificationType::AUTH_CANCELLED,
+ NotificationService::AllSources());
+}
+
+void LoginHandler::RemoveObservers() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ registrar_.Remove(this, NotificationType::AUTH_SUPPLIED,
+ NotificationService::AllSources());
+ registrar_.Remove(this, NotificationType::AUTH_CANCELLED,
+ NotificationService::AllSources());
+
+ DCHECK(registrar_.IsEmpty());
+}
+
+void LoginHandler::Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK(type == NotificationType::AUTH_SUPPLIED ||
+ type == NotificationType::AUTH_CANCELLED);
+
+ TabContents* requesting_contents = GetTabContentsForLogin();
+ if (!requesting_contents)
+ return;
+
+ NavigationController* this_controller = &requesting_contents->controller();
+ NavigationController* that_controller =
+ Source<NavigationController>(source).ptr();
+
+ // Only handle notifications from other handlers.
+ if (this_controller == that_controller)
+ return;
+
+ LoginNotificationDetails* login_details =
+ Details<LoginNotificationDetails>(details).ptr();
+
+ // Only handle notification for the identical auth info.
+ if (*login_details->handler()->auth_info() != *auth_info())
+ return;
+
+ // Set or cancel the auth in this handler.
+ if (type == NotificationType::AUTH_SUPPLIED) {
+ AuthSuppliedLoginNotificationDetails* supplied_details =
+ Details<AuthSuppliedLoginNotificationDetails>(details).ptr();
+ SetAuth(supplied_details->username(), supplied_details->password());
+ } else {
+ DCHECK(type == NotificationType::AUTH_CANCELLED);
+ CancelAuth();
+ }
+}
+
+void LoginHandler::SetModel(LoginModel* model) {
+ if (login_model_)
+ login_model_->SetObserver(NULL);
+ login_model_ = model;
+ if (login_model_)
+ login_model_->SetObserver(this);
+}
+
+void LoginHandler::SetDialog(ConstrainedWindow* dialog) {
+ dialog_ = dialog;
+}
+
+void LoginHandler::NotifyAuthNeeded() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ if (WasAuthHandled(false))
+ return;
+
+ TabContents* requesting_contents = GetTabContentsForLogin();
+ if (!requesting_contents)
+ return;
+
+ NotificationService* service = NotificationService::current();
+ NavigationController* controller = &requesting_contents->controller();
+ LoginNotificationDetails details(this);
+
+ service->Notify(NotificationType::AUTH_NEEDED,
+ Source<NavigationController>(controller),
+ Details<LoginNotificationDetails>(&details));
+}
+
+void LoginHandler::NotifyAuthCancelled() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK(WasAuthHandled(false));
+
+ TabContents* requesting_contents = GetTabContentsForLogin();
+ if (!requesting_contents)
+ return;
+
+ NotificationService* service = NotificationService::current();
+ NavigationController* controller = &requesting_contents->controller();
+ LoginNotificationDetails details(this);
+
+ service->Notify(NotificationType::AUTH_CANCELLED,
+ Source<NavigationController>(controller),
+ Details<LoginNotificationDetails>(&details));
+}
+
+void LoginHandler::NotifyAuthSupplied(const std::wstring& username,
+ const std::wstring& password) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK(WasAuthHandled(false));
+
+ TabContents* requesting_contents = GetTabContentsForLogin();
+ if (!requesting_contents)
+ return;
+
+ NotificationService* service = NotificationService::current();
+ NavigationController* controller = &requesting_contents->controller();
+ AuthSuppliedLoginNotificationDetails details(this, username, password);
+
+ service->Notify(NotificationType::AUTH_SUPPLIED,
+ Source<NavigationController>(controller),
+ Details<AuthSuppliedLoginNotificationDetails>(&details));
+}
+
+void LoginHandler::ReleaseSoon() {
+ if (!WasAuthHandled(true)) {
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ NewRunnableMethod(this, &LoginHandler::CancelAuthDeferred));
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ NewRunnableMethod(this, &LoginHandler::NotifyAuthCancelled));
+ }
+
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ NewRunnableMethod(this, &LoginHandler::RemoveObservers));
+
+ // Delete this object once all InvokeLaters have been called.
+ BrowserThread::ReleaseSoon(BrowserThread::IO, FROM_HERE, this);
+}
+
+// Returns whether authentication had been handled (SetAuth or CancelAuth).
+// If |set_handled| is true, it will mark authentication as handled.
+bool LoginHandler::WasAuthHandled(bool set_handled) {
+ AutoLock lock(handled_auth_lock_);
+ bool was_handled = handled_auth_;
+ if (set_handled)
+ handled_auth_ = true;
+ return was_handled;
+}
+
+// Calls SetAuth from the IO loop.
+void LoginHandler::SetAuthDeferred(const std::wstring& username,
+ const std::wstring& password) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+
+ if (request_) {
+ request_->SetAuth(WideToUTF16Hack(username), WideToUTF16Hack(password));
+ ResetLoginHandlerForRequest(request_);
+ }
+}
+
+// Calls CancelAuth from the IO loop.
+void LoginHandler::CancelAuthDeferred() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+
+ if (request_) {
+ request_->CancelAuth();
+ // Verify that CancelAuth doesn't destroy the request via our delegate.
+ DCHECK(request_ != NULL);
+ ResetLoginHandlerForRequest(request_);
+ }
+}
+
+// Closes the view_contents from the UI loop.
+void LoginHandler::CloseContentsDeferred() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ // The hosting ConstrainedWindow may have been freed.
+ if (dialog_)
+ dialog_->CloseConstrainedWindow();
+}
+
+// ----------------------------------------------------------------------------
+// LoginDialogTask
+
+// This task is run on the UI thread and creates a constrained window with
+// a LoginView to prompt the user. The response will be sent to LoginHandler,
+// which then routes it to the net::URLRequest on the I/O thread.
+class LoginDialogTask : public Task {
+ public:
+ LoginDialogTask(const GURL& request_url,
+ net::AuthChallengeInfo* auth_info,
+ LoginHandler* handler)
+ : request_url_(request_url), auth_info_(auth_info), handler_(handler) {
+ }
+ virtual ~LoginDialogTask() {
+ }
+
+ void Run() {
+ TabContents* parent_contents = handler_->GetTabContentsForLogin();
+ if (!parent_contents) {
+ // The request may have been cancelled, or it may be for a renderer
+ // not hosted by a tab (e.g. an extension). Cancel just in case
+ // (cancelling twice is a no-op).
+ handler_->CancelAuth();
+ return;
+ }
+
+ // Tell the password manager to look for saved passwords.
+ TabContentsWrapper** wrapper =
+ TabContentsWrapper::property_accessor()->GetProperty(
+ parent_contents->property_bag());
+ if (!wrapper)
+ return;
+ PasswordManager* password_manager = (*wrapper)->GetPasswordManager();
+ std::vector<PasswordForm> v;
+ MakeInputForPasswordManager(&v);
+ password_manager->PasswordFormsFound(v);
+ handler_->SetPasswordManager(password_manager);
+
+ std::wstring explanation = auth_info_->realm.empty() ?
+ l10n_util::GetStringF(IDS_LOGIN_DIALOG_DESCRIPTION_NO_REALM,
+ auth_info_->host_and_port) :
+ l10n_util::GetStringF(IDS_LOGIN_DIALOG_DESCRIPTION,
+ auth_info_->host_and_port,
+ auth_info_->realm);
+ handler_->BuildViewForPasswordManager(password_manager,
+ explanation);
+ }
+
+ private:
+ // Helper to create a PasswordForm and stuff it into a vector as input
+ // for PasswordManager::PasswordFormsFound, the hook into PasswordManager.
+ void MakeInputForPasswordManager(
+ std::vector<PasswordForm>* password_manager_input) {
+ PasswordForm dialog_form;
+ if (LowerCaseEqualsASCII(auth_info_->scheme, "basic")) {
+ dialog_form.scheme = PasswordForm::SCHEME_BASIC;
+ } else if (LowerCaseEqualsASCII(auth_info_->scheme, "digest")) {
+ dialog_form.scheme = PasswordForm::SCHEME_DIGEST;
+ } else {
+ dialog_form.scheme = PasswordForm::SCHEME_OTHER;
+ }
+ std::string host_and_port(WideToASCII(auth_info_->host_and_port));
+ if (auth_info_->is_proxy) {
+ std::string origin = host_and_port;
+ // We don't expect this to already start with http:// or https://.
+ DCHECK(origin.find("http://") != 0 && origin.find("https://") != 0);
+ origin = std::string("http://") + origin;
+ dialog_form.origin = GURL(origin);
+ } else if (net::GetHostAndPort(request_url_) != host_and_port) {
+ dialog_form.origin = GURL();
+ NOTREACHED(); // crbug.com/32718
+ } else {
+ dialog_form.origin = GURL(request_url_.scheme() + "://" + host_and_port);
+ }
+ dialog_form.signon_realm = GetSignonRealm(dialog_form.origin, *auth_info_);
+ password_manager_input->push_back(dialog_form);
+ // Set the password form for the handler (by copy).
+ handler_->SetPasswordForm(dialog_form);
+ }
+
+ // The url from the net::URLRequest initiating the auth challenge.
+ GURL request_url_;
+
+ // Info about who/where/what is asking for authentication.
+ scoped_refptr<net::AuthChallengeInfo> auth_info_;
+
+ // Where to send the authentication when obtained.
+ // This is owned by the ResourceDispatcherHost that invoked us.
+ LoginHandler* handler_;
+
+ DISALLOW_COPY_AND_ASSIGN(LoginDialogTask);
+};
+
+// ----------------------------------------------------------------------------
+// Public API
+
+LoginHandler* CreateLoginPrompt(net::AuthChallengeInfo* auth_info,
+ net::URLRequest* request) {
+ LoginHandler* handler = LoginHandler::Create(auth_info, request);
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE, new LoginDialogTask(
+ request->url(), auth_info, handler));
+ return handler;
+}
diff --git a/chrome/browser/ui/login/login_prompt.h b/chrome/browser/ui/login/login_prompt.h
new file mode 100644
index 0000000..8e3d15e
--- /dev/null
+++ b/chrome/browser/ui/login/login_prompt.h
@@ -0,0 +1,214 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_LOGIN_LOGIN_PROMPT_H_
+#define CHROME_BROWSER_UI_LOGIN_LOGIN_PROMPT_H_
+#pragma once
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/lock.h"
+#include "base/ref_counted.h"
+#include "chrome/browser/password_manager/password_manager.h"
+#include "chrome/common/notification_observer.h"
+#include "chrome/common/notification_registrar.h"
+
+namespace net {
+class AuthChallengeInfo;
+class URLRequest;
+} // namespace net
+
+class ConstrainedWindow;
+class GURL;
+
+// This is the base implementation for the OS-specific classes that route
+// authentication info to the net::URLRequest that needs it. These functions
+// must be implemented in a thread safe manner.
+class LoginHandler : public base::RefCountedThreadSafe<LoginHandler>,
+ public LoginModelObserver,
+ public NotificationObserver {
+ public:
+ LoginHandler(net::AuthChallengeInfo* auth_info, net::URLRequest* request);
+ virtual ~LoginHandler();
+
+ // Builds the platform specific LoginHandler. Used from within
+ // CreateLoginPrompt() which creates tasks.
+ static LoginHandler* Create(net::AuthChallengeInfo* auth_info,
+ net::URLRequest* request);
+
+ // Initializes the underlying platform specific view.
+ virtual void BuildViewForPasswordManager(PasswordManager* manager,
+ std::wstring explanation) = 0;
+
+ // Sets information about the authentication type (|form|) and the
+ // |password_manager| for this profile.
+ void SetPasswordForm(const webkit_glue::PasswordForm& form);
+ void SetPasswordManager(PasswordManager* password_manager);
+
+ // Returns the TabContents that needs authentication.
+ TabContents* GetTabContentsForLogin() const;
+
+ // Resend the request with authentication credentials.
+ // This function can be called from either thread.
+ void SetAuth(const std::wstring& username, const std::wstring& password);
+
+ // Display the error page without asking for credentials again.
+ // This function can be called from either thread.
+ void CancelAuth();
+
+ // Notify the handler that the request was cancelled.
+ // This function can only be called from the IO thread.
+ void OnRequestCancelled();
+
+ // Implements the NotificationObserver interface.
+ // Listens for AUTH_SUPPLIED and AUTH_CANCELLED notifications from other
+ // LoginHandlers so that this LoginHandler has the chance to dismiss itself
+ // if it was waiting for the same authentication.
+ virtual void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
+
+ protected:
+ void SetModel(LoginModel* model);
+
+ void SetDialog(ConstrainedWindow* dialog);
+
+ // Notify observers that authentication is needed.
+ void NotifyAuthNeeded();
+
+ // Performs necessary cleanup before deletion.
+ void ReleaseSoon();
+
+ // Who/where/what asked for the authentication.
+ net::AuthChallengeInfo* auth_info() const { return auth_info_.get(); }
+
+ private:
+ // Starts observing notifications from other LoginHandlers.
+ void AddObservers();
+
+ // Stops observing notifications from other LoginHandlers.
+ void RemoveObservers();
+
+ // Notify observers that authentication is supplied.
+ void NotifyAuthSupplied(const std::wstring& username,
+ const std::wstring& password);
+
+ // Notify observers that authentication is cancelled.
+ void NotifyAuthCancelled();
+
+ // Returns whether authentication had been handled (SetAuth or CancelAuth).
+ // If |set_handled| is true, it will mark authentication as handled.
+ bool WasAuthHandled(bool set_handled);
+
+ // Calls SetAuth from the IO loop.
+ void SetAuthDeferred(const std::wstring& username,
+ const std::wstring& password);
+
+ // Calls CancelAuth from the IO loop.
+ void CancelAuthDeferred();
+
+ // Closes the view_contents from the UI loop.
+ void CloseContentsDeferred();
+
+ // True if we've handled auth (SetAuth or CancelAuth has been called).
+ bool handled_auth_;
+ Lock handled_auth_lock_;
+
+ // The ConstrainedWindow that is hosting our LoginView.
+ // This should only be accessed on the UI loop.
+ ConstrainedWindow* dialog_;
+
+ // Who/where/what asked for the authentication.
+ scoped_refptr<net::AuthChallengeInfo> auth_info_;
+
+ // The request that wants login data.
+ // This should only be accessed on the IO loop.
+ net::URLRequest* request_;
+
+ // The PasswordForm sent to the PasswordManager. This is so we can refer to it
+ // when later notifying the password manager if the credentials were accepted
+ // or rejected.
+ // This should only be accessed on the UI loop.
+ webkit_glue::PasswordForm password_form_;
+
+ // Points to the password manager owned by the TabContents requesting auth.
+ // Can be null if the TabContents is not a TabContents.
+ // This should only be accessed on the UI loop.
+ PasswordManager* password_manager_;
+
+ // Cached from the net::URLRequest, in case it goes NULL on us.
+ int render_process_host_id_;
+ int tab_contents_id_;
+
+ // If not null, points to a model we need to notify of our own destruction
+ // so it doesn't try and access this when its too late.
+ LoginModel* login_model_;
+
+ // Observes other login handlers so this login handler can respond.
+ NotificationRegistrar registrar_;
+};
+
+// Details to provide the NotificationObserver. Used by the automation proxy
+// for testing.
+class LoginNotificationDetails {
+ public:
+ explicit LoginNotificationDetails(LoginHandler* handler)
+ : handler_(handler) {}
+ LoginHandler* handler() const { return handler_; }
+
+ private:
+ LoginNotificationDetails() {}
+
+ LoginHandler* handler_; // Where to send the response.
+
+ DISALLOW_COPY_AND_ASSIGN(LoginNotificationDetails);
+};
+
+// Details to provide the NotificationObserver. Used by the automation proxy
+// for testing and by other LoginHandlers to dismiss themselves when an
+// identical auth is supplied.
+class AuthSuppliedLoginNotificationDetails : public LoginNotificationDetails {
+ public:
+ AuthSuppliedLoginNotificationDetails(LoginHandler* handler,
+ const std::wstring& username,
+ const std::wstring& password)
+ : LoginNotificationDetails(handler),
+ username_(username),
+ password_(password) {}
+ const std::wstring& username() const { return username_; }
+ const std::wstring& password() const { return password_; }
+
+ private:
+ // The username that was used for the authentication.
+ const std::wstring username_;
+
+ // The password that was used for the authentication.
+ const std::wstring password_;
+
+ DISALLOW_COPY_AND_ASSIGN(AuthSuppliedLoginNotificationDetails);
+};
+
+// Prompts the user for their username and password. This is designed to
+// be called on the background (I/O) thread, in response to
+// net::URLRequest::Delegate::OnAuthRequired. The prompt will be created
+// on the main UI thread via a call to UI loop's InvokeLater, and will send the
+// credentials back to the net::URLRequest on the calling thread.
+// A LoginHandler object (which lives on the calling thread) is returned,
+// which can be used to set or cancel authentication programmatically. The
+// caller must invoke OnRequestCancelled() on this LoginHandler before
+// destroying the net::URLRequest.
+LoginHandler* CreateLoginPrompt(net::AuthChallengeInfo* auth_info,
+ net::URLRequest* request);
+
+// Helper to remove the ref from an net::URLRequest to the LoginHandler.
+// Should only be called from the IO thread, since it accesses an
+// net::URLRequest.
+void ResetLoginHandlerForRequest(net::URLRequest* request);
+
+// Get the signon_realm under which the identity should be saved.
+std::string GetSignonRealm(const GURL& url,
+ const net::AuthChallengeInfo& auth_info);
+
+#endif // CHROME_BROWSER_UI_LOGIN_LOGIN_PROMPT_H_
diff --git a/chrome/browser/ui/login/login_prompt_gtk.cc b/chrome/browser/ui/login/login_prompt_gtk.cc
new file mode 100644
index 0000000..92da74f
--- /dev/null
+++ b/chrome/browser/ui/login/login_prompt_gtk.cc
@@ -0,0 +1,199 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/login/login_prompt.h"
+
+#include <gtk/gtk.h>
+
+#include "app/l10n_util.h"
+#include "app/gtk_signal.h"
+#include "base/utf_string_conversions.h"
+#include "chrome/browser/browser_thread.h"
+#include "chrome/browser/gtk/constrained_window_gtk.h"
+#include "chrome/browser/gtk/gtk_util.h"
+#include "chrome/browser/password_manager/password_manager.h"
+#include "chrome/browser/renderer_host/resource_dispatcher_host.h"
+#include "chrome/browser/tab_contents/navigation_controller.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
+#include "chrome/browser/tab_contents/tab_contents_delegate.h"
+#include "chrome/browser/tab_contents/tab_contents_view_gtk.h"
+#include "chrome/browser/tab_contents/tab_util.h"
+#include "chrome/browser/ui/login/login_model.h"
+#include "chrome/common/notification_service.h"
+#include "grit/generated_resources.h"
+#include "net/url_request/url_request.h"
+
+using webkit_glue::PasswordForm;
+
+// ----------------------------------------------------------------------------
+// LoginHandlerGtk
+
+// This class simply forwards the authentication from the LoginView (on
+// the UI thread) to the net::URLRequest (on the I/O thread).
+// This class uses ref counting to ensure that it lives until all InvokeLaters
+// have been called.
+class LoginHandlerGtk : public LoginHandler,
+ public ConstrainedWindowGtkDelegate {
+ public:
+ LoginHandlerGtk(net::AuthChallengeInfo* auth_info, net::URLRequest* request)
+ : LoginHandler(auth_info, request),
+ username_entry_(NULL),
+ password_entry_(NULL),
+ ok_(NULL) {
+ }
+
+ virtual ~LoginHandlerGtk() {
+ root_.Destroy();
+ }
+
+ // LoginModelObserver implementation.
+ virtual void OnAutofillDataAvailable(const std::wstring& username,
+ const std::wstring& password) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ // NOTE: Would be nice to use gtk_entry_get_text_length, but it is fairly
+ // new and not always in our GTK version.
+ if (strlen(gtk_entry_get_text(GTK_ENTRY(username_entry_))) == 0) {
+ gtk_entry_set_text(GTK_ENTRY(username_entry_),
+ WideToUTF8(username).c_str());
+ gtk_entry_set_text(GTK_ENTRY(password_entry_),
+ WideToUTF8(password).c_str());
+ gtk_editable_select_region(GTK_EDITABLE(username_entry_), 0, -1);
+ }
+ }
+
+ // LoginHandler:
+ virtual void BuildViewForPasswordManager(PasswordManager* manager,
+ std::wstring explanation) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ root_.Own(gtk_vbox_new(FALSE, gtk_util::kContentAreaBorder));
+ GtkWidget* label = gtk_label_new(WideToUTF8(explanation).c_str());
+ gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
+ gtk_box_pack_start(GTK_BOX(root_.get()), label, FALSE, FALSE, 0);
+
+ username_entry_ = gtk_entry_new();
+ gtk_entry_set_activates_default(GTK_ENTRY(username_entry_), TRUE);
+
+ password_entry_ = gtk_entry_new();
+ gtk_entry_set_activates_default(GTK_ENTRY(password_entry_), TRUE);
+ gtk_entry_set_visibility(GTK_ENTRY(password_entry_), FALSE);
+
+ GtkWidget* table = gtk_util::CreateLabeledControlsGroup(NULL,
+ l10n_util::GetStringUTF8(IDS_LOGIN_DIALOG_USERNAME_FIELD).c_str(),
+ username_entry_,
+ l10n_util::GetStringUTF8(IDS_LOGIN_DIALOG_PASSWORD_FIELD).c_str(),
+ password_entry_,
+ NULL);
+ gtk_box_pack_start(GTK_BOX(root_.get()), table, FALSE, FALSE, 0);
+
+ GtkWidget* hbox = gtk_hbox_new(FALSE, 12);
+ gtk_box_pack_start(GTK_BOX(root_.get()), hbox, FALSE, FALSE, 0);
+
+ ok_ = gtk_button_new_from_stock(GTK_STOCK_OK);
+ gtk_button_set_label(
+ GTK_BUTTON(ok_),
+ l10n_util::GetStringUTF8(IDS_LOGIN_DIALOG_OK_BUTTON_LABEL).c_str());
+ g_signal_connect(ok_, "clicked", G_CALLBACK(OnOKClickedThunk), this);
+ gtk_box_pack_end(GTK_BOX(hbox), ok_, FALSE, FALSE, 0);
+
+ GtkWidget* cancel = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
+ g_signal_connect(cancel, "clicked", G_CALLBACK(OnCancelClickedThunk), this);
+ gtk_box_pack_end(GTK_BOX(hbox), cancel, FALSE, FALSE, 0);
+
+ g_signal_connect(root_.get(), "hierarchy-changed",
+ G_CALLBACK(OnPromptHierarchyChangedThunk), this);
+
+ SetModel(manager);
+
+ // Scary thread safety note: This can potentially be called *after* SetAuth
+ // or CancelAuth (say, if the request was cancelled before the UI thread got
+ // control). However, that's OK since any UI interaction in those functions
+ // will occur via an InvokeLater on the UI thread, which is guaranteed
+ // to happen after this is called (since this was InvokeLater'd first).
+ SetDialog(GetTabContentsForLogin()->CreateConstrainedDialog(this));
+
+ NotifyAuthNeeded();
+ }
+
+ // Overridden from ConstrainedWindowGtkDelegate:
+ virtual GtkWidget* GetWidgetRoot() {
+ return root_.get();
+ }
+
+ virtual void DeleteDelegate() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ // The constrained window is going to delete itself; clear our pointer.
+ SetDialog(NULL);
+ SetModel(NULL);
+
+ ReleaseSoon();
+ }
+
+ private:
+ friend class LoginPrompt;
+
+ CHROMEGTK_CALLBACK_0(LoginHandlerGtk, void, OnOKClicked);
+ CHROMEGTK_CALLBACK_0(LoginHandlerGtk, void, OnCancelClicked);
+ CHROMEGTK_CALLBACK_1(LoginHandlerGtk, void, OnPromptHierarchyChanged,
+ GtkWidget*);
+
+ // The GtkWidgets that form our visual hierarchy:
+ // The root container we pass to our parent.
+ OwnedWidgetGtk root_;
+
+ // GtkEntry widgets that the user types into.
+ GtkWidget* username_entry_;
+ GtkWidget* password_entry_;
+ GtkWidget* ok_;
+
+ DISALLOW_COPY_AND_ASSIGN(LoginHandlerGtk);
+};
+
+void LoginHandlerGtk::OnOKClicked(GtkWidget* sender) {
+ SetAuth(
+ UTF8ToWide(gtk_entry_get_text(GTK_ENTRY(username_entry_))),
+ UTF8ToWide(gtk_entry_get_text(GTK_ENTRY(password_entry_))));
+}
+
+void LoginHandlerGtk::OnCancelClicked(GtkWidget* sender) {
+ CancelAuth();
+}
+
+void LoginHandlerGtk::OnPromptHierarchyChanged(GtkWidget* sender,
+ GtkWidget* previous_toplevel) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ if (!GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel(ok_)))
+ return;
+
+ // Now that we have attached ourself to the window, we can make our OK
+ // button the default action and mess with the focus.
+ GTK_WIDGET_SET_FLAGS(ok_, GTK_CAN_DEFAULT);
+ gtk_widget_grab_default(ok_);
+
+ TabContents* contents = GetTabContentsForLogin();
+
+ // The user may have focused another tab. In this case do not grab focus
+ // until this tab is refocused.
+ if ((!contents->delegate() ||
+ contents->delegate()->ShouldFocusConstrainedWindow()) &&
+ gtk_util::IsWidgetAncestryVisible(username_entry_)) {
+ gtk_widget_grab_focus(username_entry_);
+ } else {
+ // TODO(estade): this define should not need to be here because this class
+ // should not be used on linux/views.
+#if defined(TOOLKIT_GTK)
+ static_cast<TabContentsViewGtk*>(contents->view())->
+ SetFocusedWidget(username_entry_);
+#endif
+ }
+}
+
+// static
+LoginHandler* LoginHandler::Create(net::AuthChallengeInfo* auth_info,
+ net::URLRequest* request) {
+ return new LoginHandlerGtk(auth_info, request);
+}
diff --git a/chrome/browser/ui/login/login_prompt_mac.h b/chrome/browser/ui/login/login_prompt_mac.h
new file mode 100644
index 0000000..bf0677d
--- /dev/null
+++ b/chrome/browser/ui/login/login_prompt_mac.h
@@ -0,0 +1,34 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_LOGIN_LOGIN_PROMPT_MAC_H_
+#define CHROME_BROWSER_UI_LOGIN_LOGIN_PROMPT_MAC_H_
+#pragma once
+
+#import <Cocoa/Cocoa.h>
+
+class LoginHandlerMac;
+
+// Controller of the sheet used by LoginHandlerMac. Interface Builder wants
+// this to be in a .h file.
+@interface LoginHandlerSheet : NSWindowController {
+ @private
+ IBOutlet NSTextField* nameField_;
+ IBOutlet NSSecureTextField* passwordField_;
+ IBOutlet NSTextField* explanationField_;
+ IBOutlet NSButton* loginButton_;
+ IBOutlet NSButton* cancelButton_;
+ LoginHandlerMac* handler_; // weak, owns us
+}
+- (id)initWithLoginHandler:(LoginHandlerMac*)handler;
+- (IBAction)loginPressed:(id)sender;
+- (IBAction)cancelPressed:(id)sender;
+- (void)sheetDidEnd:(NSWindow*)sheet
+ returnCode:(int)returnCode
+ contextInfo:(void*)contextInfo;
+- (void)autofillLogin:(NSString*)login password:(NSString*)password;
+- (void)setExplanation:(NSString*)explanation;
+@end
+
+#endif // CHROME_BROWSER_UI_LOGIN_LOGIN_PROMPT_MAC_H_
diff --git a/chrome/browser/ui/login/login_prompt_mac.mm b/chrome/browser/ui/login/login_prompt_mac.mm
new file mode 100644
index 0000000..d2f28d2
--- /dev/null
+++ b/chrome/browser/ui/login/login_prompt_mac.mm
@@ -0,0 +1,191 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/login/login_prompt.h"
+#import "chrome/browser/ui/login/login_prompt_mac.h"
+
+#include "app/l10n_util.h"
+#include "base/mac_util.h"
+#include "base/string_util.h"
+#include "base/sys_string_conversions.h"
+#include "base/utf_string_conversions.h"
+#include "chrome/browser/browser_thread.h"
+#include "chrome/browser/password_manager/password_manager.h"
+#include "chrome/browser/renderer_host/resource_dispatcher_host.h"
+#include "chrome/browser/tab_contents/navigation_controller.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
+#include "chrome/browser/tab_contents/tab_util.h"
+#include "chrome/browser/ui/cocoa/constrained_window_mac.h"
+#include "chrome/browser/ui/login/login_model.h"
+#include "chrome/common/notification_service.h"
+#include "grit/generated_resources.h"
+#include "net/url_request/url_request.h"
+#include "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h"
+
+using webkit_glue::PasswordForm;
+
+// ----------------------------------------------------------------------------
+// LoginHandlerMac
+
+// This class simply forwards the authentication from the LoginView (on
+// the UI thread) to the net::URLRequest (on the I/O thread).
+// This class uses ref counting to ensure that it lives until all InvokeLaters
+// have been called.
+class LoginHandlerMac : public LoginHandler,
+ public ConstrainedWindowMacDelegateCustomSheet {
+ public:
+ LoginHandlerMac(net::AuthChallengeInfo* auth_info, net::URLRequest* request)
+ : LoginHandler(auth_info, request),
+ sheet_controller_(nil) {
+ }
+
+ virtual ~LoginHandlerMac() {
+ }
+
+ // LoginModelObserver implementation.
+ virtual void OnAutofillDataAvailable(const std::wstring& username,
+ const std::wstring& password) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ [sheet_controller_ autofillLogin:base::SysWideToNSString(username)
+ password:base::SysWideToNSString(password)];
+ }
+
+ // LoginHandler:
+ virtual void BuildViewForPasswordManager(PasswordManager* manager,
+ std::wstring explanation) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ // Load nib here instead of in constructor.
+ sheet_controller_ = [[[LoginHandlerSheet alloc]
+ initWithLoginHandler:this] autorelease];
+ init([sheet_controller_ window], sheet_controller_,
+ @selector(sheetDidEnd:returnCode:contextInfo:));
+
+ SetModel(manager);
+
+ [sheet_controller_ setExplanation:base::SysWideToNSString(explanation)];
+
+ // Scary thread safety note: This can potentially be called *after* SetAuth
+ // or CancelAuth (say, if the request was cancelled before the UI thread got
+ // control). However, that's OK since any UI interaction in those functions
+ // will occur via an InvokeLater on the UI thread, which is guaranteed
+ // to happen after this is called (since this was InvokeLater'd first).
+ SetDialog(GetTabContentsForLogin()->CreateConstrainedDialog(this));
+
+ NotifyAuthNeeded();
+ }
+
+ // Overridden from ConstrainedWindowMacDelegate:
+ virtual void DeleteDelegate() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ // The constrained window is going to delete itself; clear our pointer.
+ SetDialog(NULL);
+ SetModel(NULL);
+
+ // Close sheet if it's still open, as required by
+ // ConstrainedWindowMacDelegate.
+ if (is_sheet_open())
+ [NSApp endSheet:sheet()];
+
+ ReleaseSoon();
+ }
+
+ void OnLoginPressed(const std::wstring& username,
+ const std::wstring& password) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ SetAuth(username, password);
+ }
+
+ void OnCancelPressed() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ CancelAuth();
+ }
+
+ private:
+ friend class LoginPrompt;
+
+ // The Cocoa controller of the GUI.
+ LoginHandlerSheet* sheet_controller_;
+
+ DISALLOW_COPY_AND_ASSIGN(LoginHandlerMac);
+};
+
+// static
+LoginHandler* LoginHandler::Create(net::AuthChallengeInfo* auth_info,
+ net::URLRequest* request) {
+ return new LoginHandlerMac(auth_info, request);
+}
+
+// ----------------------------------------------------------------------------
+// LoginHandlerSheet
+
+@implementation LoginHandlerSheet
+
+- (id)initWithLoginHandler:(LoginHandlerMac*)handler {
+ NSString* nibPath =
+ [mac_util::MainAppBundle() pathForResource:@"HttpAuthLoginSheet"
+ ofType:@"nib"];
+ if ((self = [super initWithWindowNibPath:nibPath
+ owner:self])) {
+ handler_ = handler;
+ }
+ return self;
+}
+
+- (void)dealloc {
+ // The buttons could be in a modal loop, so disconnect them so they cannot
+ // call back to us after we're dead.
+ [loginButton_ setTarget:nil];
+ [cancelButton_ setTarget:nil];
+ [super dealloc];
+}
+
+- (IBAction)loginPressed:(id)sender {
+ using base::SysNSStringToWide;
+ [NSApp endSheet:[self window]];
+ handler_->OnLoginPressed(SysNSStringToWide([nameField_ stringValue]),
+ SysNSStringToWide([passwordField_ stringValue]));
+}
+
+- (IBAction)cancelPressed:(id)sender {
+ [NSApp endSheet:[self window]];
+ handler_->OnCancelPressed();
+}
+
+- (void)sheetDidEnd:(NSWindow*)sheet
+ returnCode:(int)returnCode
+ contextInfo:(void *)contextInfo {
+ [sheet orderOut:self];
+ // Also called when user navigates to another page while the sheet is open.
+}
+
+- (void)autofillLogin:(NSString*)login password:(NSString*)password {
+ if ([[nameField_ stringValue] length] == 0) {
+ [nameField_ setStringValue:login];
+ [passwordField_ setStringValue:password];
+ [nameField_ selectText:self];
+ }
+}
+
+- (void)setExplanation:(NSString*)explanation {
+ // Put in the text.
+ [explanationField_ setStringValue:explanation];
+
+ // Resize the TextField.
+ CGFloat explanationShift =
+ [GTMUILocalizerAndLayoutTweaker
+ sizeToFitFixedWidthTextField:explanationField_];
+
+ // Resize the window (no shifting needed due to window layout).
+ NSSize windowDelta = NSMakeSize(0, explanationShift);
+ [GTMUILocalizerAndLayoutTweaker
+ resizeWindowWithoutAutoResizingSubViews:[self window]
+ delta:windowDelta];
+}
+
+@end
diff --git a/chrome/browser/ui/login/login_prompt_uitest.cc b/chrome/browser/ui/login/login_prompt_uitest.cc
new file mode 100644
index 0000000..bdda3fd
--- /dev/null
+++ b/chrome/browser/ui/login/login_prompt_uitest.cc
@@ -0,0 +1,280 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <string>
+
+#include "chrome/browser/net/url_fixer_upper.h"
+#include "chrome/common/chrome_switches.h"
+#include "chrome/common/url_constants.h"
+#include "chrome/test/automation/tab_proxy.h"
+#include "chrome/test/automation/browser_proxy.h"
+#include "chrome/test/ui/ui_test.h"
+#include "net/test/test_server.h"
+
+using std::wstring;
+
+namespace {
+
+const FilePath::CharType kDocRoot[] = FILE_PATH_LITERAL("chrome/test/data");
+
+} // namespace
+
+class LoginPromptTest : public UITest {
+ protected:
+ LoginPromptTest()
+ : username_basic_(L"basicuser"),
+ username_digest_(L"digestuser"),
+ password_(L"secret"),
+ password_bad_(L"denyme"),
+ test_server_(net::TestServer::TYPE_HTTP, FilePath(kDocRoot)) {
+ }
+
+ void AppendTab(const GURL& url) {
+ scoped_refptr<BrowserProxy> window_proxy(automation()->GetBrowserWindow(0));
+ ASSERT_TRUE(window_proxy.get());
+ ASSERT_TRUE(window_proxy->AppendTab(url));
+ }
+
+ protected:
+ wstring username_basic_;
+ wstring username_digest_;
+ wstring password_;
+ wstring password_bad_;
+
+ net::TestServer test_server_;
+};
+
+wstring ExpectedTitleFromAuth(const wstring& username,
+ const wstring& password) {
+ // The TestServer sets the title to username/password on successful login.
+ return username + L"/" + password;
+}
+
+#if defined(OS_WIN)
+// Probably related to test server flakiness in http://crbug.com/60937
+#define MAYBE_TestBasicAuth FLAKY_TestBasicAuth
+#else
+#define MAYBE_TestBasicAuth TestBasicAuth
+#endif
+
+// Test that "Basic" HTTP authentication works.
+TEST_F(LoginPromptTest, MAYBE_TestBasicAuth) {
+ ASSERT_TRUE(test_server_.Start());
+
+ scoped_refptr<TabProxy> tab(GetActiveTab());
+ ASSERT_TRUE(tab.get());
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
+ tab->NavigateToURL(test_server_.GetURL("auth-basic")));
+
+ EXPECT_TRUE(tab->NeedsAuth());
+ EXPECT_FALSE(tab->SetAuth(username_basic_, password_bad_));
+ EXPECT_TRUE(tab->NeedsAuth());
+ EXPECT_TRUE(tab->CancelAuth());
+ EXPECT_EQ(L"Denied: wrong password", GetActiveTabTitle());
+
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
+ tab->NavigateToURL(test_server_.GetURL("auth-basic")));
+
+ EXPECT_TRUE(tab->NeedsAuth());
+ EXPECT_TRUE(tab->SetAuth(username_basic_, password_));
+ EXPECT_EQ(ExpectedTitleFromAuth(username_basic_, password_),
+ GetActiveTabTitle());
+}
+
+#if defined(OS_WIN)
+// Probably related to test server flakiness in http://crbug.com/60937
+#define MAYBE_TestDigestAuth FLAKY_TestDigestAuth
+#else
+#define MAYBE_TestDigestAuth TestDigestAuth
+#endif
+
+// Test that "Digest" HTTP authentication works.
+TEST_F(LoginPromptTest, MAYBE_TestDigestAuth) {
+ ASSERT_TRUE(test_server_.Start());
+
+ scoped_refptr<TabProxy> tab(GetActiveTab());
+ ASSERT_TRUE(tab.get());
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
+ tab->NavigateToURL(test_server_.GetURL("auth-digest")));
+
+ EXPECT_TRUE(tab->NeedsAuth());
+ EXPECT_FALSE(tab->SetAuth(username_digest_, password_bad_));
+ EXPECT_TRUE(tab->CancelAuth());
+ EXPECT_EQ(L"Denied: wrong password", GetActiveTabTitle());
+
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
+ tab->NavigateToURL(test_server_.GetURL("auth-digest")));
+
+ EXPECT_TRUE(tab->NeedsAuth());
+ EXPECT_TRUE(tab->SetAuth(username_digest_, password_));
+ EXPECT_EQ(ExpectedTitleFromAuth(username_digest_, password_),
+ GetActiveTabTitle());
+}
+
+#if defined(OS_WIN)
+// Probably related to test server flakiness in http://crbug.com/60937
+#define MAYBE_TestTwoAuths FLAKY_TestTwoAuths
+#else
+#define MAYBE_TestTwoAuths TestTwoAuths
+#endif
+
+// Test that logging in on 2 tabs at once works.
+TEST_F(LoginPromptTest, MAYBE_TestTwoAuths) {
+ ASSERT_TRUE(test_server_.Start());
+
+ scoped_refptr<TabProxy> basic_tab(GetActiveTab());
+ ASSERT_TRUE(basic_tab.get());
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
+ basic_tab->NavigateToURL(test_server_.GetURL("auth-basic")));
+
+ AppendTab(GURL(chrome::kAboutBlankURL));
+ scoped_refptr<TabProxy> digest_tab(GetActiveTab());
+ ASSERT_TRUE(digest_tab.get());
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
+ digest_tab->NavigateToURL(test_server_.GetURL("auth-digest")));
+
+ EXPECT_TRUE(basic_tab->NeedsAuth());
+ EXPECT_TRUE(basic_tab->SetAuth(username_basic_, password_));
+ EXPECT_TRUE(digest_tab->NeedsAuth());
+ EXPECT_TRUE(digest_tab->SetAuth(username_digest_, password_));
+
+ wstring title;
+ EXPECT_TRUE(basic_tab->GetTabTitle(&title));
+ EXPECT_EQ(ExpectedTitleFromAuth(username_basic_, password_), title);
+
+ EXPECT_TRUE(digest_tab->GetTabTitle(&title));
+ EXPECT_EQ(ExpectedTitleFromAuth(username_digest_, password_), title);
+}
+
+#if defined(OS_WIN)
+// Probably related to test server flakiness in http://crbug.com/60937
+#define MAYBE_TestCancelAuth FLAKY_TestCancelAuth
+#else
+#define MAYBE_TestCancelAuth TestCancelAuth
+#endif
+
+// Test that cancelling authentication works.
+TEST_F(LoginPromptTest, MAYBE_TestCancelAuth) {
+ ASSERT_TRUE(test_server_.Start());
+
+ scoped_refptr<TabProxy> tab(GetActiveTab());
+ ASSERT_TRUE(tab.get());
+
+ // First navigate to a test server page so we have something to go back to.
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS,
+ tab->NavigateToURL(test_server_.GetURL("a")));
+
+ // Navigating while auth is requested is the same as cancelling.
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
+ tab->NavigateToURL(test_server_.GetURL("auth-basic")));
+ EXPECT_TRUE(tab->NeedsAuth());
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS,
+ tab->NavigateToURL(test_server_.GetURL("b")));
+ EXPECT_FALSE(tab->NeedsAuth());
+
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
+ tab->NavigateToURL(test_server_.GetURL("auth-basic")));
+ EXPECT_TRUE(tab->NeedsAuth());
+ EXPECT_TRUE(tab->GoBack()); // should bring us back to 'a'
+ EXPECT_FALSE(tab->NeedsAuth());
+
+ // Now add a page and go back, so we have something to go forward to.
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS,
+ tab->NavigateToURL(test_server_.GetURL("c")));
+ EXPECT_TRUE(tab->GoBack()); // should bring us back to 'a'
+
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
+ tab->NavigateToURL(test_server_.GetURL("auth-basic")));
+ EXPECT_TRUE(tab->NeedsAuth());
+ EXPECT_TRUE(tab->GoForward()); // should bring us to 'c'
+ EXPECT_FALSE(tab->NeedsAuth());
+
+ // Now test that cancelling works as expected.
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
+ tab->NavigateToURL(test_server_.GetURL("auth-basic")));
+ EXPECT_TRUE(tab->NeedsAuth());
+ EXPECT_TRUE(tab->CancelAuth());
+ EXPECT_FALSE(tab->NeedsAuth());
+ EXPECT_EQ(L"Denied: no auth", GetActiveTabTitle());
+}
+
+#if defined(OS_WIN)
+// Probably related to test server flakiness in http://crbug.com/60937
+#define MAYBE_SupplyRedundantAuths FLAKY_SupplyRedundantAuths
+#else
+#define MAYBE_SupplyRedundantAuths SupplyRedundantAuths
+#endif
+
+// If multiple tabs are looking for the same auth, the user should only have to
+// enter it once.
+TEST_F(LoginPromptTest, MAYBE_SupplyRedundantAuths) {
+ ASSERT_TRUE(test_server_.Start());
+
+ scoped_refptr<TabProxy> basic_tab1(GetActiveTab());
+ ASSERT_TRUE(basic_tab1.get());
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
+ basic_tab1->NavigateToURL(test_server_.GetURL("auth-basic/1")));
+ EXPECT_TRUE(basic_tab1->NeedsAuth());
+
+ AppendTab(GURL(chrome::kAboutBlankURL));
+ scoped_refptr<TabProxy> basic_tab2(GetActiveTab());
+ ASSERT_TRUE(basic_tab2.get());
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
+ basic_tab2->NavigateToURL(test_server_.GetURL("auth-basic/2")));
+ EXPECT_TRUE(basic_tab2->NeedsAuth());
+
+ // Set the auth in only one of the tabs (but wait for the other to load).
+ int64 last_navigation_time;
+ ASSERT_TRUE(basic_tab2->GetLastNavigationTime(&last_navigation_time));
+ EXPECT_TRUE(basic_tab1->SetAuth(username_basic_, password_));
+ EXPECT_TRUE(basic_tab2->WaitForNavigation(last_navigation_time));
+
+ // Now both tabs have loaded.
+ wstring title1;
+ EXPECT_TRUE(basic_tab1->GetTabTitle(&title1));
+ EXPECT_EQ(ExpectedTitleFromAuth(username_basic_, password_), title1);
+ wstring title2;
+ EXPECT_TRUE(basic_tab2->GetTabTitle(&title2));
+ EXPECT_EQ(ExpectedTitleFromAuth(username_basic_, password_), title2);
+}
+
+#if defined(OS_WIN)
+// Probably related to test server flakiness in http://crbug.com/60937
+#define MAYBE_CancelRedundantAuths FLAKY_CancelRedundantAuths
+#else
+#define MAYBE_CancelRedundantAuths CancelRedundantAuths
+#endif
+
+// If multiple tabs are looking for the same auth, and one is cancelled, the
+// other should be cancelled as well.
+TEST_F(LoginPromptTest, MAYBE_CancelRedundantAuths) {
+ ASSERT_TRUE(test_server_.Start());
+
+ scoped_refptr<TabProxy> basic_tab1(GetActiveTab());
+ ASSERT_TRUE(basic_tab1.get());
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
+ basic_tab1->NavigateToURL(test_server_.GetURL("auth-basic/1")));
+ EXPECT_TRUE(basic_tab1->NeedsAuth());
+
+ AppendTab(GURL(chrome::kAboutBlankURL));
+ scoped_refptr<TabProxy> basic_tab2(GetActiveTab());
+ ASSERT_TRUE(basic_tab2.get());
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
+ basic_tab2->NavigateToURL(test_server_.GetURL("auth-basic/2")));
+ EXPECT_TRUE(basic_tab2->NeedsAuth());
+
+ // Cancel the auth in only one of the tabs (but wait for the other to load).
+ int64 last_navigation_time;
+ ASSERT_TRUE(basic_tab2->GetLastNavigationTime(&last_navigation_time));
+ EXPECT_TRUE(basic_tab1->CancelAuth());
+ EXPECT_TRUE(basic_tab2->WaitForNavigation(last_navigation_time));
+
+ // Now both tabs have been denied.
+ wstring title1;
+ EXPECT_TRUE(basic_tab1->GetTabTitle(&title1));
+ EXPECT_EQ(L"Denied: no auth", title1);
+ wstring title2;
+ EXPECT_TRUE(basic_tab2->GetTabTitle(&title2));
+ EXPECT_EQ(L"Denied: no auth", title2);
+}
diff --git a/chrome/browser/ui/login/login_prompt_unittest.cc b/chrome/browser/ui/login/login_prompt_unittest.cc
new file mode 100644
index 0000000..9454e13
--- /dev/null
+++ b/chrome/browser/ui/login/login_prompt_unittest.cc
@@ -0,0 +1,42 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/login/login_prompt.h"
+#include "googleurl/src/gurl.h"
+#include "net/base/auth.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+
+TEST(LoginPromptTest, GetSignonRealm) {
+ scoped_refptr<net::AuthChallengeInfo> auth_info = new net::AuthChallengeInfo;
+ auth_info->is_proxy = false; // server auth
+ // auth_info->host is intentionally left empty.
+ auth_info->scheme = L"Basic";
+ auth_info->realm = L"WallyWorld";
+
+ std::string url[] = {
+ "https://www.nowhere.org/dir/index.html",
+ "https://www.nowhere.org:443/dir/index.html", // default port
+ "https://www.nowhere.org:8443/dir/index.html", // non-default port
+ "https://www.nowhere.org", // no trailing slash
+ "https://foo:bar@www.nowhere.org/dir/index.html", // username:password
+ "https://www.nowhere.org/dir/index.html?id=965362", // query
+ "https://www.nowhere.org/dir/index.html#toc", // reference
+ };
+
+ std::string expected[] = {
+ "https://www.nowhere.org/WallyWorld",
+ "https://www.nowhere.org/WallyWorld",
+ "https://www.nowhere.org:8443/WallyWorld",
+ "https://www.nowhere.org/WallyWorld",
+ "https://www.nowhere.org/WallyWorld",
+ "https://www.nowhere.org/WallyWorld",
+ "https://www.nowhere.org/WallyWorld"
+ };
+
+ for (size_t i = 0; i < arraysize(url); i++) {
+ std::string key = GetSignonRealm(GURL(url[i]), *auth_info);
+ EXPECT_EQ(expected[i], key);
+ }
+}
diff --git a/chrome/browser/ui/login/login_prompt_win.cc b/chrome/browser/ui/login/login_prompt_win.cc
new file mode 100644
index 0000000..d73954b
--- /dev/null
+++ b/chrome/browser/ui/login/login_prompt_win.cc
@@ -0,0 +1,147 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/login/login_prompt.h"
+
+#include "app/l10n_util.h"
+#include "chrome/browser/browser_thread.h"
+#include "chrome/browser/password_manager/password_manager.h"
+#include "chrome/browser/renderer_host/render_process_host.h"
+#include "chrome/browser/renderer_host/render_view_host.h"
+#include "chrome/browser/renderer_host/resource_dispatcher_host.h"
+#include "chrome/browser/tab_contents/navigation_controller.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
+#include "chrome/browser/tab_contents/tab_contents_delegate.h"
+#include "chrome/browser/tab_contents/tab_util.h"
+#include "chrome/browser/ui/views/login_view.h"
+#include "chrome/common/notification_service.h"
+#include "grit/generated_resources.h"
+#include "net/url_request/url_request.h"
+#include "views/window/dialog_delegate.h"
+
+using webkit_glue::PasswordForm;
+
+// ----------------------------------------------------------------------------
+// LoginHandlerWin
+
+// This class simply forwards the authentication from the LoginView (on
+// the UI thread) to the net::URLRequest (on the I/O thread).
+// This class uses ref counting to ensure that it lives until all InvokeLaters
+// have been called.
+class LoginHandlerWin : public LoginHandler,
+ public ConstrainedDialogDelegate {
+ public:
+ LoginHandlerWin(net::AuthChallengeInfo* auth_info, net::URLRequest* request)
+ : LoginHandler(auth_info, request) {
+ }
+
+ // LoginModelObserver implementation.
+ virtual void OnAutofillDataAvailable(const std::wstring& username,
+ const std::wstring& password) {
+ // Nothing to do here since LoginView takes care of autofil for win.
+ }
+
+ void set_login_view(LoginView* login_view) {
+ login_view_ = login_view;
+ }
+
+ // views::DialogDelegate methods:
+ virtual std::wstring GetDialogButtonLabel(
+ MessageBoxFlags::DialogButton button) const {
+ if (button == MessageBoxFlags::DIALOGBUTTON_OK)
+ return l10n_util::GetString(IDS_LOGIN_DIALOG_OK_BUTTON_LABEL);
+ return DialogDelegate::GetDialogButtonLabel(button);
+ }
+
+ virtual std::wstring GetWindowTitle() const {
+ return l10n_util::GetString(IDS_LOGIN_DIALOG_TITLE);
+ }
+
+ virtual void WindowClosing() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ TabContents* tab = GetTabContentsForLogin();
+ if (tab)
+ tab->render_view_host()->set_ignore_input_events(false);
+
+ // Reference is no longer valid.
+ SetDialog(NULL);
+
+ CancelAuth();
+ }
+
+ virtual void DeleteDelegate() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ // The constrained window is going to delete itself; clear our pointer.
+ SetDialog(NULL);
+ SetModel(NULL);
+
+ ReleaseSoon();
+ }
+
+ virtual bool Cancel() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ CancelAuth();
+ return true;
+ }
+
+ virtual bool Accept() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ SetAuth(login_view_->GetUsername(), login_view_->GetPassword());
+ return true;
+ }
+
+ virtual views::View* GetContentsView() {
+ return login_view_;
+ }
+
+ // LoginHandler:
+
+ virtual void BuildViewForPasswordManager(PasswordManager* manager,
+ std::wstring explanation) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ TabContents* tab_contents = GetTabContentsForLogin();
+ bool should_focus_view = !tab_contents->delegate() ||
+ tab_contents->delegate()->ShouldFocusConstrainedWindow();
+
+ LoginView* view = new LoginView(explanation, should_focus_view);
+
+ // Set the model for the login view. The model (password manager) is owned
+ // by the view's parent TabContents, so natural destruction order means we
+ // don't have to worry about calling SetModel(NULL), because the view will
+ // be deleted before the password manager.
+ view->SetModel(manager);
+
+ set_login_view(view);
+
+ // Scary thread safety note: This can potentially be called *after* SetAuth
+ // or CancelAuth (say, if the request was cancelled before the UI thread got
+ // control). However, that's OK since any UI interaction in those functions
+ // will occur via an InvokeLater on the UI thread, which is guaranteed
+ // to happen after this is called (since this was InvokeLater'd first).
+ SetDialog(GetTabContentsForLogin()->CreateConstrainedDialog(this));
+ NotifyAuthNeeded();
+ }
+
+ private:
+ friend class base::RefCountedThreadSafe<LoginHandlerWin>;
+ friend class LoginPrompt;
+
+ ~LoginHandlerWin() {}
+
+ // The LoginView that contains the user's login information
+ LoginView* login_view_;
+
+ DISALLOW_COPY_AND_ASSIGN(LoginHandlerWin);
+};
+
+// static
+LoginHandler* LoginHandler::Create(net::AuthChallengeInfo* auth_info,
+ net::URLRequest* request) {
+ return new LoginHandlerWin(auth_info, request);
+}
diff --git a/chrome/browser/ui/omnibox/location_bar_util.cc b/chrome/browser/ui/omnibox/location_bar_util.cc
index 00214ef..66ceb4b 100644
--- a/chrome/browser/ui/omnibox/location_bar_util.cc
+++ b/chrome/browser/ui/omnibox/location_bar_util.cc
@@ -6,7 +6,7 @@
#include "app/l10n_util.h"
#include "base/i18n/rtl.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
diff --git a/chrome/browser/ui/options/options_util.cc b/chrome/browser/ui/options/options_util.cc
index 465df98..f3a9e77 100644
--- a/chrome/browser/ui/options/options_util.cc
+++ b/chrome/browser/ui/options/options_util.cc
@@ -14,7 +14,7 @@
#include "chrome/browser/metrics/metrics_service.h"
#include "chrome/browser/notifications/desktop_notification_service.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
#include "chrome/installer/util/google_update_settings.h"
diff --git a/chrome/browser/ui/options/show_options_url.cc b/chrome/browser/ui/options/show_options_url.cc
index 46e2dac..2b4818f 100644
--- a/chrome/browser/ui/options/show_options_url.cc
+++ b/chrome/browser/ui/options/show_options_url.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/ui/options/show_options_url.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
diff --git a/chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc b/chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc
index a25260d..2e4b988 100644
--- a/chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc
+++ b/chrome/browser/ui/toolbar/back_forward_menu_model_unittest.cc
@@ -7,7 +7,7 @@
#include "base/path_service.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
-#include "chrome/browser/profile_manager.h"
+#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/renderer_host/test/test_render_view_host.h"
#include "chrome/browser/tab_contents/navigation_controller.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
diff --git a/chrome/browser/ui/toolbar/encoding_menu_controller.cc b/chrome/browser/ui/toolbar/encoding_menu_controller.cc
index 96ac58f..c93fb1e 100644
--- a/chrome/browser/ui/toolbar/encoding_menu_controller.cc
+++ b/chrome/browser/ui/toolbar/encoding_menu_controller.cc
@@ -11,7 +11,7 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/character_encoding.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
#include "grit/generated_resources.h"
diff --git a/chrome/browser/ui/toolbar/encoding_menu_controller_unittest.cc b/chrome/browser/ui/toolbar/encoding_menu_controller_unittest.cc
index 2538547..13fa63c 100644
--- a/chrome/browser/ui/toolbar/encoding_menu_controller_unittest.cc
+++ b/chrome/browser/ui/toolbar/encoding_menu_controller_unittest.cc
@@ -9,7 +9,7 @@
#include "base/basictypes.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/testing_profile.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/ui/toolbar/toolbar_model.cc b/chrome/browser/ui/toolbar/toolbar_model.cc
index b6533fd..024c272 100644
--- a/chrome/browser/ui/toolbar/toolbar_model.cc
+++ b/chrome/browser/ui/toolbar/toolbar_model.cc
@@ -9,7 +9,7 @@
#include "chrome/browser/autocomplete/autocomplete_edit.h"
#include "chrome/browser/cert_store.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ssl/ssl_error_info.h"
#include "chrome/browser/tab_contents/navigation_controller.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.cc b/chrome/browser/ui/toolbar/wrench_menu_model.cc
index c963685..50b6c49 100644
--- a/chrome/browser/ui/toolbar/wrench_menu_model.cc
+++ b/chrome/browser/ui/toolbar/wrench_menu_model.cc
@@ -19,7 +19,7 @@
#include "chrome/browser/background_page_tracker.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/defaults.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/sync_ui_util.h"
diff --git a/chrome/browser/ui/views/accessibility_event_router_views.cc b/chrome/browser/ui/views/accessibility_event_router_views.cc
index 4b1ad00..b563b8d 100644
--- a/chrome/browser/ui/views/accessibility_event_router_views.cc
+++ b/chrome/browser/ui/views/accessibility_event_router_views.cc
@@ -9,8 +9,8 @@
#include "base/message_loop.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/extensions/extension_accessibility_api.h"
-#include "chrome/browser/profile.h"
-#include "chrome/browser/profile_manager.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/views/location_bar/location_bar_view.h"
#include "chrome/common/notification_type.h"
#include "views/accessibility/accessibility_types.h"
diff --git a/chrome/browser/ui/views/accessible_view_helper.cc b/chrome/browser/ui/views/accessible_view_helper.cc
index 65caf36..ca15381 100644
--- a/chrome/browser/ui/views/accessible_view_helper.cc
+++ b/chrome/browser/ui/views/accessible_view_helper.cc
@@ -6,7 +6,7 @@
#include "app/l10n_util.h"
#include "chrome/browser/accessibility_events.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/views/accessibility_event_router_views.h"
#include "chrome/common/notification_service.h"
#include "views/controls/native/native_view_host.h"
diff --git a/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc b/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc
index 2f808dd..20a4b00 100644
--- a/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc
+++ b/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc
@@ -17,7 +17,7 @@
#include "chrome/browser/autocomplete/autocomplete_popup_model.h"
#include "chrome/browser/instant/instant_confirm_dialog.h"
#include "chrome/browser/instant/promo_counter.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/views/bubble_border.h"
#include "chrome/browser/views/location_bar/location_bar_view.h"
#include "gfx/canvas_skia.h"
diff --git a/chrome/browser/ui/views/autofill_profiles_view_win.cc b/chrome/browser/ui/views/autofill_profiles_view_win.cc
index 20812b8..9c73a62 100644
--- a/chrome/browser/ui/views/autofill_profiles_view_win.cc
+++ b/chrome/browser/ui/views/autofill_profiles_view_win.cc
@@ -18,7 +18,7 @@
#include "chrome/browser/autofill/phone_number.h"
#include "chrome/browser/metrics/user_metrics.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"
diff --git a/chrome/browser/ui/views/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmark_bar_view.cc
index 8a07f1d..a43130c 100644
--- a/chrome/browser/ui/views/bookmark_bar_view.cc
+++ b/chrome/browser/ui/views/bookmark_bar_view.cc
@@ -24,7 +24,7 @@
#include "chrome/browser/importer/importer_data_types.h"
#include "chrome/browser/metrics/user_metrics.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/renderer_host/render_widget_host_view.h"
#include "chrome/browser/sync/sync_ui_util.h"
diff --git a/chrome/browser/ui/views/bookmark_bar_view_test.cc b/chrome/browser/ui/views/bookmark_bar_view_test.cc
index fc85e68..44431f8 100644
--- a/chrome/browser/ui/views/bookmark_bar_view_test.cc
+++ b/chrome/browser/ui/views/bookmark_bar_view_test.cc
@@ -9,7 +9,7 @@
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/bookmarks/bookmark_utils.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/page_navigator.h"
#include "chrome/browser/views/bookmark_bar_view.h"
#include "chrome/common/notification_service.h"
diff --git a/chrome/browser/ui/views/bookmark_bubble_view.cc b/chrome/browser/ui/views/bookmark_bubble_view.cc
index a1f651b..0fca648 100644
--- a/chrome/browser/ui/views/bookmark_bubble_view.cc
+++ b/chrome/browser/ui/views/bookmark_bubble_view.cc
@@ -14,7 +14,7 @@
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/bookmarks/bookmark_utils.h"
#include "chrome/browser/metrics/user_metrics.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/views/info_bubble.h"
#include "chrome/common/notification_service.h"
#include "gfx/canvas.h"
diff --git a/chrome/browser/ui/views/bookmark_context_menu.cc b/chrome/browser/ui/views/bookmark_context_menu.cc
index cdd778a..b65d16c 100644
--- a/chrome/browser/ui/views/bookmark_context_menu.cc
+++ b/chrome/browser/ui/views/bookmark_context_menu.cc
@@ -6,7 +6,7 @@
#include "app/l10n_util.h"
#include "base/i18n/rtl.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/common/notification_service.h"
#include "grit/generated_resources.h"
#include "views/controls/menu/menu_item_view.h"
diff --git a/chrome/browser/ui/views/bookmark_context_menu_controller_views.cc b/chrome/browser/ui/views/bookmark_context_menu_controller_views.cc
index 1c83a3f..54282d1 100644
--- a/chrome/browser/ui/views/bookmark_context_menu_controller_views.cc
+++ b/chrome/browser/ui/views/bookmark_context_menu_controller_views.cc
@@ -12,7 +12,7 @@
#include "chrome/browser/browser_list.h"
#include "chrome/browser/metrics/user_metrics.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/page_navigator.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/pref_names.h"
diff --git a/chrome/browser/ui/views/bookmark_context_menu_test.cc b/chrome/browser/ui/views/bookmark_context_menu_test.cc
index 8d3f89c..477e9f4 100644
--- a/chrome/browser/ui/views/bookmark_context_menu_test.cc
+++ b/chrome/browser/ui/views/bookmark_context_menu_test.cc
@@ -8,7 +8,7 @@
#include "chrome/browser/bookmarks/bookmark_utils.h"
#include "chrome/browser/browser_thread.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/page_navigator.h"
#include "chrome/browser/views/bookmark_context_menu.h"
#include "chrome/common/pref_names.h"
diff --git a/chrome/browser/ui/views/bookmark_editor_view.cc b/chrome/browser/ui/views/bookmark_editor_view.cc
index 895dc59..a64d42e 100644
--- a/chrome/browser/ui/views/bookmark_editor_view.cc
+++ b/chrome/browser/ui/views/bookmark_editor_view.cc
@@ -13,7 +13,7 @@
#include "chrome/browser/bookmarks/bookmark_utils.h"
#include "chrome/browser/history/history.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/net/url_fixer_upper.h"
#include "chrome/common/pref_names.h"
#include "googleurl/src/gurl.h"
diff --git a/chrome/browser/ui/views/bookmark_editor_view_unittest.cc b/chrome/browser/ui/views/bookmark_editor_view_unittest.cc
index afeeb4e..b2d9dea3 100644
--- a/chrome/browser/ui/views/bookmark_editor_view_unittest.cc
+++ b/chrome/browser/ui/views/bookmark_editor_view_unittest.cc
@@ -8,7 +8,7 @@
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/browser_thread.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/views/bookmark_editor_view.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/testing_profile.h"
diff --git a/chrome/browser/ui/views/bookmark_menu_controller_views.cc b/chrome/browser/ui/views/bookmark_menu_controller_views.cc
index de89264..8829dac 100644
--- a/chrome/browser/ui/views/bookmark_menu_controller_views.cc
+++ b/chrome/browser/ui/views/bookmark_menu_controller_views.cc
@@ -12,7 +12,7 @@
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/bookmarks/bookmark_utils.h"
#include "chrome/browser/metrics/user_metrics.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/page_navigator.h"
#include "chrome/browser/views/bookmark_bar_view.h"
#include "chrome/browser/views/event_utils.h"
diff --git a/chrome/browser/ui/views/browser_actions_container.cc b/chrome/browser/ui/views/browser_actions_container.cc
index 268dd13..c2512f2 100644
--- a/chrome/browser/ui/views/browser_actions_container.cc
+++ b/chrome/browser/ui/views/browser_actions_container.cc
@@ -15,7 +15,7 @@
#include "chrome/browser/extensions/extension_host.h"
#include "chrome/browser/extensions/extension_tabs_module.h"
#include "chrome/browser/extensions/extensions_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/renderer_host/render_widget_host_view.h"
#include "chrome/browser/tab_contents/tab_contents.h"
diff --git a/chrome/browser/ui/views/browser_actions_container_browsertest.cc b/chrome/browser/ui/views/browser_actions_container_browsertest.cc
index 79f3c99..6b9ce5c 100644
--- a/chrome/browser/ui/views/browser_actions_container_browsertest.cc
+++ b/chrome/browser/ui/views/browser_actions_container_browsertest.cc
@@ -5,7 +5,7 @@
#include "chrome/browser/extensions/browser_action_test_util.h"
#include "chrome/browser/extensions/extension_browsertest.h"
#include "chrome/browser/extensions/extensions_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/views/browser_actions_container.h"
#include "chrome/common/chrome_switches.h"
diff --git a/chrome/browser/ui/views/clear_browsing_data.cc b/chrome/browser/ui/views/clear_browsing_data.cc
index 1968d13..0f9a331 100644
--- a/chrome/browser/ui/views/clear_browsing_data.cc
+++ b/chrome/browser/ui/views/clear_browsing_data.cc
@@ -9,7 +9,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_window.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/ui/browser.h"
#if defined(OS_WIN)
diff --git a/chrome/browser/ui/views/clear_browsing_data_view.cc b/chrome/browser/ui/views/clear_browsing_data_view.cc
index c03a477..1aec286 100644
--- a/chrome/browser/ui/views/clear_browsing_data_view.cc
+++ b/chrome/browser/ui/views/clear_browsing_data_view.cc
@@ -9,7 +9,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_window.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/pref_names.h"
diff --git a/chrome/browser/ui/views/clear_data_view.cc b/chrome/browser/ui/views/clear_data_view.cc
index d759f71..9703277 100644
--- a/chrome/browser/ui/views/clear_data_view.cc
+++ b/chrome/browser/ui/views/clear_data_view.cc
@@ -9,7 +9,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_window.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/views/clear_browsing_data.h"
diff --git a/chrome/browser/ui/views/clear_server_data.cc b/chrome/browser/ui/views/clear_server_data.cc
index 7a253c8..da2ac87 100644
--- a/chrome/browser/ui/views/clear_server_data.cc
+++ b/chrome/browser/ui/views/clear_server_data.cc
@@ -11,7 +11,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_window.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/ui/browser.h"
diff --git a/chrome/browser/ui/views/collected_cookies_win.cc b/chrome/browser/ui/views/collected_cookies_win.cc
index 3f25992..93556fb 100644
--- a/chrome/browser/ui/views/collected_cookies_win.cc
+++ b/chrome/browser/ui/views/collected_cookies_win.cc
@@ -7,7 +7,7 @@
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "chrome/browser/cookies_tree_model.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/common/notification_service.h"
#include "gfx/color_utils.h"
diff --git a/chrome/browser/ui/views/constrained_html_delegate_gtk.cc b/chrome/browser/ui/views/constrained_html_delegate_gtk.cc
index 7680fd8..60f3ec4 100644
--- a/chrome/browser/ui/views/constrained_html_delegate_gtk.cc
+++ b/chrome/browser/ui/views/constrained_html_delegate_gtk.cc
@@ -8,7 +8,7 @@
#include "chrome/browser/dom_ui/html_dialog_ui.h"
#include "chrome/browser/gtk/constrained_window_gtk.h"
#include "chrome/browser/gtk/gtk_util.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/ui/views/tab_contents/tab_contents_container.h"
#include "gfx/rect.h"
diff --git a/chrome/browser/ui/views/constrained_html_delegate_win.cc b/chrome/browser/ui/views/constrained_html_delegate_win.cc
index 6d53e22..34d638e 100644
--- a/chrome/browser/ui/views/constrained_html_delegate_win.cc
+++ b/chrome/browser/ui/views/constrained_html_delegate_win.cc
@@ -6,7 +6,7 @@
#include "chrome/browser/dom_ui/html_dialog_tab_contents_delegate.h"
#include "chrome/browser/dom_ui/html_dialog_ui.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/views/tab_contents/tab_contents_container.h"
#include "gfx/rect.h"
diff --git a/chrome/browser/ui/views/constrained_window_win.cc b/chrome/browser/ui/views/constrained_window_win.cc
index 6079e0b..d13f9fd 100644
--- a/chrome/browser/ui/views/constrained_window_win.cc
+++ b/chrome/browser/ui/views/constrained_window_win.cc
@@ -9,7 +9,7 @@
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents_view.h"
#include "chrome/browser/ui/toolbar/toolbar_model.h"
diff --git a/chrome/browser/ui/views/content_setting_bubble_contents.cc b/chrome/browser/ui/views/content_setting_bubble_contents.cc
index ff4561c..48e82aa 100644
--- a/chrome/browser/ui/views/content_setting_bubble_contents.cc
+++ b/chrome/browser/ui/views/content_setting_bubble_contents.cc
@@ -14,7 +14,7 @@
#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/content_setting_bubble_model.h"
#include "chrome/browser/plugin_updater.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/views/browser_dialogs.h"
#include "chrome/browser/views/info_bubble.h"
diff --git a/chrome/browser/ui/views/cookie_info_view.cc b/chrome/browser/ui/views/cookie_info_view.cc
index f2a1bb1..f17421c 100644
--- a/chrome/browser/ui/views/cookie_info_view.cc
+++ b/chrome/browser/ui/views/cookie_info_view.cc
@@ -13,7 +13,7 @@
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/cookies_tree_model.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "gfx/canvas.h"
#include "gfx/color_utils.h"
#include "grit/generated_resources.h"
diff --git a/chrome/browser/ui/views/create_application_shortcut_view.cc b/chrome/browser/ui/views/create_application_shortcut_view.cc
index 2867c9a..4532222 100644
--- a/chrome/browser/ui/views/create_application_shortcut_view.cc
+++ b/chrome/browser/ui/views/create_application_shortcut_view.cc
@@ -10,7 +10,7 @@
#include "base/utf_string_conversions.h"
#include "base/win/windows_version.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents_delegate.h"
#include "chrome/common/chrome_constants.h"
diff --git a/chrome/browser/ui/views/default_search_view.cc b/chrome/browser/ui/views/default_search_view.cc
index d57ffc4..34dcbf1 100644
--- a/chrome/browser/ui/views/default_search_view.cc
+++ b/chrome/browser/ui/views/default_search_view.cc
@@ -10,7 +10,7 @@
#include "app/message_box_flags.h"
#include "app/resource_bundle.h"
#include "base/utf_string_conversions.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/search_engines/template_url_prepopulate_data.h"
diff --git a/chrome/browser/ui/views/extensions/browser_action_drag_data.cc b/chrome/browser/ui/views/extensions/browser_action_drag_data.cc
index 6ab54ce..565c89c 100644
--- a/chrome/browser/ui/views/extensions/browser_action_drag_data.cc
+++ b/chrome/browser/ui/views/extensions/browser_action_drag_data.cc
@@ -7,7 +7,7 @@
#include "base/logging.h"
#include "base/pickle.h"
#include "base/string_util.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
const char* BrowserActionDragData::kClipboardFormatString =
"chromium/x-browser-actions";
diff --git a/chrome/browser/ui/views/extensions/browser_action_drag_data.h b/chrome/browser/ui/views/extensions/browser_action_drag_data.h
index ae26cca..1332a2c 100644
--- a/chrome/browser/ui/views/extensions/browser_action_drag_data.h
+++ b/chrome/browser/ui/views/extensions/browser_action_drag_data.h
@@ -9,7 +9,7 @@
#include <string>
#include "base/basictypes.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#if defined(TOOLKIT_VIEWS)
#include "app/os_exchange_data.h"
diff --git a/chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.cc b/chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.cc
index aa072f6..1ce95eb 100644
--- a/chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.cc
+++ b/chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.cc
@@ -7,7 +7,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_list.h"
#include "chrome/browser/extensions/extension_context_menu_model.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/views/browser_actions_container.h"
#include "chrome/browser/views/extensions/browser_action_drag_data.h"
diff --git a/chrome/browser/ui/views/extensions/extension_installed_bubble.cc b/chrome/browser/ui/views/extensions/extension_installed_bubble.cc
index d779197..50edc13 100644
--- a/chrome/browser/ui/views/extensions/extension_installed_bubble.cc
+++ b/chrome/browser/ui/views/extensions/extension_installed_bubble.cc
@@ -9,7 +9,7 @@
#include "base/message_loop.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_window.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/views/browser_actions_container.h"
#include "chrome/browser/views/frame/browser_view.h"
diff --git a/chrome/browser/ui/views/extensions/extension_popup.cc b/chrome/browser/ui/views/extensions/extension_popup.cc
index 77bd298..5a5120c 100644
--- a/chrome/browser/ui/views/extensions/extension_popup.cc
+++ b/chrome/browser/ui/views/extensions/extension_popup.cc
@@ -8,7 +8,7 @@
#include "chrome/browser/debugger/devtools_toggle_action.h"
#include "chrome/browser/extensions/extension_host.h"
#include "chrome/browser/extensions/extension_process_manager.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_host/render_widget_host_view.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/ui/browser.h"
diff --git a/chrome/browser/ui/views/find_bar_view.cc b/chrome/browser/ui/views/find_bar_view.cc
index 261ea1d..023ee57 100644
--- a/chrome/browser/ui/views/find_bar_view.cc
+++ b/chrome/browser/ui/views/find_bar_view.cc
@@ -11,7 +11,7 @@
#include "base/string_number_conversions.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/themes/browser_theme_provider.h"
#include "chrome/browser/ui/find_bar/find_bar_controller.h"
diff --git a/chrome/browser/ui/views/first_run_search_engine_view.cc b/chrome/browser/ui/views/first_run_search_engine_view.cc
index be9acb1..fa4e6a7 100644
--- a/chrome/browser/ui/views/first_run_search_engine_view.cc
+++ b/chrome/browser/ui/views/first_run_search_engine_view.cc
@@ -13,7 +13,7 @@
#include "base/i18n/rtl.h"
#include "base/rand_util.h"
#include "base/time.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/search_engine_type.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
diff --git a/chrome/browser/ui/views/frame/browser_frame_gtk.cc b/chrome/browser/ui/views/frame/browser_frame_gtk.cc
index ad20334..17f6a07 100644
--- a/chrome/browser/ui/views/frame/browser_frame_gtk.cc
+++ b/chrome/browser/ui/views/frame/browser_frame_gtk.cc
@@ -5,7 +5,7 @@
#include "chrome/browser/views/frame/browser_frame_gtk.h"
#include "base/logging.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/themes/browser_theme_provider.h"
#include "chrome/browser/ui/status_bubble.h"
#include "chrome/browser/ui/views/frame/app_panel_browser_frame_view.h"
diff --git a/chrome/browser/ui/views/frame/browser_frame_win.cc b/chrome/browser/ui/views/frame/browser_frame_win.cc
index d7e99fa..2fc188d 100644
--- a/chrome/browser/ui/views/frame/browser_frame_win.cc
+++ b/chrome/browser/ui/views/frame/browser_frame_win.cc
@@ -12,7 +12,7 @@
#include "app/win_util.h"
#include "base/win_util.h"
#include "chrome/browser/accessibility/browser_accessibility_state.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/browser_list.h"
#include "chrome/browser/themes/browser_theme_provider.h"
#include "chrome/browser/views/frame/app_panel_browser_frame_view.h"
diff --git a/chrome/browser/ui/views/frame/browser_root_view.cc b/chrome/browser/ui/views/frame/browser_root_view.cc
index 7264a7f..51a12a1 100644
--- a/chrome/browser/ui/views/frame/browser_root_view.cc
+++ b/chrome/browser/ui/views/frame/browser_root_view.cc
@@ -10,7 +10,7 @@
#include "chrome/browser/autocomplete/autocomplete.h"
#include "chrome/browser/autocomplete/autocomplete_classifier.h"
#include "chrome/browser/autocomplete/autocomplete_match.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/omnibox/location_bar.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/frame/browser_frame.h"
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 9985a83..26a7a7b 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -28,7 +28,7 @@
#include "chrome/browser/ntp_background_util.h"
#include "chrome/browser/page_info_window.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_host/render_widget_host_view.h"
#include "chrome/browser/sessions/tab_restore_service.h"
#include "chrome/browser/sidebar/sidebar_container.h"
diff --git a/chrome/browser/ui/views/instant_confirm_view.cc b/chrome/browser/ui/views/instant_confirm_view.cc
index bc750e7..173a2a2 100644
--- a/chrome/browser/ui/views/instant_confirm_view.cc
+++ b/chrome/browser/ui/views/instant_confirm_view.cc
@@ -9,7 +9,7 @@
#include "chrome/browser/instant/instant_confirm_dialog.h"
#include "chrome/browser/instant/instant_controller.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/pref_names.h"
#include "grit/generated_resources.h"
diff --git a/chrome/browser/ui/views/keyword_editor_view.cc b/chrome/browser/ui/views/keyword_editor_view.cc
index 6cd877c..610fa9e 100644
--- a/chrome/browser/ui/views/keyword_editor_view.cc
+++ b/chrome/browser/ui/views/keyword_editor_view.cc
@@ -11,7 +11,7 @@
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/search_engines/template_url_table_model.h"
diff --git a/chrome/browser/ui/views/location_bar/keyword_hint_view.cc b/chrome/browser/ui/views/location_bar/keyword_hint_view.cc
index eec0dd1..5d9192f 100644
--- a/chrome/browser/ui/views/location_bar/keyword_hint_view.cc
+++ b/chrome/browser/ui/views/location_bar/keyword_hint_view.cc
@@ -8,7 +8,7 @@
#include "app/resource_bundle.h"
#include "base/logging.h"
#include "chrome/app/chrome_command_ids.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "gfx/canvas.h"
#include "grit/generated_resources.h"
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index 9b78c6b..2d377e0 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -21,7 +21,7 @@
#include "chrome/browser/extensions/extension_browser_event_router.h"
#include "chrome/browser/extensions/extensions_service.h"
#include "chrome/browser/instant/instant_controller.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_host/render_widget_host_view.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
diff --git a/chrome/browser/ui/views/location_bar/page_action_image_view.cc b/chrome/browser/ui/views/location_bar/page_action_image_view.cc
index c7155bf..c149aca 100644
--- a/chrome/browser/ui/views/location_bar/page_action_image_view.cc
+++ b/chrome/browser/ui/views/location_bar/page_action_image_view.cc
@@ -8,7 +8,7 @@
#include "chrome/browser/browser_list.h"
#include "chrome/browser/extensions/extension_browser_event_router.h"
#include "chrome/browser/extensions/extensions_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/views/frame/browser_view.h"
#include "chrome/browser/views/location_bar/location_bar_view.h"
#include "chrome/browser/platform_util.h"
diff --git a/chrome/browser/ui/views/location_bar/selected_keyword_view.cc b/chrome/browser/ui/views/location_bar/selected_keyword_view.cc
index fec984e..69b639c 100644
--- a/chrome/browser/ui/views/location_bar/selected_keyword_view.cc
+++ b/chrome/browser/ui/views/location_bar/selected_keyword_view.cc
@@ -7,7 +7,7 @@
#include "app/l10n_util.h"
#include "base/logging.h"
#include "chrome/browser/search_engines/template_url_model.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/omnibox/location_bar_util.h"
#include "chrome/browser/ui/views/location_bar/keyword_hint_view.h"
#include "grit/generated_resources.h"
diff --git a/chrome/browser/ui/views/login_view.h b/chrome/browser/ui/views/login_view.h
index 0a345bf..2c529f5 100644
--- a/chrome/browser/ui/views/login_view.h
+++ b/chrome/browser/ui/views/login_view.h
@@ -7,7 +7,7 @@
#pragma once
#include "base/task.h"
-#include "chrome/browser/login_model.h"
+#include "chrome/browser/ui/login/login_model.h"
#include "views/view.h"
namespace views {
diff --git a/chrome/browser/ui/views/notifications/balloon_view.cc b/chrome/browser/ui/views/notifications/balloon_view.cc
index d2696d4..e0d7bf8 100644
--- a/chrome/browser/ui/views/notifications/balloon_view.cc
+++ b/chrome/browser/ui/views/notifications/balloon_view.cc
@@ -16,7 +16,7 @@
#include "chrome/browser/notifications/desktop_notification_service.h"
#include "chrome/browser/notifications/notification.h"
#include "chrome/browser/notifications/notification_options_menu_model.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/renderer_host/render_widget_host_view.h"
#include "chrome/browser/themes/browser_theme_provider.h"
diff --git a/chrome/browser/ui/views/options/advanced_contents_view.cc b/chrome/browser/ui/views/options/advanced_contents_view.cc
index 056f08d..7322f3a 100644
--- a/chrome/browser/ui/views/options/advanced_contents_view.cc
+++ b/chrome/browser/ui/views/options/advanced_contents_view.cc
@@ -34,7 +34,7 @@
#include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h"
#include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h"
#include "chrome/browser/printing/cloud_print/cloud_print_url.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_host/resource_dispatcher_host.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/browser/shell_dialogs.h"
diff --git a/chrome/browser/ui/views/options/advanced_page_view.cc b/chrome/browser/ui/views/options/advanced_page_view.cc
index 0c42e3b..287c124 100644
--- a/chrome/browser/ui/views/options/advanced_page_view.cc
+++ b/chrome/browser/ui/views/options/advanced_page_view.cc
@@ -7,7 +7,7 @@
#include "app/l10n_util.h"
#include "app/message_box_flags.h"
#include "base/string_util.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/options/options_util.h"
#include "chrome/browser/ui/views/options/advanced_contents_view.h"
#include "chrome/browser/ui/views/options/managed_prefs_banner_view.h"
diff --git a/chrome/browser/ui/views/options/content_filter_page_view.cc b/chrome/browser/ui/views/options/content_filter_page_view.cc
index ebceafa..d331540 100644
--- a/chrome/browser/ui/views/options/content_filter_page_view.cc
+++ b/chrome/browser/ui/views/options/content_filter_page_view.cc
@@ -12,7 +12,7 @@
#include "chrome/browser/notifications/desktop_notification_service.h"
#include "chrome/browser/notifications/notification_exceptions_table_model.h"
#include "chrome/browser/plugin_exceptions_table_model.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/views/options/exceptions_view.h"
#include "chrome/browser/views/options/simple_content_exceptions_view.h"
#include "chrome/common/chrome_switches.h"
diff --git a/chrome/browser/ui/views/options/content_page_view.cc b/chrome/browser/ui/views/options/content_page_view.cc
index 8ba1dd8..b5f3635 100644
--- a/chrome/browser/ui/views/options/content_page_view.cc
+++ b/chrome/browser/ui/views/options/content_page_view.cc
@@ -18,7 +18,7 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_window.h"
#include "chrome/browser/importer/importer_data_types.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/sync_ui_util.h"
#include "chrome/browser/sync/sync_setup_wizard.h"
#include "chrome/browser/ui/browser.h"
diff --git a/chrome/browser/ui/views/options/content_settings_window_view.cc b/chrome/browser/ui/views/options/content_settings_window_view.cc
index 2a2146c..d42b28c 100644
--- a/chrome/browser/ui/views/options/content_settings_window_view.cc
+++ b/chrome/browser/ui/views/options/content_settings_window_view.cc
@@ -8,7 +8,7 @@
#include "base/stl_util-inl.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/views/options/advanced_page_view.h"
#include "chrome/browser/views/options/content_filter_page_view.h"
#include "chrome/browser/views/options/cookie_filter_page_view.h"
diff --git a/chrome/browser/ui/views/options/cookie_filter_page_view.cc b/chrome/browser/ui/views/options/cookie_filter_page_view.cc
index 0814b24..7b8db39 100644
--- a/chrome/browser/ui/views/options/cookie_filter_page_view.cc
+++ b/chrome/browser/ui/views/options/cookie_filter_page_view.cc
@@ -6,7 +6,7 @@
#include "app/l10n_util.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/options/show_options_url.h"
#include "chrome/browser/ui/views/options/cookies_view.h"
#include "chrome/common/pref_names.h"
diff --git a/chrome/browser/ui/views/options/cookies_view.cc b/chrome/browser/ui/views/options/cookies_view.cc
index 5e2b6d0..e06b511 100644
--- a/chrome/browser/ui/views/options/cookies_view.cc
+++ b/chrome/browser/ui/views/options/cookies_view.cc
@@ -9,7 +9,7 @@
#include "app/l10n_util.h"
#include "base/message_loop.h"
#include "base/string_util.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/views/appcache_info_view.h"
#include "chrome/browser/views/cookie_info_view.h"
#include "chrome/browser/views/database_info_view.h"
diff --git a/chrome/browser/ui/views/options/exceptions_page_view.cc b/chrome/browser/ui/views/options/exceptions_page_view.cc
index 7788c5c..eb5d8c6 100644
--- a/chrome/browser/ui/views/options/exceptions_page_view.cc
+++ b/chrome/browser/ui/views/options/exceptions_page_view.cc
@@ -8,7 +8,7 @@
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
#include "grit/generated_resources.h"
#include "views/background.h"
diff --git a/chrome/browser/ui/views/options/fonts_languages_window_view.cc b/chrome/browser/ui/views/options/fonts_languages_window_view.cc
index cab82c7..edf0fa2 100644
--- a/chrome/browser/ui/views/options/fonts_languages_window_view.cc
+++ b/chrome/browser/ui/views/options/fonts_languages_window_view.cc
@@ -6,7 +6,7 @@
#include "app/l10n_util.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/views/options/fonts_page_view.h"
#include "chrome/browser/views/options/languages_page_view.h"
#include "chrome/common/chrome_constants.h"
diff --git a/chrome/browser/ui/views/options/fonts_page_view.cc b/chrome/browser/ui/views/options/fonts_page_view.cc
index 3a98b15..ddbc676 100644
--- a/chrome/browser/ui/views/options/fonts_page_view.cc
+++ b/chrome/browser/ui/views/options/fonts_page_view.cc
@@ -18,7 +18,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/default_encoding_combo_model.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/shell_dialogs.h"
#include "chrome/common/pref_names.h"
#include "gfx/canvas_skia.h"
diff --git a/chrome/browser/ui/views/options/general_page_view.cc b/chrome/browser/ui/views/options/general_page_view.cc
index 98135ab..082cdca 100644
--- a/chrome/browser/ui/views/options/general_page_view.cc
+++ b/chrome/browser/ui/views/options/general_page_view.cc
@@ -18,7 +18,7 @@
#include "chrome/browser/instant/instant_controller.h"
#include "chrome/browser/net/url_fixer_upper.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/prefs/session_startup_pref.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
diff --git a/chrome/browser/ui/views/options/languages_page_view.cc b/chrome/browser/ui/views/options/languages_page_view.cc
index 207841c..9abe7c4 100644
--- a/chrome/browser/ui/views/options/languages_page_view.cc
+++ b/chrome/browser/ui/views/options/languages_page_view.cc
@@ -19,7 +19,7 @@
#include "chrome/browser/language_combobox_model.h"
#include "chrome/browser/language_order_table_model.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/shell_dialogs.h"
#include "chrome/browser/views/restart_message_box.h"
#include "chrome/common/chrome_switches.h"
diff --git a/chrome/browser/ui/views/options/options_window_view.cc b/chrome/browser/ui/views/options/options_window_view.cc
index dc3518b..ae7f545 100644
--- a/chrome/browser/ui/views/options/options_window_view.cc
+++ b/chrome/browser/ui/views/options/options_window_view.cc
@@ -6,7 +6,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/options/options_window.h"
diff --git a/chrome/browser/ui/views/options/passwords_page_view.cc b/chrome/browser/ui/views/options/passwords_page_view.cc
index e33b0b6..cdb3187 100644
--- a/chrome/browser/ui/views/options/passwords_page_view.cc
+++ b/chrome/browser/ui/views/options/passwords_page_view.cc
@@ -10,7 +10,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/password_manager/password_store.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
#include "grit/generated_resources.h"
#include "views/background.h"
diff --git a/chrome/browser/ui/views/options/passwords_page_view.h b/chrome/browser/ui/views/options/passwords_page_view.h
index 0204db5..f465b57 100644
--- a/chrome/browser/ui/views/options/passwords_page_view.h
+++ b/chrome/browser/ui/views/options/passwords_page_view.h
@@ -13,7 +13,7 @@
#include "base/scoped_ptr.h"
#include "base/stl_util-inl.h"
#include "chrome/browser/password_manager/password_store.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/prefs/pref_member.h"
#include "chrome/browser/views/confirm_message_box_dialog.h"
#include "chrome/browser/views/options/options_page_view.h"
diff --git a/chrome/browser/ui/views/select_file_dialog.cc b/chrome/browser/ui/views/select_file_dialog.cc
index 702d546..f012838 100644
--- a/chrome/browser/ui/views/select_file_dialog.cc
+++ b/chrome/browser/ui/views/select_file_dialog.cc
@@ -15,7 +15,7 @@
#include "chrome/browser/browser_list.h"
#include "chrome/browser/browser_thread.h"
#include "chrome/browser/dom_ui/html_dialog_ui.h"
-#include "chrome/browser/profile_manager.h"
+#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/shell_dialogs.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/ui/browser.h"
diff --git a/chrome/browser/ui/views/tab_contents/render_view_context_menu_views.cc b/chrome/browser/ui/views/tab_contents/render_view_context_menu_views.cc
index e7ac1a6..66d3ef7 100644
--- a/chrome/browser/ui/views/tab_contents/render_view_context_menu_views.cc
+++ b/chrome/browser/ui/views/tab_contents/render_view_context_menu_views.cc
@@ -7,7 +7,7 @@
#include "app/keyboard_codes.h"
#include "base/compiler_specific.h"
#include "chrome/app/chrome_command_ids.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "grit/generated_resources.h"
#include "views/accelerator.h"
#include "views/controls/menu/menu_2.h"
diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_drag_win.cc b/chrome/browser/ui/views/tab_contents/tab_contents_drag_win.cc
index bc31aac..34a4570 100644
--- a/chrome/browser/ui/views/tab_contents/tab_contents_drag_win.cc
+++ b/chrome/browser/ui/views/tab_contents/tab_contents_drag_win.cc
@@ -18,7 +18,7 @@
#include "chrome/browser/download/download_util.h"
#include "chrome/browser/download/drag_download_file.h"
#include "chrome/browser/download/drag_download_util.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/web_drag_source_win.h"
#include "chrome/browser/tab_contents/web_drag_utils_win.h"
diff --git a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
index c9b96eb..3a64df6 100644
--- a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
+++ b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
@@ -6,7 +6,7 @@
#include "base/auto_reset.h"
#include "base/command_line.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/metrics/user_metrics.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/tab_contents/tab_contents.h"
diff --git a/chrome/browser/ui/views/theme_background.cc b/chrome/browser/ui/views/theme_background.cc
index ad8d2ed..b2320fc 100644
--- a/chrome/browser/ui/views/theme_background.cc
+++ b/chrome/browser/ui/views/theme_background.cc
@@ -5,7 +5,7 @@
#include "chrome/browser/views/theme_background.h"
#include "app/resource_bundle.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/themes/browser_theme_provider.h"
#include "chrome/browser/views/frame/browser_view.h"
#include "gfx/canvas.h"
diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc
index f2c5e2b..5163c9d 100644
--- a/chrome/browser/ui/views/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar_view.cc
@@ -11,7 +11,7 @@
#include "chrome/browser/accessibility/browser_accessibility_state.h"
#include "chrome/browser/background_page_tracker.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/themes/browser_theme_provider.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
diff --git a/chrome/browser/ui/views/url_picker.cc b/chrome/browser/ui/views/url_picker.cc
index 4051e63..b94cd04 100644
--- a/chrome/browser/ui/views/url_picker.cc
+++ b/chrome/browser/ui/views/url_picker.cc
@@ -14,7 +14,7 @@
#include "chrome/browser/net/url_fixer_upper.h"
#include "chrome/browser/possible_url_model.h"
#include "chrome/browser/prefs/pref_service.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/common/pref_names.h"
#include "grit/app_resources.h"
diff --git a/chrome/browser/ui/views/wrench_menu.cc b/chrome/browser/ui/views/wrench_menu.cc
index c798d5a..23d6f2b 100644
--- a/chrome/browser/ui/views/wrench_menu.cc
+++ b/chrome/browser/ui/views/wrench_menu.cc
@@ -11,7 +11,7 @@
#include "base/string_number_conversions.h"
#include "base/utf_string_conversions.h"
#include "chrome/app/chrome_command_ids.h"
-#include "chrome/browser/profile.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/notification_observer.h"