diff options
Diffstat (limited to 'chrome/browser/ui')
83 files changed, 1880 insertions, 159 deletions
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index b1eb3f0..0a375ea 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -57,11 +57,9 @@ #include "chrome/browser/google/google_util.h" #include "chrome/browser/host_zoom_map.h" #include "chrome/browser/instant/instant_controller.h" -#include "chrome/browser/location_bar.h" #include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/net/browser_url_util.h" #include "chrome/browser/net/url_fixer_upper.h" -#include "chrome/browser/options_window.h" #include "chrome/browser/platform_util.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h" @@ -71,7 +69,6 @@ #include "chrome/browser/sessions/session_service.h" #include "chrome/browser/sessions/session_types.h" #include "chrome/browser/sessions/tab_restore_service.h" -#include "chrome/browser/status_bubble.h" #include "chrome/browser/sync/profile_sync_service.h" #include "chrome/browser/sync/sync_ui_util.h" #include "chrome/browser/tab_closeable_state_watcher.h" @@ -80,13 +77,16 @@ #include "chrome/browser/tab_contents/navigation_entry.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/tab_contents/tab_contents_view.h" -#include "chrome/browser/tab_contents_wrapper.h" -#include "chrome/browser/tab_menu_model.h" #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/browser/ui/browser_navigator.h" #include "chrome/browser/ui/find_bar/find_bar.h" #include "chrome/browser/ui/find_bar/find_bar_controller.h" +#include "chrome/browser/ui/omnibox/location_bar.h" +#include "chrome/browser/ui/options/options_window.h" +#include "chrome/browser/ui/status_bubble.h" +#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/browser/ui/tabs/dock_info.h" +#include "chrome/browser/ui/tabs/tab_menu_model.h" #include "chrome/browser/ui/window_sizer.h" #include "chrome/browser/upgrade_detector.h" #include "chrome/browser/web_applications/web_app.h" @@ -122,8 +122,8 @@ #include "chrome/browser/ssl/ssl_error_info.h" #include "chrome/browser/shell_integration.h" #include "chrome/browser/task_manager/task_manager.h" -#include "chrome/browser/view_ids.h" -#include "chrome/browser/views/location_bar/location_bar_view.h" +#include "chrome/browser/ui/view_ids.h" +#include "chrome/browser/ui/views/location_bar/location_bar_view.h" #endif // OS_WIN #if defined(OS_MACOSX) diff --git a/chrome/browser/ui/browser_init.cc b/chrome/browser/ui/browser_init.cc index 2bd55dc..ff62f6f 100644 --- a/chrome/browser/ui/browser_init.cc +++ b/chrome/browser/ui/browser_init.cc @@ -49,10 +49,10 @@ #include "chrome/browser/tab_contents/navigation_controller.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/tab_contents/tab_contents_view.h" -#include "chrome/browser/tab_contents_wrapper.h" #include "chrome/browser/tabs/pinned_tab_codec.h" #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/browser/ui/browser_navigator.h" +#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" diff --git a/chrome/browser/ui/browser_navigator.cc b/chrome/browser/ui/browser_navigator.cc index f548099..72d9d54 100644 --- a/chrome/browser/ui/browser_navigator.cc +++ b/chrome/browser/ui/browser_navigator.cc @@ -8,14 +8,14 @@ #include "chrome/browser/browser_list.h" #include "chrome/browser/browser_url_handler.h" #include "chrome/browser/browser_window.h" -#include "chrome/browser/location_bar.h" #include "chrome/browser/profile.h" #include "chrome/browser/renderer_host/site_instance.h" -#include "chrome/browser/status_bubble.h" #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/browser/tab_contents/tab_contents.h" -#include "chrome/browser/tab_contents_wrapper.h" #include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/status_bubble.h" +#include "chrome/browser/ui/omnibox/location_bar.h" +#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/url_constants.h" diff --git a/chrome/browser/ui/browser_navigator_browsertest.cc b/chrome/browser/ui/browser_navigator_browsertest.cc index 299974d..87d38e5 100644 --- a/chrome/browser/ui/browser_navigator_browsertest.cc +++ b/chrome/browser/ui/browser_navigator_browsertest.cc @@ -6,12 +6,12 @@ #include "chrome/browser/profile.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/tab_contents/tab_contents_view.h" -#include "chrome/browser/tab_contents_wrapper.h" #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_navigator.h" #include "chrome/browser/ui/browser_window.h" +#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/common/chrome_switches.h" #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" diff --git a/chrome/browser/ui/cocoa/applescript/window_applescript.mm b/chrome/browser/ui/cocoa/applescript/window_applescript.mm index d5c2fa9..6a7ee4a 100644 --- a/chrome/browser/ui/cocoa/applescript/window_applescript.mm +++ b/chrome/browser/ui/cocoa/applescript/window_applescript.mm @@ -12,7 +12,6 @@ #import "chrome/browser/chrome_browser_application_mac.h" #include "chrome/browser/profile.h" #include "chrome/browser/tab_contents/tab_contents.h" -#include "chrome/browser/tab_contents_wrapper.h" #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" @@ -21,6 +20,7 @@ #include "chrome/browser/ui/cocoa/applescript/constants_applescript.h" #include "chrome/browser/ui/cocoa/applescript/error_applescript.h" #import "chrome/browser/ui/cocoa/applescript/tab_applescript.h" +#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/common/url_constants.h" @interface WindowAppleScript(WindowAppleScriptPrivateMethods) diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_all_tabs_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_all_tabs_controller.mm index e8ebaec..5e8b0f2 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_all_tabs_controller.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_all_tabs_controller.mm @@ -9,10 +9,10 @@ #include "base/sys_string_conversions.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/tab_contents/tab_contents.h" -#include "chrome/browser/tab_contents_wrapper.h" #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" +#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "grit/generated_resources.h" @implementation BookmarkAllTabsController diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.mm b/chrome/browser/ui/cocoa/browser_window_cocoa.mm index 003fec7..08bdea0 100644 --- a/chrome/browser/ui/cocoa/browser_window_cocoa.mm +++ b/chrome/browser/ui/cocoa/browser_window_cocoa.mm @@ -19,7 +19,6 @@ #include "chrome/browser/sidebar/sidebar_container.h" #include "chrome/browser/sidebar/sidebar_manager.h" #include "chrome/browser/tab_contents/tab_contents.h" -#include "chrome/browser/tab_contents_wrapper.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" #import "chrome/browser/ui/cocoa/browser_window_controller.h" @@ -41,6 +40,7 @@ #include "chrome/browser/ui/cocoa/task_manager_mac.h" #import "chrome/browser/ui/cocoa/theme_install_bubble_view.h" #import "chrome/browser/ui/cocoa/toolbar_controller.h" +#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/native_web_keyboard_event.h" #include "chrome/common/notification_service.h" diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm index e96075a..a7ba862 100644 --- a/chrome/browser/ui/cocoa/browser_window_controller.mm +++ b/chrome/browser/ui/cocoa/browser_window_controller.mm @@ -16,14 +16,12 @@ #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/location_bar.h" #include "chrome/browser/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" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/tab_contents/tab_contents_view_mac.h" -#include "chrome/browser/tab_contents_wrapper.h" #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/browser/themes/browser_theme_provider.h" #include "chrome/browser/ui/browser.h" @@ -55,6 +53,8 @@ #import "chrome/browser/ui/cocoa/tab_view.h" #import "chrome/browser/ui/cocoa/tabpose_window.h" #import "chrome/browser/ui/cocoa/toolbar_controller.h" +#include "chrome/browser/ui/omnibox/location_bar.h" +#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/browser/ui/tabs/dock_info.h" #include "chrome/browser/ui/toolbar/encoding_menu_controller.h" #include "chrome/browser/ui/window_sizer.h" diff --git a/chrome/browser/ui/cocoa/instant_confirm_window_controller.mm b/chrome/browser/ui/cocoa/instant_confirm_window_controller.mm index a16f5e1..744a26e 100644 --- a/chrome/browser/ui/cocoa/instant_confirm_window_controller.mm +++ b/chrome/browser/ui/cocoa/instant_confirm_window_controller.mm @@ -9,7 +9,7 @@ #include "chrome/browser/instant/instant_confirm_dialog.h" #include "chrome/browser/instant/instant_controller.h" #include "chrome/browser/profile.h" -#include "chrome/browser/show_options_url.h" +#include "chrome/browser/ui/options/show_options_url.h" #include "gfx/native_widget_types.h" #include "googleurl/src/gurl.h" #import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h index d89ec36..2bf4f8c 100644 --- a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h +++ b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h @@ -17,7 +17,7 @@ #include "chrome/browser/autocomplete/autocomplete_edit_view_mac.h" #include "chrome/browser/extensions/image_loading_tracker.h" #include "chrome/browser/first_run/first_run.h" -#include "chrome/browser/location_bar.h" +#include "chrome/browser/ui/omnibox/location_bar.h" #include "chrome/browser/ui/toolbar/toolbar_model.h" #include "chrome/common/content_settings_types.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 6fbac24..4ed6ba2 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,6 @@ #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/location_bar_util.h" #include "chrome/browser/profile.h" #include "chrome/browser/search_engines/template_url.h" #include "chrome/browser/search_engines/template_url_model.h" @@ -45,6 +44,7 @@ #import "chrome/browser/ui/cocoa/location_bar/page_action_decoration.h" #import "chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.h" #import "chrome/browser/ui/cocoa/location_bar/star_decoration.h" +#include "chrome/browser/ui/omnibox/location_bar_util.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_action.h" #include "chrome/common/extensions/extension_resource.h" diff --git a/chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.mm b/chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.mm index 0bdd8e15..6aa6505 100644 --- a/chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.mm +++ b/chrome/browser/ui/cocoa/location_bar/selected_keyword_decoration.mm @@ -7,8 +7,8 @@ #include "app/l10n_util_mac.h" #include "base/utf_string_conversions.h" #import "chrome/browser/autocomplete/autocomplete_edit_view_mac.h" -#include "chrome/browser/location_bar_util.h" #import "chrome/browser/ui/cocoa/image_utils.h" +#include "chrome/browser/ui/omnibox/location_bar_util.h" #include "grit/theme_resources.h" #include "grit/generated_resources.h" diff --git a/chrome/browser/ui/cocoa/preferences_window_controller.h b/chrome/browser/ui/cocoa/preferences_window_controller.h index cfec955..9cd3190 100644 --- a/chrome/browser/ui/cocoa/preferences_window_controller.h +++ b/chrome/browser/ui/cocoa/preferences_window_controller.h @@ -6,10 +6,10 @@ #include "base/scoped_ptr.h" #include "base/scoped_nsobject.h" -#include "chrome/browser/options_window.h" #include "chrome/browser/prefs/pref_member.h" #include "chrome/browser/prefs/pref_set_observer.h" #include "chrome/browser/prefs/pref_change_registrar.h" +#include "chrome/browser/ui/options/options_window.h" namespace PreferencesWindowControllerInternal { class PrefObserverBridge; diff --git a/chrome/browser/ui/cocoa/preferences_window_controller.mm b/chrome/browser/ui/cocoa/preferences_window_controller.mm index de8459a..e255f62 100644 --- a/chrome/browser/ui/cocoa/preferences_window_controller.mm +++ b/chrome/browser/ui/cocoa/preferences_window_controller.mm @@ -28,15 +28,12 @@ #include "chrome/browser/metrics/metrics_service.h" #include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/net/url_fixer_upper.h" -#include "chrome/browser/options_util.h" -#include "chrome/browser/options_window.h" #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/safe_browsing/safe_browsing_service.h" #include "chrome/browser/shell_integration.h" -#include "chrome/browser/show_options_url.h" #include "chrome/browser/sync/profile_sync_service.h" #include "chrome/browser/sync/sync_ui_util.h" #include "chrome/browser/tab_contents/tab_contents.h" @@ -52,6 +49,9 @@ #import "chrome/browser/ui/cocoa/search_engine_list_model.h" #import "chrome/browser/ui/cocoa/vertical_gradient_view.h" #import "chrome/browser/ui/cocoa/window_size_autosaver.h" +#include "chrome/browser/ui/options/options_util.h" +#include "chrome/browser/ui/options/options_window.h" +#include "chrome/browser/ui/options/show_options_url.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/notification_details.h" #include "chrome/common/notification_observer.h" diff --git a/chrome/browser/ui/cocoa/preferences_window_controller_unittest.mm b/chrome/browser/ui/cocoa/preferences_window_controller_unittest.mm index 91993c2..bbb1746 100644 --- a/chrome/browser/ui/cocoa/preferences_window_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/preferences_window_controller_unittest.mm @@ -5,11 +5,11 @@ #import <Cocoa/Cocoa.h> #import "base/scoped_nsobject.h" -#include "chrome/browser/options_window.h" #import "chrome/browser/ui/cocoa/preferences_window_controller.h" #include "chrome/browser/ui/cocoa/browser_test_helper.h" #include "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/custom_home_pages_model.h" +#include "chrome/browser/ui/options/options_window.h" #include "chrome/common/pref_names.h" #include "testing/gtest/include/gtest/gtest.h" #import "testing/gtest_mac.h" diff --git a/chrome/browser/ui/cocoa/status_bubble_mac.h b/chrome/browser/ui/cocoa/status_bubble_mac.h index d32f67c..091fdc1 100644 --- a/chrome/browser/ui/cocoa/status_bubble_mac.h +++ b/chrome/browser/ui/cocoa/status_bubble_mac.h @@ -13,7 +13,7 @@ #include "base/string16.h" #include "base/task.h" -#include "chrome/browser/status_bubble.h" +#include "chrome/browser/ui/status_bubble.h" #include "googleurl/src/gurl.h" class GURL; diff --git a/chrome/browser/ui/cocoa/tab_controller.h b/chrome/browser/ui/cocoa/tab_controller.h index c85bb62..bd515bd 100644 --- a/chrome/browser/ui/cocoa/tab_controller.h +++ b/chrome/browser/ui/cocoa/tab_controller.h @@ -7,8 +7,8 @@ #pragma once #import <Cocoa/Cocoa.h> -#include "chrome/browser/tab_menu_model.h" #import "chrome/browser/ui/cocoa/hover_close_button.h" +#include "chrome/browser/ui/tabs/tab_menu_model.h" // The loading/waiting state of the tab. enum TabLoadingState { diff --git a/chrome/browser/ui/cocoa/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tab_strip_controller.mm index 46b7395..0b18213 100644 --- a/chrome/browser/ui/cocoa/tab_strip_controller.mm +++ b/chrome/browser/ui/cocoa/tab_strip_controller.mm @@ -25,7 +25,6 @@ #include "chrome/browser/tab_contents/navigation_entry.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/tab_contents/tab_contents_view.h" -#include "chrome/browser/tab_contents_wrapper.h" #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_navigator.h" @@ -40,6 +39,7 @@ #import "chrome/browser/ui/cocoa/throbber_view.h" #include "chrome/browser/ui/find_bar/find_bar.h" #include "chrome/browser/ui/find_bar/find_bar_controller.h" +#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "grit/app_resources.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" diff --git a/chrome/browser/ui/cocoa/tab_strip_controller_unittest.mm b/chrome/browser/ui/cocoa/tab_strip_controller_unittest.mm index 19a781c..189e57b 100644 --- a/chrome/browser/ui/cocoa/tab_strip_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/tab_strip_controller_unittest.mm @@ -6,13 +6,13 @@ #import "chrome/browser/browser_window.h" #include "chrome/browser/tab_contents/tab_contents.h" -#include "chrome/browser/tab_contents_wrapper.h" #include "chrome/browser/renderer_host/site_instance.h" #include "chrome/browser/ui/cocoa/browser_test_helper.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/new_tab_button.h" #import "chrome/browser/ui/cocoa/tab_strip_controller.h" #import "chrome/browser/ui/cocoa/tab_strip_view.h" +#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" diff --git a/chrome/browser/ui/cocoa/tabpose_window.mm b/chrome/browser/ui/cocoa/tabpose_window.mm index 47825f5..eb64972 100644 --- a/chrome/browser/ui/cocoa/tabpose_window.mm +++ b/chrome/browser/ui/cocoa/tabpose_window.mm @@ -19,13 +19,12 @@ #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/renderer_host/render_widget_host_view_mac.h" #include "chrome/browser/tab_contents/tab_contents.h" -#include "chrome/browser/tab_contents_wrapper.h" #include "chrome/browser/tab_contents/thumbnail_generator.h" -#include "chrome/browser/tab_contents_wrapper.h" #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h" #import "chrome/browser/ui/cocoa/browser_window_controller.h" #import "chrome/browser/ui/cocoa/tab_strip_controller.h" #import "chrome/browser/ui/cocoa/tab_strip_model_observer_bridge.h" +#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/common/pref_names.h" #include "grit/app_resources.h" #include "skia/ext/skia_utils_mac.h" diff --git a/chrome/browser/ui/cocoa/tabpose_window_unittest.mm b/chrome/browser/ui/cocoa/tabpose_window_unittest.mm index 46f0bca..97ba095 100644 --- a/chrome/browser/ui/cocoa/tabpose_window_unittest.mm +++ b/chrome/browser/ui/cocoa/tabpose_window_unittest.mm @@ -7,10 +7,10 @@ #import "chrome/browser/browser_window.h" #include "chrome/browser/renderer_host/site_instance.h" #include "chrome/browser/tab_contents/tab_contents.h" -#include "chrome/browser/tab_contents_wrapper.h" #include "chrome/browser/tabs/tab_strip_model.h" #import "chrome/browser/ui/cocoa/browser_test_helper.h" #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" +#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "testing/gtest/include/gtest/gtest.h" class TabposeWindowTest : public CocoaTest { diff --git a/chrome/browser/ui/cocoa/view_id_util.h b/chrome/browser/ui/cocoa/view_id_util.h index e4ca62c..6ea9524 100644 --- a/chrome/browser/ui/cocoa/view_id_util.h +++ b/chrome/browser/ui/cocoa/view_id_util.h @@ -9,7 +9,7 @@ #import <Cocoa/Cocoa.h> #include "gfx/native_widget_types.h" -#include "chrome/browser/view_ids.h" +#include "chrome/browser/ui/view_ids.h" // ViewIDs are a system that indexes important views in the browser window by a // ViewID identifier (integer). This is a useful compatibility for finding a diff --git a/chrome/browser/ui/input_window_dialog.h b/chrome/browser/ui/input_window_dialog.h new file mode 100644 index 0000000..aa7455a --- /dev/null +++ b/chrome/browser/ui/input_window_dialog.h @@ -0,0 +1,53 @@ +// 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. + +#ifndef CHROME_BROWSER_UI_INPUT_WINDOW_DIALOG_H_ +#define CHROME_BROWSER_UI_INPUT_WINDOW_DIALOG_H_ +#pragma once + +#include <string> + +#include "base/basictypes.h" +#include "gfx/native_widget_types.h" + +// Cross platform access to a modal input window. +class InputWindowDialog { + public: + class Delegate { + public: + virtual ~Delegate() {} + + // Checks whether |text| is a valid input string. + virtual bool IsValid(const std::wstring& text) = 0; + + // Callback for when the user clicks the OK button. + virtual void InputAccepted(const std::wstring& text) = 0; + + // Callback for when the user clicks the Cancel button. + virtual void InputCanceled() = 0; + }; + + // Creates a new input window dialog parented to |parent|. Ownership of + // |delegate| is taken by InputWindowDialog or InputWindowDialog's owner. + static InputWindowDialog* Create(gfx::NativeWindow parent, + const std::wstring& window_title, + const std::wstring& label, + const std::wstring& contents, + Delegate* delegate); + + // Displays the window. + virtual void Show() = 0; + + // Closes the window. + virtual void Close() = 0; + + protected: + InputWindowDialog() {} + virtual ~InputWindowDialog() {} + + private: + DISALLOW_COPY_AND_ASSIGN(InputWindowDialog); +}; + +#endif // CHROME_BROWSER_UI_INPUT_WINDOW_DIALOG_H_ diff --git a/chrome/browser/ui/input_window_dialog_gtk.cc b/chrome/browser/ui/input_window_dialog_gtk.cc new file mode 100644 index 0000000..1530701 --- /dev/null +++ b/chrome/browser/ui/input_window_dialog_gtk.cc @@ -0,0 +1,146 @@ +// 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/input_window_dialog.h" + +#include <gtk/gtk.h> + +#include "app/gtk_signal.h" +#include "base/message_loop.h" +#include "base/scoped_ptr.h" +#include "base/string_piece.h" +#include "base/utf_string_conversions.h" +#include "chrome/browser/gtk/gtk_util.h" + +class InputWindowDialogGtk : public InputWindowDialog { + public: + // Creates a dialog. Takes ownership of |delegate|. + InputWindowDialogGtk(GtkWindow* parent, + const std::string& window_title, + const std::string& label, + const std::string& contents, + Delegate* delegate); + virtual ~InputWindowDialogGtk(); + + virtual void Show(); + virtual void Close(); + + private: + CHROMEG_CALLBACK_0(InputWindowDialogGtk, void, OnEntryChanged, GtkEditable*); + CHROMEGTK_CALLBACK_1(InputWindowDialogGtk, void, OnResponse, int); + CHROMEGTK_CALLBACK_1(InputWindowDialogGtk, gboolean, + OnWindowDeleteEvent, GdkEvent*); + CHROMEGTK_CALLBACK_0(InputWindowDialogGtk, void, OnWindowDestroy); + + // The underlying gtk dialog window. + GtkWidget* dialog_; + + // The GtkEntry in this form. + GtkWidget* input_; + + // Our delegate. Consumes the window's output. + scoped_ptr<InputWindowDialog::Delegate> delegate_; +}; + + +InputWindowDialogGtk::InputWindowDialogGtk(GtkWindow* parent, + const std::string& window_title, + const std::string& label, + const std::string& contents, + Delegate* delegate) + : dialog_(gtk_dialog_new_with_buttons( + window_title.c_str(), + parent, + GTK_DIALOG_MODAL, + GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, + GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, + NULL)), + delegate_(delegate) { + gtk_dialog_set_default_response(GTK_DIALOG(dialog_), GTK_RESPONSE_ACCEPT); + gtk_dialog_set_has_separator(GTK_DIALOG(dialog_), FALSE); + + GtkWidget* content_area = GTK_DIALOG(dialog_)->vbox; + gtk_box_set_spacing(GTK_BOX(content_area), 18); + + GtkWidget* hbox = gtk_hbox_new(FALSE, 6); + GtkWidget* label_widget = gtk_label_new(label.c_str()); + gtk_box_pack_start(GTK_BOX(hbox), label_widget, FALSE, FALSE, 0); + + input_ = gtk_entry_new(); + gtk_entry_set_text(GTK_ENTRY(input_), contents.c_str()); + g_signal_connect(input_, "changed", + G_CALLBACK(OnEntryChangedThunk), this); + g_object_set(G_OBJECT(input_), "activates-default", TRUE, NULL); + gtk_box_pack_start(GTK_BOX(hbox), input_, TRUE, TRUE, 0); + + gtk_widget_show_all(hbox); + + gtk_box_pack_start(GTK_BOX(content_area), hbox, FALSE, FALSE, 0); + + g_signal_connect(dialog_, "response", + G_CALLBACK(OnResponseThunk), this); + g_signal_connect(dialog_, "delete-event", + G_CALLBACK(OnWindowDeleteEventThunk), this); + g_signal_connect(dialog_, "destroy", + G_CALLBACK(OnWindowDestroyThunk), this); +} + +InputWindowDialogGtk::~InputWindowDialogGtk() { +} + +void InputWindowDialogGtk::Show() { + gtk_util::ShowDialog(dialog_); +} + +void InputWindowDialogGtk::Close() { + // Under the model that we've inherited from Windows, dialogs can receive + // more than one Close() call inside the current message loop event. + if (dialog_) { + gtk_widget_destroy(GTK_WIDGET(dialog_)); + dialog_ = NULL; + } +} + +void InputWindowDialogGtk::OnEntryChanged(GtkEditable* entry) { + std::wstring value(UTF8ToWide(gtk_entry_get_text(GTK_ENTRY(entry)))); + gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog_), + GTK_RESPONSE_ACCEPT, + delegate_->IsValid(value)); +} + +void InputWindowDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { + if (response_id == GTK_RESPONSE_ACCEPT) { + std::wstring value(UTF8ToWide(gtk_entry_get_text(GTK_ENTRY(input_)))); + delegate_->InputAccepted(value); + } else { + delegate_->InputCanceled(); + } + Close(); +} + +gboolean InputWindowDialogGtk::OnWindowDeleteEvent(GtkWidget* widget, + GdkEvent* event) { + Close(); + + // Return true to prevent the gtk dialog from being destroyed. Close will + // destroy it for us and the default gtk_dialog_delete_event_handler() will + // force the destruction without us being able to stop it. + return TRUE; +} + +void InputWindowDialogGtk::OnWindowDestroy(GtkWidget* widget) { + MessageLoop::current()->DeleteSoon(FROM_HERE, this); +} + +InputWindowDialog* InputWindowDialog::Create(gfx::NativeWindow parent, + const std::wstring& window_title, + const std::wstring& label, + const std::wstring& contents, + Delegate* delegate) { + return new InputWindowDialogGtk(parent, + WideToUTF8(window_title), + WideToUTF8(label), + WideToUTF8(contents), + delegate); +} diff --git a/chrome/browser/ui/input_window_dialog_win.cc b/chrome/browser/ui/input_window_dialog_win.cc new file mode 100644 index 0000000..f6b8511 --- /dev/null +++ b/chrome/browser/ui/input_window_dialog_win.cc @@ -0,0 +1,235 @@ +// 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/input_window_dialog.h" + +#include "base/compiler_specific.h" +#include "base/message_loop.h" +#include "base/task.h" +#include "views/grid_layout.h" +#include "views/controls/label.h" +#include "views/controls/textfield/textfield.h" +#include "views/standard_layout.h" +#include "views/window/dialog_delegate.h" +#include "views/window/window.h" +#include "grit/generated_resources.h" + +// Width to make the text field, in pixels. +static const int kTextfieldWidth = 200; + +class ContentView; + +// The Windows implementation of the cross platform input dialog interface. +class WinInputWindowDialog : public InputWindowDialog { + public: + WinInputWindowDialog(HWND parent, + const std::wstring& window_title, + const std::wstring& label, + const std::wstring& contents, + Delegate* delegate); + virtual ~WinInputWindowDialog(); + + virtual void Show(); + virtual void Close(); + + const std::wstring& window_title() const { return window_title_; } + const std::wstring& label() const { return label_; } + const std::wstring& contents() const { return contents_; } + + InputWindowDialog::Delegate* delegate() { return delegate_.get(); } + + private: + // Our chrome views window. + views::Window* window_; + + // Strings to feed to the on screen window. + std::wstring window_title_; + std::wstring label_; + std::wstring contents_; + + // Our delegate. Consumes the window's output. + scoped_ptr<InputWindowDialog::Delegate> delegate_; +}; + +// ContentView, as the name implies, is the content view for the InputWindow. +// It registers accelerators that accept/cancel the input. +class ContentView : public views::View, + public views::DialogDelegate, + public views::Textfield::Controller { + public: + explicit ContentView(WinInputWindowDialog* delegate) + : delegate_(delegate), + ALLOW_THIS_IN_INITIALIZER_LIST(focus_grabber_factory_(this)) { + DCHECK(delegate_); + } + + // views::DialogDelegate overrides: + virtual bool IsDialogButtonEnabled( + MessageBoxFlags::DialogButton button) const; + virtual bool Accept(); + virtual bool Cancel(); + virtual void DeleteDelegate(); + virtual std::wstring GetWindowTitle() const; + virtual bool IsModal() const { return true; } + virtual views::View* GetContentsView(); + + // views::Textfield::Controller overrides: + virtual void ContentsChanged(views::Textfield* sender, + const std::wstring& new_contents); + virtual bool HandleKeystroke(views::Textfield*, + const views::Textfield::Keystroke&) { + return false; + } + + protected: + // views::View overrides: + virtual void ViewHierarchyChanged(bool is_add, views::View* parent, + views::View* child); + + private: + // Set up dialog controls and layout. + void InitControlLayout(); + + // Sets focus to the first focusable element within the dialog. + void FocusFirstFocusableControl(); + + // The Textfield that the user can type into. + views::Textfield* text_field_; + + // The delegate that the ContentView uses to communicate changes to the + // caller. + WinInputWindowDialog* delegate_; + + // Helps us set focus to the first Textfield in the window. + ScopedRunnableMethodFactory<ContentView> focus_grabber_factory_; + + DISALLOW_COPY_AND_ASSIGN(ContentView); +}; + +/////////////////////////////////////////////////////////////////////////////// +// ContentView, views::DialogDelegate implementation: + +bool ContentView::IsDialogButtonEnabled( + MessageBoxFlags::DialogButton button) const { + if (button == MessageBoxFlags::DIALOGBUTTON_OK && + !delegate_->delegate()->IsValid(text_field_->text())) { + return false; + } + return true; +} + +bool ContentView::Accept() { + delegate_->delegate()->InputAccepted(text_field_->text()); + return true; +} + +bool ContentView::Cancel() { + delegate_->delegate()->InputCanceled(); + return true; +} + +void ContentView::DeleteDelegate() { + delete delegate_; +} + +std::wstring ContentView::GetWindowTitle() const { + return delegate_->window_title(); +} + +views::View* ContentView::GetContentsView() { + return this; +} + +/////////////////////////////////////////////////////////////////////////////// +// ContentView, views::Textfield::Controller implementation: + +void ContentView::ContentsChanged(views::Textfield* sender, + const std::wstring& new_contents) { + GetDialogClientView()->UpdateDialogButtons(); +} + +/////////////////////////////////////////////////////////////////////////////// +// ContentView, protected: + +void ContentView::ViewHierarchyChanged(bool is_add, + views::View* parent, + views::View* child) { + if (is_add && child == this) + InitControlLayout(); +} + +/////////////////////////////////////////////////////////////////////////////// +// ContentView, private: + +void ContentView::InitControlLayout() { + text_field_ = new views::Textfield; + text_field_->SetText(delegate_->contents()); + text_field_->SetController(this); + + using views::ColumnSet; + using views::GridLayout; + + // TODO(sky): Vertical alignment should be baseline. + GridLayout* layout = CreatePanelGridLayout(this); + SetLayoutManager(layout); + + ColumnSet* c1 = layout->AddColumnSet(0); + c1->AddColumn(GridLayout::CENTER, GridLayout::CENTER, 0, + GridLayout::USE_PREF, 0, 0); + c1->AddPaddingColumn(0, kRelatedControlHorizontalSpacing); + c1->AddColumn(GridLayout::FILL, GridLayout::CENTER, 1, + GridLayout::USE_PREF, kTextfieldWidth, kTextfieldWidth); + + layout->StartRow(0, 0); + views::Label* label = new views::Label(delegate_->label()); + layout->AddView(label); + layout->AddView(text_field_); + + MessageLoop::current()->PostTask(FROM_HERE, + focus_grabber_factory_.NewRunnableMethod( + &ContentView::FocusFirstFocusableControl)); +} + +void ContentView::FocusFirstFocusableControl() { + text_field_->SelectAll(); + text_field_->RequestFocus(); +} + +WinInputWindowDialog::WinInputWindowDialog(HWND parent, + const std::wstring& window_title, + const std::wstring& label, + const std::wstring& contents, + Delegate* delegate) + : window_title_(window_title), + label_(label), + contents_(contents), + delegate_(delegate) { + window_ = views::Window::CreateChromeWindow(parent, gfx::Rect(), + new ContentView(this)); + window_->GetClientView()->AsDialogClientView()->UpdateDialogButtons(); +} + +WinInputWindowDialog::~WinInputWindowDialog() { +} + +void WinInputWindowDialog::Show() { + window_->Show(); +} + +void WinInputWindowDialog::Close() { + window_->Close(); +} + +// static +InputWindowDialog* InputWindowDialog::Create(HWND parent, + const std::wstring& window_title, + const std::wstring& label, + const std::wstring& contents, + Delegate* delegate) { + return new WinInputWindowDialog(parent, + window_title, + label, + contents, + delegate); +} diff --git a/chrome/browser/ui/omnibox/location_bar.h b/chrome/browser/ui/omnibox/location_bar.h new file mode 100644 index 0000000..87a6fa8 --- /dev/null +++ b/chrome/browser/ui/omnibox/location_bar.h @@ -0,0 +1,106 @@ +// 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. + +// The LocationBar class is a virtual interface, defining access to the +// window's location bar component. This class exists so that cross-platform +// components like the browser command system can talk to the platform +// specific implementations of the location bar control. It also allows the +// location bar to be mocked for testing. + +#ifndef CHROME_BROWSER_UI_OMNIBOX_LOCATION_BAR_H_ +#define CHROME_BROWSER_UI_OMNIBOX_LOCATION_BAR_H_ +#pragma once + +#include <string> + +#include "base/string16.h" +#include "chrome/browser/first_run/first_run.h" +#include "chrome/common/page_transition_types.h" +#include "webkit/glue/window_open_disposition.h" + +class AutocompleteEditView; +class ExtensionAction; +class LocationBarTesting; +class TabContents; + +class LocationBar { + public: + // Shows the first run information bubble anchored to the location bar. + virtual void ShowFirstRunBubble(FirstRun::BubbleType bubble_type) = 0; + + // Sets the suggested text to show in the omnibox. This is shown in addition + // to the current text of the omnibox. + virtual void SetSuggestedText(const string16& text) = 0; + + // Returns the string of text entered in the location bar. + virtual std::wstring GetInputString() const = 0; + + // Returns the WindowOpenDisposition that should be used to determine where + // to open a URL entered in the location bar. + virtual WindowOpenDisposition GetWindowOpenDisposition() const = 0; + + // Returns the PageTransition that should be recorded in history when the URL + // entered in the location bar is loaded. + virtual PageTransition::Type GetPageTransition() const = 0; + + // Accepts the current string of text entered in the location bar. + virtual void AcceptInput() = 0; + + // Focuses the location bar. Optionally also selects its contents. + virtual void FocusLocation(bool select_all) = 0; + + // Clears the location bar, inserts an annoying little "?" turd and sets + // focus to it. + virtual void FocusSearch() = 0; + + // Updates the state of the images showing the content settings status. + virtual void UpdateContentSettingsIcons() = 0; + + // Updates the state of the page actions. + virtual void UpdatePageActions() = 0; + + // Called when the page-action data needs to be refreshed, e.g. when an + // extension is unloaded or crashes. + virtual void InvalidatePageActions() = 0; + + // Saves the state of the location bar to the specified TabContents, so that + // it can be restored later. (Done when switching tabs). + virtual void SaveStateToContents(TabContents* contents) = 0; + + // Reverts the location bar. The bar's permanent text will be shown. + virtual void Revert() = 0; + + // Returns a pointer to the text entry view. + virtual const AutocompleteEditView* location_entry() const = 0; + virtual AutocompleteEditView* location_entry() = 0; + + // Returns a pointer to the testing interface. + virtual LocationBarTesting* GetLocationBarForTesting() = 0; + + protected: + virtual ~LocationBar() {} +}; + +class LocationBarTesting { + public: + // Returns the total number of page actions in the Omnibox. + virtual int PageActionCount() = 0; + + // Returns the number of visible page actions in the Omnibox. + virtual int PageActionVisibleCount() = 0; + + // Returns the ExtensionAction at |index|. + virtual ExtensionAction* GetPageAction(size_t index) = 0; + + // Returns the visible ExtensionAction at |index|. + virtual ExtensionAction* GetVisiblePageAction(size_t index) = 0; + + // Simulates a left mouse pressed on the visible page action at |index|. + virtual void TestPageActionPressed(size_t index) = 0; + + protected: + virtual ~LocationBarTesting() {} +}; + +#endif // CHROME_BROWSER_UI_OMNIBOX_LOCATION_BAR_H_ diff --git a/chrome/browser/ui/omnibox/location_bar_util.cc b/chrome/browser/ui/omnibox/location_bar_util.cc new file mode 100644 index 0000000..00214ef --- /dev/null +++ b/chrome/browser/ui/omnibox/location_bar_util.cc @@ -0,0 +1,42 @@ +// 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/omnibox/location_bar_util.h" + +#include "app/l10n_util.h" +#include "base/i18n/rtl.h" +#include "chrome/browser/profile.h" +#include "chrome/browser/search_engines/template_url.h" +#include "chrome/browser/search_engines/template_url_model.h" + +namespace location_bar_util { + +std::wstring GetKeywordName(Profile* profile, const std::wstring& keyword) { +// Make sure the TemplateURL still exists. +// TODO(sky): Once LocationBarView adds a listener to the TemplateURLModel +// to track changes to the model, this should become a DCHECK. + const TemplateURL* template_url = + profile->GetTemplateURLModel()->GetTemplateURLForKeyword(keyword); + if (template_url) + return template_url->AdjustedShortNameForLocaleDirection(); + return std::wstring(); +} + +std::wstring CalculateMinString(const std::wstring& description) { + // Chop at the first '.' or whitespace. + const size_t dot_index = description.find(L'.'); + const size_t ws_index = description.find_first_of(kWhitespaceWide); + size_t chop_index = std::min(dot_index, ws_index); + std::wstring min_string; + if (chop_index == std::wstring::npos) { + // No dot or whitespace, truncate to at most 3 chars. + min_string = l10n_util::TruncateString(description, 3); + } else { + min_string = description.substr(0, chop_index); + } + base::i18n::AdjustStringForLocaleDirection(&min_string); + return min_string; +} + +} // namespace location_bar_util diff --git a/chrome/browser/ui/omnibox/location_bar_util.h b/chrome/browser/ui/omnibox/location_bar_util.h new file mode 100644 index 0000000..ca6a214 --- /dev/null +++ b/chrome/browser/ui/omnibox/location_bar_util.h @@ -0,0 +1,24 @@ +// 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. + +#ifndef CHROME_BROWSER_UI_OMNIBOX_LOCATION_BAR_UTIL_H_ +#define CHROME_BROWSER_UI_OMNIBOX_LOCATION_BAR_UTIL_H_ +#pragma once + +#include <string> + +class Profile; + +namespace location_bar_util { + +// Returns the short name for a keyword. +std::wstring GetKeywordName(Profile* profile, const std::wstring& keyword); + +// Build a short string to use in keyword-search when the field isn't +// very big. +std::wstring CalculateMinString(const std::wstring& description); + +} // namespace location_bar_util + +#endif // CHROME_BROWSER_UI_OMNIBOX_LOCATION_BAR_UTIL_H_ diff --git a/chrome/browser/ui/options/options_page_base.cc b/chrome/browser/ui/options/options_page_base.cc new file mode 100644 index 0000000..601e485 --- /dev/null +++ b/chrome/browser/ui/options/options_page_base.cc @@ -0,0 +1,36 @@ +// 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/options/options_page_base.h" + +#include "chrome/browser/metrics/user_metrics.h" +#include "chrome/browser/prefs/pref_service.h" +#include "chrome/common/notification_service.h" + +/////////////////////////////////////////////////////////////////////////////// +// OptionsPageBase + +OptionsPageBase::OptionsPageBase(Profile* profile) + : profile_(profile) { +} + +OptionsPageBase::~OptionsPageBase() { +} + +void OptionsPageBase::UserMetricsRecordAction(const UserMetricsAction& action, + PrefService* prefs) { + UserMetrics::RecordAction(action, profile()); + if (prefs) + prefs->ScheduleSavePersistentPrefs(); +} + +/////////////////////////////////////////////////////////////////////////////// +// OptionsPageBase, NotificationObserver implementation: + +void OptionsPageBase::Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details) { + if (type == NotificationType::PREF_CHANGED) + NotifyPrefChanged(Details<std::string>(details).ptr()); +} diff --git a/chrome/browser/ui/options/options_page_base.h b/chrome/browser/ui/options/options_page_base.h new file mode 100644 index 0000000..695df1cf --- /dev/null +++ b/chrome/browser/ui/options/options_page_base.h @@ -0,0 +1,62 @@ +// 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. + +#ifndef CHROME_BROWSER_UI_OPTIONS_OPTIONS_PAGE_BASE_H_ +#define CHROME_BROWSER_UI_OPTIONS_OPTIONS_PAGE_BASE_H_ +#pragma once + +#include <string> + +#include "base/basictypes.h" +#include "chrome/browser/metrics/user_metrics.h" +#include "chrome/browser/ui/options/options_window.h" +#include "chrome/common/notification_observer.h" + +class PrefService; +class Profile; +struct UserMetricsAction; + +/////////////////////////////////////////////////////////////////////////////// +// OptionsPageBase +// +// A base class for Options dialog pages that handles observing preferences +// +class OptionsPageBase : public NotificationObserver { + public: + virtual ~OptionsPageBase(); + + // Highlights the specified group to attract the user's attention. + virtual void HighlightGroup(OptionsGroup highlight_group) { } + + // Overridden from NotificationObserver: + virtual void Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details); + + protected: + // This class cannot be instantiated directly, but its constructor must be + // called by derived classes. + explicit OptionsPageBase(Profile* profile); + + // Returns the Profile associated with this page. + Profile* profile() const { return profile_; } + + // Records a user action and schedules the prefs file to be saved. + void UserMetricsRecordAction(const UserMetricsAction &action, + PrefService* prefs); + + // Allows the UI to update when a preference value changes. The parameter is + // the specific pref that changed, or NULL if all pref UI should be + // validated. This should be called during setup, but with NULL as the + // parameter to allow initial state to be set. + virtual void NotifyPrefChanged(const std::string* pref_name) {} + + private: + // The Profile associated with this page. + Profile* profile_; + + DISALLOW_COPY_AND_ASSIGN(OptionsPageBase); +}; + +#endif // CHROME_BROWSER_UI_OPTIONS_OPTIONS_PAGE_BASE_H_ diff --git a/chrome/browser/ui/options/options_util.cc b/chrome/browser/ui/options/options_util.cc new file mode 100644 index 0000000..465df98 --- /dev/null +++ b/chrome/browser/ui/options/options_util.cc @@ -0,0 +1,132 @@ +// 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/options/options_util.h" + +#include "base/thread_restrictions.h" +#include "chrome/browser/browser_process.h" +#include "chrome/browser/download/download_manager.h" +#include "chrome/browser/download/download_prefs.h" +#include "chrome/browser/content_settings/host_content_settings_map.h" +#include "chrome/browser/geolocation/geolocation_content_settings_map.h" +#include "chrome/browser/host_zoom_map.h" +#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/common/pref_names.h" +#include "chrome/installer/util/google_update_settings.h" + +// static +void OptionsUtil::ResetToDefaults(Profile* profile) { + // TODO(tc): It would be nice if we could generate this list automatically so + // changes to any of the options pages doesn't require updating this list + // manually. + PrefService* prefs = profile->GetPrefs(); + const char* kUserPrefs[] = { + prefs::kAcceptLanguages, + prefs::kAlternateErrorPagesEnabled, + prefs::kClearSiteDataOnExit, + prefs::kCookieBehavior, + prefs::kDefaultCharset, + prefs::kDefaultZoomLevel, + prefs::kDeleteBrowsingHistory, + prefs::kDeleteCache, + prefs::kDeleteCookies, + prefs::kDeleteDownloadHistory, + prefs::kDeleteFormData, + prefs::kDeletePasswords, + prefs::kDnsPrefetchingEnabled, +#if defined(OS_LINUX) || defined(OS_FREEBSD) || defined(OS_OPENBSD) + prefs::kCertRevocationCheckingEnabled, + prefs::kSSL3Enabled, + prefs::kTLS1Enabled, +#endif +#if defined(OS_CHROMEOS) + prefs::kTapToClickEnabled, + prefs::kTouchpadSensitivity, +#endif + prefs::kDownloadDefaultDirectory, + prefs::kDownloadExtensionsToOpen, + prefs::kSavingBrowserHistoryDisabled, + prefs::kEnableSpellCheck, + prefs::kEnableTranslate, + prefs::kAutoFillEnabled, + prefs::kAutoFillAuxiliaryProfilesEnabled, + prefs::kHomePage, + prefs::kHomePageIsNewTabPage, + prefs::kPromptForDownload, + prefs::kPasswordManagerEnabled, + prefs::kRestoreOnStartup, + prefs::kSafeBrowsingEnabled, + prefs::kSafeBrowsingReportingEnabled, + prefs::kSearchSuggestEnabled, + prefs::kShowHomeButton, + prefs::kSpellCheckDictionary, + prefs::kURLsToRestoreOnStartup, + prefs::kWebKitDefaultFixedFontSize, + prefs::kWebKitDefaultFontSize, + prefs::kWebKitFixedFontFamily, + prefs::kWebKitJavaEnabled, + prefs::kWebKitJavascriptEnabled, + prefs::kWebKitLoadsImagesAutomatically, + prefs::kWebKitPluginsEnabled, + prefs::kWebKitSansSerifFontFamily, + prefs::kWebKitSerifFontFamily, + prefs::kWebKitMinimumFontSize, + prefs::kWebKitMinimumLogicalFontSize, + prefs::kWebkitTabsToLinks, + }; + profile->GetDownloadManager()->download_prefs()->ResetToDefaults(); + profile->GetHostContentSettingsMap()->ResetToDefaults(); + profile->GetGeolocationContentSettingsMap()->ResetToDefault(); + profile->GetHostZoomMap()->ResetToDefaults(); + profile->GetDesktopNotificationService()->ResetToDefaultContentSetting(); + for (size_t i = 0; i < arraysize(kUserPrefs); ++i) + prefs->ClearPref(kUserPrefs[i]); + + PrefService* local_state = g_browser_process->local_state(); + // Note that we don't reset the kMetricsReportingEnabled preference here + // because the reset will reset it to the default setting specified in Chrome + // source, not the default setting selected by the user on the web page where + // they downloaded Chrome. This means that if the user ever resets their + // settings they'll either inadvertedly enable this logging or disable it. + // One is undesirable for them, one is undesirable for us. For now, we just + // don't reset it. + const char* kLocalStatePrefs[] = { + prefs::kApplicationLocale, + }; + for (size_t i = 0; i < arraysize(kLocalStatePrefs); ++i) + local_state->ClearPref(kLocalStatePrefs[i]); +} + +// static +bool OptionsUtil::ResolveMetricsReportingEnabled(bool enabled) { + // GoogleUpdateSettings touches the disk from the UI thread. MetricsService + // also calls GoogleUpdateSettings below. http://crbug/62626 + base::ThreadRestrictions::ScopedAllowIO allow_io; + + GoogleUpdateSettings::SetCollectStatsConsent(enabled); + bool update_pref = GoogleUpdateSettings::GetCollectStatsConsent(); + + if (enabled != update_pref) { + DVLOG(1) << "OptionsUtil: Unable to set crash report status to " << enabled; + } + + // Only change the pref if GoogleUpdateSettings::GetCollectStatsConsent + // succeeds. + enabled = update_pref; + + MetricsService* metrics = g_browser_process->metrics_service(); + DCHECK(metrics); + if (metrics) { + metrics->SetUserPermitsUpload(enabled); + if (enabled) + metrics->Start(); + else + metrics->Stop(); + } + + return enabled; +} diff --git a/chrome/browser/ui/options/options_util.h b/chrome/browser/ui/options/options_util.h new file mode 100644 index 0000000..5280051 --- /dev/null +++ b/chrome/browser/ui/options/options_util.h @@ -0,0 +1,26 @@ +// 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_OPTIONS_OPTIONS_UTIL_H_ +#define CHROME_BROWSER_UI_OPTIONS_OPTIONS_UTIL_H_ +#pragma once + +#include "base/basictypes.h" + +class Profile; + +class OptionsUtil { + public: + // Resets all prefs to their default values. + static void ResetToDefaults(Profile* profile); + + // Try to make the the crash stats consent and the metrics upload + // permission match |enabled|, returns the actual enabled setting. + static bool ResolveMetricsReportingEnabled(bool enabled); + + private: + DISALLOW_IMPLICIT_CONSTRUCTORS(OptionsUtil); +}; + +#endif // CHROME_BROWSER_UI_OPTIONS_OPTIONS_UTIL_H_ diff --git a/chrome/browser/ui/options/options_window.h b/chrome/browser/ui/options/options_window.h new file mode 100644 index 0000000..f088f1a --- /dev/null +++ b/chrome/browser/ui/options/options_window.h @@ -0,0 +1,40 @@ +// 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. + +#ifndef CHROME_BROWSER_UI_OPTIONS_OPTIONS_WINDOW_H_ +#define CHROME_BROWSER_UI_OPTIONS_OPTIONS_WINDOW_H_ +#pragma once + +class Profile; + +// An identifier for a Options Tab page. These are treated as indices into +// the list of available tabs to be displayed. PAGE_DEFAULT means select the +// last tab viewed when the Options window was opened, or PAGE_GENERAL if the +// Options was never opened. +enum OptionsPage { + OPTIONS_PAGE_DEFAULT = -1, +#if defined(OS_CHROMEOS) + OPTIONS_PAGE_SYSTEM, + OPTIONS_PAGE_INTERNET, +#endif + OPTIONS_PAGE_GENERAL, + OPTIONS_PAGE_CONTENT, + OPTIONS_PAGE_ADVANCED, + OPTIONS_PAGE_COUNT +}; + +// These are some well known groups within the Options dialog box that we may +// wish to highlight to attract the user's attention to. +enum OptionsGroup { + OPTIONS_GROUP_NONE, + OPTIONS_GROUP_DEFAULT_SEARCH +}; + +// Show the Options window selecting the specified page. If an Options window +// is currently open, this just activates it instead of opening a new one. +void ShowOptionsWindow(OptionsPage page, + OptionsGroup highlight_group, + Profile* profile); + +#endif // CHROME_BROWSER_UI_OPTIONS_OPTIONS_WINDOW_H_ diff --git a/chrome/browser/ui/options/show_options_url.cc b/chrome/browser/ui/options/show_options_url.cc new file mode 100644 index 0000000..46e2dac --- /dev/null +++ b/chrome/browser/ui/options/show_options_url.cc @@ -0,0 +1,21 @@ +// 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/options/show_options_url.h" + +#include "chrome/browser/profile.h" +#include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/browser_window.h" + +namespace browser { + +void ShowOptionsURL(Profile* profile, const GURL& url) { + // We open a new browser window so the Options dialog doesn't get lost behind + // other windows. + Browser* browser = Browser::Create(profile); + browser->AddSelectedTabWithURL(url, PageTransition::LINK); + browser->window()->Show(); +} + +} // namespace browser diff --git a/chrome/browser/ui/options/show_options_url.h b/chrome/browser/ui/options/show_options_url.h new file mode 100644 index 0000000..e849169 --- /dev/null +++ b/chrome/browser/ui/options/show_options_url.h @@ -0,0 +1,20 @@ +// 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. + +#ifndef CHROME_BROWSER_UI_OPTIONS_SHOW_OPTIONS_URL_H_ +#define CHROME_BROWSER_UI_OPTIONS_SHOW_OPTIONS_URL_H_ +#pragma once + +class GURL; +class Profile; + +namespace browser { + +// Opens a tab showing the specified url. This is intended for use any place +// we show a URL in the options dialogs. +void ShowOptionsURL(Profile* profile, const GURL& url); + +} // namespace browser + +#endif // CHROME_BROWSER_UI_OPTIONS_SHOW_OPTIONS_URL_H_ diff --git a/chrome/browser/ui/status_bubble.h b/chrome/browser/ui/status_bubble.h new file mode 100644 index 0000000..e7ddc15 --- /dev/null +++ b/chrome/browser/ui/status_bubble.h @@ -0,0 +1,58 @@ +// 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. + +#ifndef CHROME_BROWSER_STATUS_BUBBLE_H_ +#define CHROME_BROWSER_STATUS_BUBBLE_H_ +#pragma once + +#include "base/string16.h" + +class GURL; +namespace gfx { +class Point; +} + +//////////////////////////////////////////////////////////////////////////////// +// StatusBubble interface +// An interface implemented by an object providing the status display area of +// the browser window. +// +class StatusBubble { + public: + // On hover, expand status bubble to fit long URL after this delay. + static const int kExpandHoverDelay = 1600; + + virtual ~StatusBubble() {} + + // Sets the bubble contents to a specific string and causes the bubble + // to display immediately. Subsequent empty SetURL calls (typically called + // when the cursor exits a link) will set the status bubble back to its + // status text. To hide the status bubble again, either call SetStatus + // with an empty string, or call Hide(). + virtual void SetStatus(const string16& status) = 0; + + // Sets the bubble text to a URL - if given a non-empty URL, this will cause + // the bubble to fade in and remain open until given an empty URL or until + // the Hide() method is called. languages is the value of Accept-Language + // to determine what characters are understood by a user. + virtual void SetURL(const GURL& url, const string16& languages) = 0; + + // Skip the fade and instant-hide the bubble. + virtual void Hide() = 0; + + // Called when the user's mouse has moved over web content. This is used to + // determine when the status area should move out of the way of the user's + // mouse. This may be windows specific pain due to the way messages are + // processed for child HWNDs. |position| is the absolute position of the + // pointer, and |left_content| is true if the mouse just left the content + // area. + virtual void MouseMoved(const gfx::Point& position, bool left_content) = 0; + + // Called when the download shelf becomes visible or invisible. + // This is used by to ensure that the status bubble does not obscure + // the download shelf, when it is visible. + virtual void UpdateDownloadShelfVisibility(bool visible) = 0; +}; + +#endif // CHROME_BROWSER_STATUS_BUBBLE_H_ diff --git a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc new file mode 100644 index 0000000..0adec32 --- /dev/null +++ b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc @@ -0,0 +1,63 @@ +// 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/tab_contents/tab_contents_wrapper.h" + +#include "base/singleton.h" +#include "chrome/browser/password_manager/password_manager.h" +#include "chrome/browser/password_manager_delegate_impl.h" +#include "chrome/browser/tab_contents/tab_contents.h" + +//////////////////////////////////////////////////////////////////////////////// +// TabContentsWrapper, public: + +TabContentsWrapper::TabContentsWrapper(TabContents* contents) + : tab_contents_(contents) { + DCHECK(contents); + // Stash this in the property bag so it can be retrieved without having to + // go to a Browser. + property_accessor()->SetProperty(contents->property_bag(), this); + + // Needed so that we initialize the password manager on first navigation. + tab_contents()->AddNavigationObserver(this); +} + +TabContentsWrapper::~TabContentsWrapper() { + // Unregister observers (TabContents outlives supporting objects). + tab_contents()->RemoveNavigationObserver(password_manager_.get()); +} + +PropertyAccessor<TabContentsWrapper*>* TabContentsWrapper::property_accessor() { + return Singleton< PropertyAccessor<TabContentsWrapper*> >::get(); +} + +TabContentsWrapper* TabContentsWrapper::Clone() { + TabContents* new_contents = tab_contents()->Clone(); + TabContentsWrapper* new_wrapper = new TabContentsWrapper(new_contents); + // Instantiate the passowrd manager if it has been instantiated here. + if (password_manager_.get()) + new_wrapper->GetPasswordManager(); + return new_wrapper; +} + +PasswordManager* TabContentsWrapper::GetPasswordManager() { + if (!password_manager_.get()) { + // Create the delegate then create the manager. + password_manager_delegate_.reset( + new PasswordManagerDelegateImpl(tab_contents())); + password_manager_.reset( + new PasswordManager(password_manager_delegate_.get())); + // Register the manager to receive navigation notifications. + tab_contents()->AddNavigationObserver(password_manager_.get()); + } + return password_manager_.get(); +} + +//////////////////////////////////////////////////////////////////////////////// +// TabContentsWrapper, WebNavigationObserver implementation: + +void TabContentsWrapper::NavigateToPendingEntry() { + GetPasswordManager(); + tab_contents()->RemoveNavigationObserver(this); +} diff --git a/chrome/browser/ui/tab_contents/tab_contents_wrapper.h b/chrome/browser/ui/tab_contents/tab_contents_wrapper.h new file mode 100644 index 0000000..f47a6ad --- /dev/null +++ b/chrome/browser/ui/tab_contents/tab_contents_wrapper.h @@ -0,0 +1,79 @@ +// 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. + +#ifndef CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_H_ +#define CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_H_ +#pragma once + +#include "base/scoped_ptr.h" +#include "chrome/browser/tab_contents/tab_contents.h" +#include "chrome/browser/tab_contents/web_navigation_observer.h" + +class Extension; +class NavigationController; +class PasswordManager; +class PasswordManagerDelegate; +class TabContentsDelegate; + +// Wraps TabContents and all of its supporting objetcs in order to control +// their ownership and lifetime, while allowing TabContents to remain generic +// and re-usable in other projects. +// TODO(pinkerton): Eventually, this class will become TabContents as far as +// the browser front-end is concerned, and the current TabContents will be +// renamed to something like WebPage or WebView (ben's suggestions). +class TabContentsWrapper : public WebNavigationObserver { + public: + // Takes ownership of |contents|, which must be heap-allocated (as it lives + // in a scoped_ptr) and can not be NULL. + explicit TabContentsWrapper(TabContents* contents); + ~TabContentsWrapper(); + + // Used to retrieve this object from |tab_contents_|, which is placed in + // its property bag to avoid adding additional interfaces. + static PropertyAccessor<TabContentsWrapper*>* property_accessor(); + + // Create a TabContentsWrapper with the same state as this one. The returned + // heap-allocated pointer is owned by the caller. + TabContentsWrapper* Clone(); + + TabContents* tab_contents() const { return tab_contents_.get(); } + NavigationController& controller() const { + return tab_contents()->controller(); + } + TabContentsView* view() const { return tab_contents()->view(); } + RenderViewHost* render_view_host() const { + return tab_contents()->render_view_host(); + } + Profile* profile() const { return tab_contents()->profile(); } + TabContentsDelegate* delegate() const { return tab_contents()->delegate(); } + void set_delegate(TabContentsDelegate* d) { tab_contents()->set_delegate(d); } + + // Convenience methods until extensions are removed from TabContents. + void SetExtensionAppById(const std::string& extension_app_id) { + tab_contents()->SetExtensionAppById(extension_app_id); + } + const Extension* extension_app() const { + return tab_contents()->extension_app(); + } + bool is_app() const { return tab_contents()->is_app(); } + + // Returns the PasswordManager, creating it if necessary. + PasswordManager* GetPasswordManager(); + + // WebNavigationObserver overrides: + virtual void NavigateToPendingEntry(); + + private: + // PasswordManager and its delegate, lazily created. The delegate must + // outlive the manager, per documentation in password_manager.h. + scoped_ptr<PasswordManagerDelegate> password_manager_delegate_; + scoped_ptr<PasswordManager> password_manager_; + + // The supporting objects need to outlive the TabContents dtor (as they may + // be called upon during its execution). As a result, this must come last + // in the list. + scoped_ptr<TabContents> tab_contents_; +}; + +#endif // CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_H_ diff --git a/chrome/browser/ui/tabs/tab_menu_model.cc b/chrome/browser/ui/tabs/tab_menu_model.cc new file mode 100644 index 0000000..6d96adb --- /dev/null +++ b/chrome/browser/ui/tabs/tab_menu_model.cc @@ -0,0 +1,54 @@ +// 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/tabs/tab_menu_model.h" + +#include "base/command_line.h" +#include "chrome/browser/tabs/tab_strip_model.h" +#include "chrome/common/chrome_switches.h" +#include "chrome/common/pref_names.h" +#include "grit/generated_resources.h" + +TabMenuModel::TabMenuModel(menus::SimpleMenuModel::Delegate* delegate, + bool is_pinned) + : menus::SimpleMenuModel(delegate) { + Build(is_pinned); +} + +// static +bool TabMenuModel::AreVerticalTabsEnabled() { +#if defined(TOOLKIT_VIEWS) || defined(OS_MACOSX) || defined(OS_CHROMEOS) + return CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableVerticalTabs); +#else + return false; +#endif +} + +void TabMenuModel::Build(bool is_pinned) { + AddItemWithStringId(TabStripModel::CommandNewTab, IDS_TAB_CXMENU_NEWTAB); + AddSeparator(); + AddItemWithStringId(TabStripModel::CommandReload, IDS_TAB_CXMENU_RELOAD); + AddItemWithStringId(TabStripModel::CommandDuplicate, + IDS_TAB_CXMENU_DUPLICATE); + AddItemWithStringId( + TabStripModel::CommandTogglePinned, + is_pinned ? IDS_TAB_CXMENU_UNPIN_TAB : IDS_TAB_CXMENU_PIN_TAB); + AddSeparator(); + AddItemWithStringId(TabStripModel::CommandCloseTab, + IDS_TAB_CXMENU_CLOSETAB); + AddItemWithStringId(TabStripModel::CommandCloseOtherTabs, + IDS_TAB_CXMENU_CLOSEOTHERTABS); + AddItemWithStringId(TabStripModel::CommandCloseTabsToRight, + IDS_TAB_CXMENU_CLOSETABSTORIGHT); + AddSeparator(); + AddItemWithStringId(TabStripModel::CommandRestoreTab, IDS_RESTORE_TAB); + AddItemWithStringId(TabStripModel::CommandBookmarkAllTabs, + IDS_TAB_CXMENU_BOOKMARK_ALL_TABS); + if (AreVerticalTabsEnabled()) { + AddSeparator(); + AddCheckItemWithStringId(TabStripModel::CommandUseVerticalTabs, + IDS_TAB_CXMENU_USE_VERTICAL_TABS); + } +} diff --git a/chrome/browser/ui/tabs/tab_menu_model.h b/chrome/browser/ui/tabs/tab_menu_model.h new file mode 100644 index 0000000..aeff953 --- /dev/null +++ b/chrome/browser/ui/tabs/tab_menu_model.h @@ -0,0 +1,29 @@ +// 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. + +#ifndef CHROME_BROWSER_UI_TABS_TAB_MENU_MODEL_H_ +#define CHROME_BROWSER_UI_TABS_TAB_MENU_MODEL_H_ +#pragma once + +#include "app/menus/simple_menu_model.h" + +// A menu model that builds the contents of the tab context menu. This menu has +// only one level (no submenus). TabMenuModel caches local state from the +// tab (such as the pinned state). To make sure the menu reflects the real state +// of the tab a new TabMenuModel should be created each time the menu is shown. +class TabMenuModel : public menus::SimpleMenuModel { + public: + TabMenuModel(menus::SimpleMenuModel::Delegate* delegate, bool is_pinned); + virtual ~TabMenuModel() {} + + // Returns true if vertical tabs are enabled. + static bool AreVerticalTabsEnabled(); + + private: + void Build(bool is_pinned); + + DISALLOW_COPY_AND_ASSIGN(TabMenuModel); +}; + +#endif // CHROME_BROWSER_UI_TABS_TAB_MENU_MODEL_H_ diff --git a/chrome/browser/ui/tabs/tab_menu_model_unittest.cc b/chrome/browser/ui/tabs/tab_menu_model_unittest.cc new file mode 100644 index 0000000..9f30412 --- /dev/null +++ b/chrome/browser/ui/tabs/tab_menu_model_unittest.cc @@ -0,0 +1,26 @@ +// 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/tabs/tab_menu_model.h" + +#include "chrome/test/menu_model_test.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "testing/platform_test.h" + +class TabMenuModelTest : public PlatformTest, public MenuModelTest { +}; + +TEST_F(TabMenuModelTest, Basics) { + TabMenuModel model(&delegate_, true); + + // Verify it has items. The number varies by platform, so we don't check + // the exact number. + EXPECT_GT(model.GetItemCount(), 5); + + int item_count = 0; + CountEnabledExecutable(&model, &item_count); + EXPECT_GT(item_count, 0); + EXPECT_EQ(item_count, delegate_.execute_count_); + EXPECT_EQ(item_count, delegate_.enable_count_); +} diff --git a/chrome/browser/ui/tests/browser_uitest.cc b/chrome/browser/ui/tests/browser_uitest.cc new file mode 100644 index 0000000..6b8c735 --- /dev/null +++ b/chrome/browser/ui/tests/browser_uitest.cc @@ -0,0 +1,385 @@ +// 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 "base/base_paths.h" +#include "base/file_path.h" +#include "base/file_util.h" +#include "base/path_service.h" +#include "base/string_util.h" +#include "base/sys_info.h" +#include "base/test/test_file_util.h" +#include "base/values.h" +#include "chrome/app/chrome_command_ids.h" +#include "chrome/browser/platform_util.h" +#include "chrome/browser/ui/browser.h" +#include "chrome/common/chrome_switches.h" +#include "chrome/common/chrome_constants.h" +#include "chrome/common/pref_names.h" +#include "chrome/test/automation/browser_proxy.h" +#include "chrome/test/automation/tab_proxy.h" +#include "chrome/test/automation/window_proxy.h" +#include "chrome/test/ui/ui_test.h" +#include "gfx/native_widget_types.h" +#include "grit/chromium_strings.h" +#include "grit/generated_resources.h" +#include "net/base/net_util.h" +#include "net/test/test_server.h" + +namespace { + +class BrowserTest : public UITest { +}; + +class VisibleBrowserTest : public UITest { + protected: + VisibleBrowserTest() : UITest() { + show_window_ = true; + } +}; + +#if defined(OS_WIN) +// The browser should quit quickly if it receives a WM_ENDSESSION message. +TEST_F(BrowserTest, WindowsSessionEnd) { +#elif defined(OS_POSIX) +// The browser should quit gracefully and quickly if it receives a SIGTERM. +TEST_F(BrowserTest, PosixSessionEnd) { +#endif + FilePath test_file(test_data_directory_); + test_file = test_file.AppendASCII("title1.html"); + + NavigateToURL(net::FilePathToFileURL(test_file)); + TerminateBrowser(); + ASSERT_FALSE(IsBrowserRunning()); + + // Make sure the UMA metrics say we didn't crash. + scoped_ptr<DictionaryValue> local_prefs(GetLocalState()); + bool exited_cleanly; + ASSERT_TRUE(local_prefs.get()); + ASSERT_TRUE(local_prefs->GetBoolean(prefs::kStabilityExitedCleanly, + &exited_cleanly)); + ASSERT_TRUE(exited_cleanly); + + // And that session end was successful. + bool session_end_completed; + ASSERT_TRUE(local_prefs->GetBoolean(prefs::kStabilitySessionEndCompleted, + &session_end_completed)); + ASSERT_TRUE(session_end_completed); + + // Make sure session restore says we didn't crash. + scoped_ptr<DictionaryValue> profile_prefs(GetDefaultProfilePreferences()); + ASSERT_TRUE(profile_prefs.get()); + ASSERT_TRUE(profile_prefs->GetBoolean(prefs::kSessionExitedCleanly, + &exited_cleanly)); + ASSERT_TRUE(exited_cleanly); +} + +// Test that scripts can fork a new renderer process for a tab in a particular +// case (which matches following a link in Gmail). The script must open a new +// tab, set its window.opener to null, and redirect it to a cross-site URL. +// (Bug 1115708) +// This test can only run if V8 is in use, and not KJS, because KJS will not +// set window.opener to null properly. +#ifdef CHROME_V8 +TEST_F(BrowserTest, NullOpenerRedirectForksProcess) { + // This test only works in multi-process mode + if (in_process_renderer()) + return; + + net::TestServer test_server(net::TestServer::TYPE_HTTP, + FilePath(FILE_PATH_LITERAL("chrome/test/data"))); + ASSERT_TRUE(test_server.Start()); + + FilePath test_file(test_data_directory_); + scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0)); + ASSERT_TRUE(window.get()); + scoped_refptr<TabProxy> tab(window->GetActiveTab()); + ASSERT_TRUE(tab.get()); + + // Start with a file:// url + test_file = test_file.AppendASCII("title2.html"); + tab->NavigateToURL(net::FilePathToFileURL(test_file)); + int orig_tab_count = -1; + ASSERT_TRUE(window->GetTabCount(&orig_tab_count)); + int orig_process_count = GetBrowserProcessCount(); + ASSERT_GE(orig_process_count, 1); + + // Use JavaScript URL to "fork" a new tab, just like Gmail. (Open tab to a + // blank page, set its opener to null, and redirect it cross-site.) + std::wstring url_prefix(L"javascript:(function(){w=window.open();"); + GURL fork_url(url_prefix + + L"w.opener=null;w.document.location=\"http://localhost:1337\";})()"); + + // Make sure that a new tab has been created and that we have a new renderer + // process for it. + ASSERT_TRUE(tab->NavigateToURLAsync(fork_url)); + PlatformThread::Sleep(sleep_timeout_ms()); + ASSERT_EQ(orig_process_count + 1, GetBrowserProcessCount()); + int new_tab_count = -1; + ASSERT_TRUE(window->GetTabCount(&new_tab_count)); + ASSERT_EQ(orig_tab_count + 1, new_tab_count); +} +#endif // CHROME_V8 + +// This test fails on ChromeOS (it has never been known to work on it). +// Currently flaky on Windows - it has crashed a couple of times. +// http://crbug.com/32799 +#if defined(OS_CHROMEOS) +#define MAYBE_OtherRedirectsDontForkProcess DISABLED_OtherRedirectsDontForkProcess +#else +#define MAYBE_OtherRedirectsDontForkProcess FLAKY_OtherRedirectsDontForkProcess +#endif + +// Tests that non-Gmail-like script redirects (i.e., non-null window.opener) or +// a same-page-redirect) will not fork a new process. +TEST_F(BrowserTest, MAYBE_OtherRedirectsDontForkProcess) { + // This test only works in multi-process mode + if (in_process_renderer()) + return; + + net::TestServer test_server(net::TestServer::TYPE_HTTP, + FilePath(FILE_PATH_LITERAL("chrome/test/data"))); + ASSERT_TRUE(test_server.Start()); + + FilePath test_file(test_data_directory_); + scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0)); + ASSERT_TRUE(window.get()); + scoped_refptr<TabProxy> tab(window->GetActiveTab()); + ASSERT_TRUE(tab.get()); + + // Start with a file:// url + test_file = test_file.AppendASCII("title2.html"); + ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, + tab->NavigateToURL(net::FilePathToFileURL(test_file))); + int orig_tab_count = -1; + ASSERT_TRUE(window->GetTabCount(&orig_tab_count)); + int orig_process_count = GetBrowserProcessCount(); + ASSERT_GE(orig_process_count, 1); + + // Use JavaScript URL to almost fork a new tab, but not quite. (Leave the + // opener non-null.) Should not fork a process. + std::string url_str = "javascript:(function(){w=window.open(); "; + url_str += "w.document.location=\""; + url_str += test_server.GetURL("").spec(); + url_str += "\";})()"; + GURL dont_fork_url(url_str); + + // Make sure that a new tab but not new process has been created. + ASSERT_TRUE(tab->NavigateToURLAsync(dont_fork_url)); + PlatformThread::Sleep(sleep_timeout_ms()); + ASSERT_EQ(orig_process_count, GetBrowserProcessCount()); + int new_tab_count = -1; + ASSERT_TRUE(window->GetTabCount(&new_tab_count)); + ASSERT_EQ(orig_tab_count + 1, new_tab_count); + + // Same thing if the current tab tries to redirect itself. + url_str = "javascript:(function(){w=window.open(); "; + url_str += "document.location=\""; + url_str += test_server.GetURL("").spec(); + url_str += "\";})()"; + GURL dont_fork_url2(url_str); + + // Make sure that no new process has been created. + ASSERT_TRUE(tab->NavigateToURLAsync(dont_fork_url2)); + PlatformThread::Sleep(sleep_timeout_ms()); + ASSERT_EQ(orig_process_count, GetBrowserProcessCount()); +} + +TEST_F(VisibleBrowserTest, WindowOpenClose) { + FilePath test_file(test_data_directory_); + test_file = test_file.AppendASCII("window.close.html"); + + NavigateToURLBlockUntilNavigationsComplete( + net::FilePathToFileURL(test_file), 2); + EXPECT_EQ(L"Title Of Awesomeness", GetActiveTabTitle()); +} + +class ShowModalDialogTest : public UITest { + public: + ShowModalDialogTest() { + launch_arguments_.AppendSwitch(switches::kDisablePopupBlocking); + } +}; + +// Flakiness returned. Re-opened crbug.com/17806 +TEST_F(ShowModalDialogTest, FLAKY_BasicTest) { + FilePath test_file(test_data_directory_); + test_file = test_file.AppendASCII("showmodaldialog.html"); + + // This navigation should show a modal dialog that will be immediately + // closed, but the fact that it was shown should be recorded. + NavigateToURL(net::FilePathToFileURL(test_file)); + + // At this point the modal dialog should not be showing. + int window_count = 0; + EXPECT_TRUE(automation()->GetBrowserWindowCount(&window_count)); + EXPECT_EQ(1, window_count); + + // Verify that we set a mark on successful dialog show. + scoped_refptr<BrowserProxy> browser = automation()->GetBrowserWindow(0); + ASSERT_TRUE(browser.get()); + scoped_refptr<TabProxy> tab = browser->GetActiveTab(); + ASSERT_TRUE(tab.get()); + std::wstring title; + ASSERT_TRUE(tab->GetTabTitle(&title)); + ASSERT_EQ(L"SUCCESS", title); +} + +class SecurityTest : public UITest { +}; + +TEST_F(SecurityTest, DisallowFileUrlUniversalAccessTest) { + scoped_refptr<TabProxy> tab(GetActiveTab()); + ASSERT_TRUE(tab.get()); + + FilePath test_file(test_data_directory_); + test_file = test_file.AppendASCII("fileurl_universalaccess.html"); + + GURL url = net::FilePathToFileURL(test_file); + ASSERT_TRUE(tab->NavigateToURL(url)); + + std::string value = WaitUntilCookieNonEmpty(tab.get(), url, + "status", action_max_timeout_ms()); + ASSERT_STREQ("Disallowed", value.c_str()); +} + +#if !defined(OS_MACOSX) +class KioskModeTest : public UITest { + public: + KioskModeTest() { + launch_arguments_.AppendSwitch(switches::kKioskMode); + } +}; + +TEST_F(KioskModeTest, EnableKioskModeTest) { + // Load a local file. + FilePath test_file(test_data_directory_); + test_file = test_file.AppendASCII("title1.html"); + + // Verify that the window is present. + scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); + ASSERT_TRUE(browser.get()); + + // Check if browser is in fullscreen mode. + bool is_visible; + ASSERT_TRUE(browser->IsFullscreen(&is_visible)); + EXPECT_TRUE(is_visible); + ASSERT_TRUE(browser->IsFullscreenBubbleVisible(&is_visible)); + EXPECT_FALSE(is_visible); +} +#endif // !defined(OS_MACOSX) + +#if defined(OS_WIN) +// This test verifies that Chrome can be launched with a user-data-dir path +// which contains non ASCII characters. +class LaunchBrowserWithNonAsciiUserDatadir : public UITest { +public: + void SetUp() { + PathService::Get(base::DIR_TEMP, &tmp_profile_); + tmp_profile_ = tmp_profile_.AppendASCII("tmp_profile"); + tmp_profile_ = tmp_profile_.Append(L"Test Chrome G�raldine"); + + // Create a fresh, empty copy of this directory. + file_util::Delete(tmp_profile_, true); + file_util::CreateDirectory(tmp_profile_); + + launch_arguments_.AppendSwitchPath(switches::kUserDataDir, tmp_profile_); + } + + bool LaunchAppWithProfile() { + UITest::SetUp(); + return true; + } + + void TearDown() { + UITest::TearDown(); + EXPECT_TRUE(file_util::DieFileDie(tmp_profile_, true)); + } + +public: + FilePath tmp_profile_; +}; + +TEST_F(LaunchBrowserWithNonAsciiUserDatadir, TestNonAsciiUserDataDir) { + ASSERT_TRUE(LaunchAppWithProfile()); + // Verify that the window is present. + scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); + ASSERT_TRUE(browser.get()); +} +#endif // defined(OS_WIN) + +class AppModeTest : public UITest { + public: + AppModeTest() { + // Load a local file. + FilePath test_file(test_data_directory_); + test_file = test_file.AppendASCII("title1.html"); + GURL test_file_url(net::FilePathToFileURL(test_file)); + + launch_arguments_.AppendSwitchASCII(switches::kApp, test_file_url.spec()); + } +}; + +TEST_F(AppModeTest, EnableAppModeTest) { + // Test that an application browser window loads correctly. + + // Verify that the window is present. + scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); + ASSERT_TRUE(browser.get()); + + // Verify the browser is an application. + Browser::Type type; + ASSERT_TRUE(browser->GetType(&type)); + EXPECT_EQ(Browser::TYPE_APP, type); +} + +// Tests to ensure that the browser continues running in the background after +// the last window closes. +class RunInBackgroundTest : public UITest { + public: + RunInBackgroundTest() { + launch_arguments_.AppendSwitch(switches::kKeepAliveForTest); + } +}; + +TEST_F(RunInBackgroundTest, RunInBackgroundBasicTest) { + // Close the browser window, then open a new one - the browser should keep + // running. + scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); + ASSERT_TRUE(browser.get()); + int window_count; + ASSERT_TRUE(automation()->GetBrowserWindowCount(&window_count)); + EXPECT_EQ(1, window_count); + ASSERT_TRUE(browser->RunCommand(IDC_CLOSE_WINDOW)); + ASSERT_TRUE(automation()->GetBrowserWindowCount(&window_count)); + EXPECT_EQ(0, window_count); + ASSERT_TRUE(IsBrowserRunning()); + ASSERT_TRUE(automation()->OpenNewBrowserWindow(Browser::TYPE_NORMAL, true)); + ASSERT_TRUE(automation()->GetBrowserWindowCount(&window_count)); + EXPECT_EQ(1, window_count); +} + +// Tests to ensure that the browser continues running in the background after +// the last window closes. +class NoStartupWindowTest : public UITest { + public: + NoStartupWindowTest() { + launch_arguments_.AppendSwitch(switches::kNoStartupWindow); + launch_arguments_.AppendSwitch(switches::kKeepAliveForTest); + } +}; + +TEST_F(NoStartupWindowTest, NoStartupWindowBasicTest) { + // No browser window should be started by default. + int window_count; + ASSERT_TRUE(automation()->GetBrowserWindowCount(&window_count)); + EXPECT_EQ(0, window_count); + + // Starting a browser window should work just fine. + ASSERT_TRUE(IsBrowserRunning()); + ASSERT_TRUE(automation()->OpenNewBrowserWindow(Browser::TYPE_NORMAL, true)); + ASSERT_TRUE(automation()->GetBrowserWindowCount(&window_count)); + EXPECT_EQ(1, window_count); +} + +} // namespace diff --git a/chrome/browser/ui/view_ids.h b/chrome/browser/ui/view_ids.h new file mode 100644 index 0000000..948eabb --- /dev/null +++ b/chrome/browser/ui/view_ids.h @@ -0,0 +1,86 @@ +// 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. + +// This defines an enumeration of IDs that can uniquely identify a view within +// the scope of a container view. + +#ifndef CHROME_BROWSER_VIEW_IDS_H_ +#define CHROME_BROWSER_VIEW_IDS_H_ +#pragma once + +enum ViewID { + VIEW_ID_NONE = 0, + + // BROWSER WINDOW VIEWS + // ------------------------------------------------------ + + // Tabs within a window/tab strip, counting from the left. + VIEW_ID_TAB_0, + VIEW_ID_TAB_1, + VIEW_ID_TAB_2, + VIEW_ID_TAB_3, + VIEW_ID_TAB_4, + VIEW_ID_TAB_5, + VIEW_ID_TAB_6, + VIEW_ID_TAB_7, + VIEW_ID_TAB_8, + VIEW_ID_TAB_9, + VIEW_ID_TAB_LAST, + + // ID for any tab. Currently only used on views. + VIEW_ID_TAB, + + VIEW_ID_TAB_STRIP, + + // Toolbar & toolbar elements. + VIEW_ID_TOOLBAR = 1000, + VIEW_ID_BACK_BUTTON, + VIEW_ID_FORWARD_BUTTON, + VIEW_ID_RELOAD_BUTTON, + VIEW_ID_HOME_BUTTON, + VIEW_ID_STAR_BUTTON, + VIEW_ID_LOCATION_BAR, + VIEW_ID_APP_MENU, + VIEW_ID_AUTOCOMPLETE, + VIEW_ID_BROWSER_ACTION_TOOLBAR, + VIEW_ID_FEEDBACK_BUTTON, + + // The Bookmark Bar. + VIEW_ID_BOOKMARK_BAR, + VIEW_ID_OTHER_BOOKMARKS, + // Used for bookmarks/folders on the bookmark bar. + VIEW_ID_BOOKMARK_BAR_ELEMENT, + + // Find in page. + VIEW_ID_FIND_IN_PAGE_TEXT_FIELD, + VIEW_ID_FIND_IN_PAGE, + + // Tab Container window. + VIEW_ID_TAB_CONTAINER, + VIEW_ID_TAB_CONTAINER_FOCUS_VIEW, + + // Docked dev tools. + VIEW_ID_DEV_TOOLS_DOCKED, + + // The contents split. + VIEW_ID_CONTENTS_SPLIT, + + // The Infobar container. + VIEW_ID_INFO_BAR_CONTAINER, + + // The Download shelf. + VIEW_ID_DOWNLOAD_SHELF, + + // The Sidebar container. + VIEW_ID_SIDE_BAR_CONTAINER, + + // The sidebar split. + VIEW_ID_SIDE_BAR_SPLIT, + + // Used in chrome/browser/gtk/view_id_util_browsertests.cc + // If you add new ids, make sure the above test passes. + VIEW_ID_PREDEFINED_COUNT +}; + +#endif // CHROME_BROWSER_VIEW_IDS_H_ diff --git a/chrome/browser/ui/views/accessible_pane_view.cc b/chrome/browser/ui/views/accessible_pane_view.cc index b876940..fa8a478 100644 --- a/chrome/browser/ui/views/accessible_pane_view.cc +++ b/chrome/browser/ui/views/accessible_pane_view.cc @@ -3,10 +3,10 @@ // found in the LICENSE file. #include "base/logging.h" -#include "chrome/browser/view_ids.h" -#include "chrome/browser/views/frame/browser_view.h" -#include "chrome/browser/views/location_bar/location_bar_view.h" -#include "chrome/browser/views/accessible_pane_view.h" +#include "chrome/browser/ui/view_ids.h" +#include "chrome/browser/ui/views/frame/browser_view.h" +#include "chrome/browser/ui/views/location_bar/location_bar_view.h" +#include "chrome/browser/ui/views/accessible_pane_view.h" #include "views/controls/button/menu_button.h" #include "views/controls/native/native_view_host.h" #include "views/focus/focus_search.h" diff --git a/chrome/browser/ui/views/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmark_bar_view.cc index be90191..8a07f1d 100644 --- a/chrome/browser/ui/views/bookmark_bar_view.cc +++ b/chrome/browser/ui/views/bookmark_bar_view.cc @@ -32,11 +32,11 @@ #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/themes/browser_theme_provider.h" #include "chrome/browser/ui/browser.h" -#include "chrome/browser/view_ids.h" -#include "chrome/browser/views/bookmark_context_menu.h" -#include "chrome/browser/views/event_utils.h" -#include "chrome/browser/views/frame/browser_view.h" -#include "chrome/browser/views/location_bar/location_bar_view.h" +#include "chrome/browser/ui/view_ids.h" +#include "chrome/browser/ui/views/bookmark_context_menu.h" +#include "chrome/browser/ui/views/event_utils.h" +#include "chrome/browser/ui/views/frame/browser_view.h" +#include "chrome/browser/ui/views/location_bar/location_bar_view.h" #include "chrome/common/notification_service.h" #include "chrome/common/page_transition_types.h" #include "chrome/common/pref_names.h" diff --git a/chrome/browser/ui/views/browser_actions_container.cc b/chrome/browser/ui/views/browser_actions_container.cc index ce7bb4b..268dd13 100644 --- a/chrome/browser/ui/views/browser_actions_container.cc +++ b/chrome/browser/ui/views/browser_actions_container.cc @@ -21,11 +21,11 @@ #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/themes/browser_theme_provider.h" #include "chrome/browser/ui/browser.h" -#include "chrome/browser/view_ids.h" -#include "chrome/browser/views/detachable_toolbar_view.h" -#include "chrome/browser/views/extensions/browser_action_drag_data.h" -#include "chrome/browser/views/extensions/extension_popup.h" -#include "chrome/browser/views/toolbar_view.h" +#include "chrome/browser/ui/view_ids.h" +#include "chrome/browser/ui/views/detachable_toolbar_view.h" +#include "chrome/browser/ui/views/extensions/browser_action_drag_data.h" +#include "chrome/browser/ui/views/extensions/extension_popup.h" +#include "chrome/browser/ui/views/toolbar_view.h" #include "chrome/common/extensions/extension_action.h" #include "chrome/common/extensions/extension_resource.h" #include "chrome/common/notification_source.h" diff --git a/chrome/browser/ui/views/dialog_stubs_gtk.cc b/chrome/browser/ui/views/dialog_stubs_gtk.cc index a8e4535..de6c676 100644 --- a/chrome/browser/ui/views/dialog_stubs_gtk.cc +++ b/chrome/browser/ui/views/dialog_stubs_gtk.cc @@ -18,9 +18,9 @@ #include "chrome/browser/gtk/options/passwords_exceptions_window_gtk.h" #include "chrome/browser/gtk/repost_form_warning_gtk.h" #include "chrome/browser/gtk/task_manager_gtk.h" -#include "chrome/browser/options_window.h" #include "chrome/browser/tab_contents/tab_contents.h" -#include "chrome/browser/views/browser_dialogs.h" +#include "chrome/browser/ui/options/options_window.h" +#include "chrome/browser/ui/views/browser_dialogs.h" #include "views/widget/widget.h" namespace browser { diff --git a/chrome/browser/ui/views/download_shelf_view.cc b/chrome/browser/ui/views/download_shelf_view.cc index 7ad21cc..5db8ba1 100644 --- a/chrome/browser/ui/views/download_shelf_view.cc +++ b/chrome/browser/ui/views/download_shelf_view.cc @@ -16,9 +16,9 @@ #include "chrome/browser/tab_contents/navigation_entry.h" #include "chrome/browser/themes/browser_theme_provider.h" #include "chrome/browser/ui/browser.h" -#include "chrome/browser/view_ids.h" -#include "chrome/browser/views/download_item_view.h" -#include "chrome/browser/views/frame/browser_view.h" +#include "chrome/browser/ui/view_ids.h" +#include "chrome/browser/ui/views/download_item_view.h" +#include "chrome/browser/ui/views/frame/browser_view.h" #include "gfx/canvas.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" diff --git a/chrome/browser/ui/views/dropdown_bar_host.cc b/chrome/browser/ui/views/dropdown_bar_host.cc index 6b6162a..66fb702 100644 --- a/chrome/browser/ui/views/dropdown_bar_host.cc +++ b/chrome/browser/ui/views/dropdown_bar_host.cc @@ -8,12 +8,12 @@ #include "app/slide_animation.h" #include "base/scoped_handle.h" #include "chrome/browser/browser_process.h" -#include "chrome/browser/view_ids.h" -#include "chrome/browser/views/dropdown_bar_view.h" -#include "chrome/browser/views/frame/browser_view.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/tab_contents/tab_contents_view.h" #include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/view_ids.h" +#include "chrome/browser/ui/views/dropdown_bar_view.h" +#include "chrome/browser/ui/views/frame/browser_view.h" #include "gfx/path.h" #include "gfx/scrollbar_size.h" #include "views/focus/external_focus_tracker.h" diff --git a/chrome/browser/ui/views/find_bar_host.cc b/chrome/browser/ui/views/find_bar_host.cc index 44cb187..e185b52 100644 --- a/chrome/browser/ui/views/find_bar_host.cc +++ b/chrome/browser/ui/views/find_bar_host.cc @@ -7,13 +7,13 @@ #include "app/keyboard_codes.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/renderer_host/render_view_host.h" -#include "chrome/browser/ui/browser.h" -#include "chrome/browser/ui/find_bar/find_bar_controller.h" -#include "chrome/browser/view_ids.h" -#include "chrome/browser/views/find_bar_view.h" -#include "chrome/browser/views/frame/browser_view.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/tab_contents/tab_contents_view.h" +#include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/find_bar/find_bar_controller.h" +#include "chrome/browser/ui/view_ids.h" +#include "chrome/browser/ui/views/find_bar_view.h" +#include "chrome/browser/ui/views/frame/browser_view.h" #include "views/focus/external_focus_tracker.h" #include "views/focus/view_storage.h" #include "views/widget/root_view.h" diff --git a/chrome/browser/ui/views/find_bar_host_interactive_uitest.cc b/chrome/browser/ui/views/find_bar_host_interactive_uitest.cc index 361faa0..92b5fbf 100644 --- a/chrome/browser/ui/views/find_bar_host_interactive_uitest.cc +++ b/chrome/browser/ui/views/find_bar_host_interactive_uitest.cc @@ -11,9 +11,9 @@ #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/find_bar/find_bar_controller.h" -#include "chrome/browser/views/find_bar_host.h" -#include "chrome/browser/views/frame/browser_view.h" -#include "chrome/browser/view_ids.h" +#include "chrome/browser/ui/view_ids.h" +#include "chrome/browser/ui/views/find_bar_host.h" +#include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" #include "net/test/test_server.h" diff --git a/chrome/browser/ui/views/find_bar_view.cc b/chrome/browser/ui/views/find_bar_view.cc index 12dbd4c..261ea1d 100644 --- a/chrome/browser/ui/views/find_bar_view.cc +++ b/chrome/browser/ui/views/find_bar_view.cc @@ -16,9 +16,9 @@ #include "chrome/browser/themes/browser_theme_provider.h" #include "chrome/browser/ui/find_bar/find_bar_controller.h" #include "chrome/browser/ui/find_bar/find_bar_state.h" -#include "chrome/browser/view_ids.h" -#include "chrome/browser/views/find_bar_host.h" -#include "chrome/browser/views/frame/browser_view.h" +#include "chrome/browser/ui/view_ids.h" +#include "chrome/browser/ui/views/find_bar_host.h" +#include "chrome/browser/ui/views/frame/browser_view.h" #include "gfx/canvas.h" #include "grit/generated_resources.h" #include "grit/theme_resources.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 6688d9e..be9acb1 100644 --- a/chrome/browser/ui/views/first_run_search_engine_view.cc +++ b/chrome/browser/ui/views/first_run_search_engine_view.cc @@ -13,11 +13,11 @@ #include "base/i18n/rtl.h" #include "base/rand_util.h" #include "base/time.h" -#include "chrome/browser/options_window.h" #include "chrome/browser/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" +#include "chrome/browser/ui/options/options_window.h" #include "gfx/canvas.h" #include "gfx/font.h" #include "grit/browser_resources.h" diff --git a/chrome/browser/ui/views/frame/browser_frame_gtk.cc b/chrome/browser/ui/views/frame/browser_frame_gtk.cc index a2badbd..ad20334 100644 --- a/chrome/browser/ui/views/frame/browser_frame_gtk.cc +++ b/chrome/browser/ui/views/frame/browser_frame_gtk.cc @@ -6,13 +6,13 @@ #include "base/logging.h" #include "chrome/browser/profile.h" -#include "chrome/browser/status_bubble.h" #include "chrome/browser/themes/browser_theme_provider.h" -#include "chrome/browser/views/frame/app_panel_browser_frame_view.h" -#include "chrome/browser/views/frame/browser_root_view.h" -#include "chrome/browser/views/frame/browser_view.h" -#include "chrome/browser/views/frame/opaque_browser_frame_view.h" -#include "chrome/browser/views/frame/popup_non_client_frame_view.h" +#include "chrome/browser/ui/status_bubble.h" +#include "chrome/browser/ui/views/frame/app_panel_browser_frame_view.h" +#include "chrome/browser/ui/views/frame/browser_root_view.h" +#include "chrome/browser/ui/views/frame/browser_view.h" +#include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" +#include "chrome/browser/ui/views/frame/popup_non_client_frame_view.h" #include "gfx/font.h" #include "views/widget/root_view.h" #include "views/window/hit_test.h" diff --git a/chrome/browser/ui/views/frame/browser_root_view.cc b/chrome/browser/ui/views/frame/browser_root_view.cc index e99cccb..7264a7f 100644 --- a/chrome/browser/ui/views/frame/browser_root_view.cc +++ b/chrome/browser/ui/views/frame/browser_root_view.cc @@ -10,11 +10,11 @@ #include "chrome/browser/autocomplete/autocomplete.h" #include "chrome/browser/autocomplete/autocomplete_classifier.h" #include "chrome/browser/autocomplete/autocomplete_match.h" -#include "chrome/browser/location_bar.h" #include "chrome/browser/profile.h" -#include "chrome/browser/views/frame/browser_view.h" -#include "chrome/browser/views/frame/browser_frame.h" -#include "chrome/browser/views/tabs/tab_strip.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" +#include "chrome/browser/ui/views/tabs/tab_strip.h" #include "grit/chromium_strings.h" BrowserRootView::BrowserRootView(BrowserView* browser_view, diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index 64ef258..9985a83 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc @@ -35,13 +35,14 @@ #include "chrome/browser/sidebar/sidebar_manager.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/tab_contents/tab_contents_view.h" -#include "chrome/browser/tab_contents_wrapper.h" #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/browser/themes/browser_theme_provider.h" #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" +#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/browser/ui/toolbar/wrench_menu_model.h" +#include "chrome/browser/ui/view_ids.h" #include "chrome/browser/ui/views/accessible_view_helper.h" #include "chrome/browser/ui/views/bookmark_bar_view.h" #include "chrome/browser/ui/views/browser_dialogs.h" @@ -59,7 +60,6 @@ #include "chrome/browser/ui/views/update_recommended_message_box.h" #include "chrome/browser/ui/views/window.h" #include "chrome/browser/ui/window_sizer.h" -#include "chrome/browser/view_ids.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/extension_resource.h" #include "chrome/common/native_window_notification_source.h" diff --git a/chrome/browser/ui/views/frame/browser_view_layout.cc b/chrome/browser/ui/views/frame/browser_view_layout.cc index 6fa2b67..914f202 100644 --- a/chrome/browser/ui/views/frame/browser_view_layout.cc +++ b/chrome/browser/ui/views/frame/browser_view_layout.cc @@ -7,15 +7,15 @@ #include "chrome/browser/sidebar/sidebar_manager.h" #include "chrome/browser/ui/find_bar/find_bar.h" #include "chrome/browser/ui/find_bar/find_bar_controller.h" -#include "chrome/browser/view_ids.h" -#include "chrome/browser/views/bookmark_bar_view.h" -#include "chrome/browser/views/download_shelf_view.h" -#include "chrome/browser/views/frame/browser_frame.h" -#include "chrome/browser/views/frame/browser_view.h" -#include "chrome/browser/views/frame/contents_container.h" -#include "chrome/browser/views/tabs/side_tab_strip.h" -#include "chrome/browser/views/tabs/tab_strip.h" -#include "chrome/browser/views/toolbar_view.h" +#include "chrome/browser/ui/view_ids.h" +#include "chrome/browser/ui/views/bookmark_bar_view.h" +#include "chrome/browser/ui/views/download_shelf_view.h" +#include "chrome/browser/ui/views/frame/browser_frame.h" +#include "chrome/browser/ui/views/frame/browser_view.h" +#include "chrome/browser/ui/views/frame/contents_container.h" +#include "chrome/browser/ui/views/tabs/side_tab_strip.h" +#include "chrome/browser/ui/views/tabs/tab_strip.h" +#include "chrome/browser/ui/views/toolbar_view.h" #include "gfx/scrollbar_size.h" #include "views/window/window.h" diff --git a/chrome/browser/ui/views/infobars/infobar_container.cc b/chrome/browser/ui/views/infobars/infobar_container.cc index 5779fde..5096629 100644 --- a/chrome/browser/ui/views/infobars/infobar_container.cc +++ b/chrome/browser/ui/views/infobars/infobar_container.cc @@ -7,8 +7,8 @@ #include "app/l10n_util.h" #include "chrome/browser/tab_contents/infobar_delegate.h" #include "chrome/browser/tab_contents/tab_contents.h" -#include "chrome/browser/view_ids.h" -#include "chrome/browser/views/infobars/infobars.h" +#include "chrome/browser/ui/view_ids.h" +#include "chrome/browser/ui/views/infobars/infobars.h" #include "chrome/common/notification_service.h" #include "grit/generated_resources.h" diff --git a/chrome/browser/ui/views/location_bar/click_handler.cc b/chrome/browser/ui/views/location_bar/click_handler.cc index 92b2bb7..38002ff 100644 --- a/chrome/browser/ui/views/location_bar/click_handler.cc +++ b/chrome/browser/ui/views/location_bar/click_handler.cc @@ -6,8 +6,8 @@ #include "chrome/browser/tab_contents/navigation_controller.h" #include "chrome/browser/tab_contents/tab_contents.h" -#include "chrome/browser/tab_contents_wrapper.h" -#include "chrome/browser/views/location_bar/location_bar_view.h" +#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" +#include "chrome/browser/ui/views/location_bar/location_bar_view.h" #include "views/view.h" ClickHandler::ClickHandler(const views::View* owner, diff --git a/chrome/browser/ui/views/location_bar/content_setting_image_view.cc b/chrome/browser/ui/views/location_bar/content_setting_image_view.cc index 7115f15..cd151bb 100644 --- a/chrome/browser/ui/views/location_bar/content_setting_image_view.cc +++ b/chrome/browser/ui/views/location_bar/content_setting_image_view.cc @@ -11,9 +11,9 @@ #include "chrome/browser/content_setting_bubble_model.h" #include "chrome/browser/content_setting_image_model.h" #include "chrome/browser/tab_contents/tab_contents.h" -#include "chrome/browser/tab_contents_wrapper.h" -#include "chrome/browser/views/content_setting_bubble_contents.h" -#include "chrome/browser/views/location_bar/location_bar_view.h" +#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" +#include "chrome/browser/ui/views/content_setting_bubble_contents.h" +#include "chrome/browser/ui/views/location_bar/location_bar_view.h" #include "chrome/common/chrome_switches.h" #include "gfx/canvas.h" #include "gfx/canvas_skia.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 847d53b..9b78c6b 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc @@ -25,18 +25,18 @@ #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" -#include "chrome/browser/tab_contents_wrapper.h" +#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" +#include "chrome/browser/ui/view_ids.h" #include "chrome/browser/ui/views/location_bar/suggested_text_view.h" -#include "chrome/browser/view_ids.h" -#include "chrome/browser/views/browser_dialogs.h" -#include "chrome/browser/views/location_bar/content_setting_image_view.h" -#include "chrome/browser/views/location_bar/ev_bubble_view.h" -#include "chrome/browser/views/location_bar/keyword_hint_view.h" -#include "chrome/browser/views/location_bar/location_icon_view.h" -#include "chrome/browser/views/location_bar/page_action_image_view.h" -#include "chrome/browser/views/location_bar/page_action_with_badge_view.h" -#include "chrome/browser/views/location_bar/selected_keyword_view.h" -#include "chrome/browser/views/location_bar/star_view.h" +#include "chrome/browser/ui/views/browser_dialogs.h" +#include "chrome/browser/ui/views/location_bar/content_setting_image_view.h" +#include "chrome/browser/ui/views/location_bar/ev_bubble_view.h" +#include "chrome/browser/ui/views/location_bar/keyword_hint_view.h" +#include "chrome/browser/ui/views/location_bar/location_icon_view.h" +#include "chrome/browser/ui/views/location_bar/page_action_image_view.h" +#include "chrome/browser/ui/views/location_bar/page_action_with_badge_view.h" +#include "chrome/browser/ui/views/location_bar/selected_keyword_view.h" +#include "chrome/browser/ui/views/location_bar/star_view.h" #include "gfx/canvas_skia.h" #include "gfx/color_utils.h" #include "gfx/skia_util.h" diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.h b/chrome/browser/ui/views/location_bar/location_bar_view.h index d83c7de..ebc59a8 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_view.h +++ b/chrome/browser/ui/views/location_bar/location_bar_view.h @@ -13,9 +13,9 @@ #include "chrome/browser/autocomplete/autocomplete_edit.h" #include "chrome/browser/extensions/extension_context_menu_model.h" #include "chrome/browser/first_run/first_run.h" -#include "chrome/browser/location_bar.h" #include "chrome/browser/search_engines/template_url_model_observer.h" #include "chrome/browser/tab_contents/tab_contents.h" +#include "chrome/browser/ui/omnibox/location_bar.h" #include "chrome/browser/ui/toolbar/toolbar_model.h" #include "chrome/browser/views/extensions/extension_popup.h" #include "chrome/common/notification_observer.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 182015b..fec984e 100644 --- a/chrome/browser/ui/views/location_bar/selected_keyword_view.cc +++ b/chrome/browser/ui/views/location_bar/selected_keyword_view.cc @@ -7,9 +7,9 @@ #include "app/l10n_util.h" #include "base/logging.h" #include "chrome/browser/search_engines/template_url_model.h" -#include "chrome/browser/location_bar_util.h" #include "chrome/browser/profile.h" -#include "chrome/browser/views/location_bar/keyword_hint_view.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" SelectedKeywordView::SelectedKeywordView(const int background_images[], diff --git a/chrome/browser/ui/views/location_bar/star_view.cc b/chrome/browser/ui/views/location_bar/star_view.cc index 7d22441..95de4c0 100644 --- a/chrome/browser/ui/views/location_bar/star_view.cc +++ b/chrome/browser/ui/views/location_bar/star_view.cc @@ -8,8 +8,8 @@ #include "app/resource_bundle.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/command_updater.h" -#include "chrome/browser/view_ids.h" -#include "chrome/browser/views/browser_dialogs.h" +#include "chrome/browser/ui/view_ids.h" +#include "chrome/browser/ui/views/browser_dialogs.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" diff --git a/chrome/browser/ui/views/options/advanced_contents_view.cc b/chrome/browser/ui/views/options/advanced_contents_view.cc index 5982ee6..056f08d 100644 --- a/chrome/browser/ui/views/options/advanced_contents_view.cc +++ b/chrome/browser/ui/views/options/advanced_contents_view.cc @@ -28,7 +28,6 @@ #include "chrome/browser/download/download_prefs.h" #include "chrome/browser/google/google_util.h" #include "chrome/browser/gears_integration.h" -#include "chrome/browser/options_util.h" #include "chrome/browser/prefs/pref_member.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/prefs/pref_set_observer.h" @@ -39,14 +38,15 @@ #include "chrome/browser/renderer_host/resource_dispatcher_host.h" #include "chrome/browser/safe_browsing/safe_browsing_service.h" #include "chrome/browser/shell_dialogs.h" -#include "chrome/browser/show_options_url.h" #include "chrome/browser/ui/browser.h" -#include "chrome/browser/views/browser_dialogs.h" -#include "chrome/browser/views/clear_browsing_data.h" -#include "chrome/browser/views/list_background.h" -#include "chrome/browser/views/options/content_settings_window_view.h" -#include "chrome/browser/views/options/fonts_languages_window_view.h" -#include "chrome/browser/views/restart_message_box.h" +#include "chrome/browser/ui/options/options_util.h" +#include "chrome/browser/ui/options/show_options_url.h" +#include "chrome/browser/ui/views/browser_dialogs.h" +#include "chrome/browser/ui/views/clear_browsing_data.h" +#include "chrome/browser/ui/views/list_background.h" +#include "chrome/browser/ui/views/options/content_settings_window_view.h" +#include "chrome/browser/ui/views/options/fonts_languages_window_view.h" +#include "chrome/browser/ui/views/restart_message_box.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" diff --git a/chrome/browser/ui/views/options/advanced_page_view.cc b/chrome/browser/ui/views/options/advanced_page_view.cc index 712955c..0c42e3b 100644 --- a/chrome/browser/ui/views/options/advanced_page_view.cc +++ b/chrome/browser/ui/views/options/advanced_page_view.cc @@ -7,10 +7,10 @@ #include "app/l10n_util.h" #include "app/message_box_flags.h" #include "base/string_util.h" -#include "chrome/browser/options_util.h" #include "chrome/browser/profile.h" -#include "chrome/browser/views/options/advanced_contents_view.h" -#include "chrome/browser/views/options/managed_prefs_banner_view.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" #include "chrome/common/chrome_constants.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.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 d1912f0..0814b24 100644 --- a/chrome/browser/ui/views/options/cookie_filter_page_view.cc +++ b/chrome/browser/ui/views/options/cookie_filter_page_view.cc @@ -7,8 +7,8 @@ #include "app/l10n_util.h" #include "chrome/browser/content_settings/host_content_settings_map.h" #include "chrome/browser/profile.h" -#include "chrome/browser/show_options_url.h" -#include "chrome/browser/views/options/cookies_view.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" #include "grit/generated_resources.h" #include "grit/locale_settings.h" diff --git a/chrome/browser/ui/views/options/general_page_view.cc b/chrome/browser/ui/views/options/general_page_view.cc index e8a5457..98135ab 100644 --- a/chrome/browser/ui/views/options/general_page_view.cc +++ b/chrome/browser/ui/views/options/general_page_view.cc @@ -23,11 +23,11 @@ #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" -#include "chrome/browser/show_options_url.h" #include "chrome/browser/ui/browser.h" -#include "chrome/browser/views/keyword_editor_view.h" -#include "chrome/browser/views/options/managed_prefs_banner_view.h" -#include "chrome/browser/views/options/options_group_view.h" +#include "chrome/browser/ui/options/show_options_url.h" +#include "chrome/browser/ui/views/keyword_editor_view.h" +#include "chrome/browser/ui/views/options/managed_prefs_banner_view.h" +#include "chrome/browser/ui/views/options/options_group_view.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" diff --git a/chrome/browser/ui/views/options/options_page_view.h b/chrome/browser/ui/views/options/options_page_view.h index 8562f11..bbbc8c4 100644 --- a/chrome/browser/ui/views/options/options_page_view.h +++ b/chrome/browser/ui/views/options/options_page_view.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_UI_VIEWS_OPTIONS_OPTIONS_PAGE_VIEW_H__ #pragma once -#include "chrome/browser/options_page_base.h" +#include "chrome/browser/ui/options/options_page_base.h" #include "views/controls/link.h" #include "views/controls/button/native_button.h" diff --git a/chrome/browser/ui/views/options/options_window_view.cc b/chrome/browser/ui/views/options/options_window_view.cc index e52c8ae..dc3518b 100644 --- a/chrome/browser/ui/views/options/options_window_view.cc +++ b/chrome/browser/ui/views/options/options_window_view.cc @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/options_window.h" - #include "app/l10n_util.h" #include "base/utf_string_conversions.h" #include "chrome/browser/browser_process.h" @@ -11,6 +9,7 @@ #include "chrome/browser/profile.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_window.h" +#include "chrome/browser/ui/options/options_window.h" #include "chrome/browser/ui/views/options/advanced_page_view.h" #include "chrome/browser/ui/views/options/content_page_view.h" #include "chrome/browser/ui/views/options/general_page_view.h" diff --git a/chrome/browser/ui/views/options/plugin_filter_page_view.cc b/chrome/browser/ui/views/options/plugin_filter_page_view.cc index aee62ff..94ae40d 100644 --- a/chrome/browser/ui/views/options/plugin_filter_page_view.cc +++ b/chrome/browser/ui/views/options/plugin_filter_page_view.cc @@ -5,8 +5,8 @@ #include "chrome/browser/views/options/plugin_filter_page_view.h" #include "app/l10n_util.h" -#include "chrome/browser/show_options_url.h" #include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/options/show_options_url.h" #include "chrome/common/url_constants.h" #include "grit/generated_resources.h" #include "views/grid_layout.h" diff --git a/chrome/browser/ui/views/status_bubble_views.h b/chrome/browser/ui/views/status_bubble_views.h index 118f027..456eab7 100644 --- a/chrome/browser/ui/views/status_bubble_views.h +++ b/chrome/browser/ui/views/status_bubble_views.h @@ -10,7 +10,7 @@ #include "base/scoped_ptr.h" #include "base/string16.h" #include "base/task.h" -#include "chrome/browser/status_bubble.h" +#include "chrome/browser/ui/status_bubble.h" #include "googleurl/src/gurl.h" #include "gfx/rect.h" diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_container_gtk.cc b/chrome/browser/ui/views/tab_contents/native_tab_contents_container_gtk.cc index 0c07fa7..82c0b26 100644 --- a/chrome/browser/ui/views/tab_contents/native_tab_contents_container_gtk.cc +++ b/chrome/browser/ui/views/tab_contents/native_tab_contents_container_gtk.cc @@ -7,8 +7,8 @@ #include "chrome/browser/renderer_host/render_widget_host_view.h" #include "chrome/browser/tab_contents/interstitial_page.h" #include "chrome/browser/tab_contents/tab_contents.h" -#include "chrome/browser/view_ids.h" -#include "chrome/browser/views/tab_contents/tab_contents_container.h" +#include "chrome/browser/ui/view_ids.h" +#include "chrome/browser/ui/views/tab_contents/tab_contents_container.h" #include "views/focus/focus_manager.h" #include "views/widget/root_view.h" #include "views/widget/widget.h" diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_container_win.cc b/chrome/browser/ui/views/tab_contents/native_tab_contents_container_win.cc index eba411f..99c37a9 100644 --- a/chrome/browser/ui/views/tab_contents/native_tab_contents_container_win.cc +++ b/chrome/browser/ui/views/tab_contents/native_tab_contents_container_win.cc @@ -7,9 +7,9 @@ #include "chrome/browser/renderer_host/render_widget_host_view.h" #include "chrome/browser/tab_contents/interstitial_page.h" #include "chrome/browser/tab_contents/tab_contents.h" -#include "chrome/browser/view_ids.h" -#include "chrome/browser/views/tab_contents/tab_contents_container.h" -#include "chrome/browser/views/tab_contents/tab_contents_view_win.h" +#include "chrome/browser/ui/view_ids.h" +#include "chrome/browser/ui/views/tab_contents/tab_contents_container.h" +#include "chrome/browser/ui/views/tab_contents/tab_contents_view_win.h" #include "views/focus/focus_manager.h" diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_container.cc b/chrome/browser/ui/views/tab_contents/tab_contents_container.cc index 9ab6078..eb5b1ad 100644 --- a/chrome/browser/ui/views/tab_contents/tab_contents_container.cc +++ b/chrome/browser/ui/views/tab_contents/tab_contents_container.cc @@ -8,8 +8,8 @@ #include "chrome/browser/renderer_host/render_widget_host_view.h" #include "chrome/browser/tab_contents/interstitial_page.h" #include "chrome/browser/tab_contents/tab_contents.h" -#include "chrome/browser/view_ids.h" -#include "chrome/browser/views/tab_contents/native_tab_contents_container.h" +#include "chrome/browser/ui/view_ids.h" +#include "chrome/browser/ui/views/tab_contents/native_tab_contents_container.h" #include "chrome/common/notification_service.h" #if defined(TOUCH_UI) diff --git a/chrome/browser/ui/views/tabs/base_tab.cc b/chrome/browser/ui/views/tabs/base_tab.cc index e612e1d..7efc542 100644 --- a/chrome/browser/ui/views/tabs/base_tab.cc +++ b/chrome/browser/ui/views/tabs/base_tab.cc @@ -15,8 +15,8 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/ui/browser.h" -#include "chrome/browser/views/tabs/tab_controller.h" -#include "chrome/browser/view_ids.h" +#include "chrome/browser/ui/view_ids.h" +#include "chrome/browser/ui/views/tabs/tab_controller.h" #include "chrome/common/chrome_switches.h" #include "gfx/canvas_skia.h" #include "gfx/favicon_size.h" diff --git a/chrome/browser/ui/views/tabs/base_tab_strip.cc b/chrome/browser/ui/views/tabs/base_tab_strip.cc index 4f844ed..e45aca6 100644 --- a/chrome/browser/ui/views/tabs/base_tab_strip.cc +++ b/chrome/browser/ui/views/tabs/base_tab_strip.cc @@ -5,9 +5,9 @@ #include "chrome/browser/views/tabs/base_tab_strip.h" #include "base/logging.h" -#include "chrome/browser/view_ids.h" -#include "chrome/browser/views/tabs/dragged_tab_controller.h" -#include "chrome/browser/views/tabs/tab_strip_controller.h" +#include "chrome/browser/ui/view_ids.h" +#include "chrome/browser/ui/views/tabs/dragged_tab_controller.h" +#include "chrome/browser/ui/views/tabs/tab_strip_controller.h" #include "views/widget/root_view.h" #include "views/window/window.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 426fe58..c9b96eb 100644 --- a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc +++ b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc @@ -10,12 +10,12 @@ #include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/tab_contents/tab_contents.h" -#include "chrome/browser/tab_contents_wrapper.h" -#include "chrome/browser/tab_menu_model.h" #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/browser/ui/browser.h" -#include "chrome/browser/views/tabs/base_tab_strip.h" -#include "chrome/browser/views/tabs/tab_renderer_data.h" +#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" +#include "chrome/browser/ui/tabs/tab_menu_model.h" +#include "chrome/browser/ui/views/tabs/base_tab_strip.h" +#include "chrome/browser/ui/views/tabs/tab_renderer_data.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/notification_service.h" #include "chrome/common/url_constants.h" diff --git a/chrome/browser/ui/views/tabs/dragged_tab_controller.h b/chrome/browser/ui/views/tabs/dragged_tab_controller.h index f00a0ef..78481ae 100644 --- a/chrome/browser/ui/views/tabs/dragged_tab_controller.h +++ b/chrome/browser/ui/views/tabs/dragged_tab_controller.h @@ -10,7 +10,7 @@ #include "base/scoped_ptr.h" #include "base/timer.h" #include "chrome/browser/tab_contents/tab_contents_delegate.h" -#include "chrome/browser/tab_contents_wrapper.h" +#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/browser/ui/tabs/dock_info.h" #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" diff --git a/chrome/browser/ui/views/tabs/side_tab_strip.cc b/chrome/browser/ui/views/tabs/side_tab_strip.cc index b449bb9..c9e2b69 100644 --- a/chrome/browser/ui/views/tabs/side_tab_strip.cc +++ b/chrome/browser/ui/views/tabs/side_tab_strip.cc @@ -6,9 +6,9 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" -#include "chrome/browser/views/tabs/side_tab.h" -#include "chrome/browser/views/tabs/tab_strip_controller.h" -#include "chrome/browser/view_ids.h" +#include "chrome/browser/ui/view_ids.h" +#include "chrome/browser/ui/views/tabs/side_tab.h" +#include "chrome/browser/ui/views/tabs/tab_strip_controller.h" #include "gfx/canvas.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" diff --git a/chrome/browser/ui/views/tabs/tab_dragging_test.cc b/chrome/browser/ui/views/tabs/tab_dragging_test.cc index 2cb0171..dc433ad 100644 --- a/chrome/browser/ui/views/tabs/tab_dragging_test.cc +++ b/chrome/browser/ui/views/tabs/tab_dragging_test.cc @@ -5,7 +5,7 @@ #include "base/command_line.h" #include "base/file_util.h" #include "chrome/app/chrome_command_ids.h" -#include "chrome/browser/view_ids.h" +#include "chrome/browser/ui/view_ids.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc index 247475b..d8e03f2 100644 --- a/chrome/browser/ui/views/tabs/tab_strip.cc +++ b/chrome/browser/ui/views/tabs/tab_strip.cc @@ -13,9 +13,9 @@ #include "chrome/browser/defaults.h" #include "chrome/browser/themes/browser_theme_provider.h" #include "chrome/browser/ui/browser.h" -#include "chrome/browser/view_ids.h" -#include "chrome/browser/views/tabs/tab.h" -#include "chrome/browser/views/tabs/tab_strip_controller.h" +#include "chrome/browser/ui/view_ids.h" +#include "chrome/browser/ui/views/tabs/tab.h" +#include "chrome/browser/ui/views/tabs/tab_strip_controller.h" #include "chrome/common/pref_names.h" #include "gfx/canvas_skia.h" #include "gfx/path.h" diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc index bc1e0a3..f2c5e2b 100644 --- a/chrome/browser/ui/views/toolbar_view.cc +++ b/chrome/browser/ui/views/toolbar_view.cc @@ -16,11 +16,11 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/toolbar/wrench_menu_model.h" +#include "chrome/browser/ui/view_ids.h" #include "chrome/browser/ui/views/browser_actions_container.h" #include "chrome/browser/ui/views/event_utils.h" #include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/upgrade_detector.h" -#include "chrome/browser/view_ids.h" #include "chrome/common/badge_util.h" #include "chrome/common/notification_service.h" #include "chrome/common/pref_names.h" |