summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authormaruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-15 12:27:03 +0000
committermaruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-15 12:27:03 +0000
commit1eb89e8fbf2d31247f5ceb271d8887a63d4a2bcf (patch)
treeb78be07dbada3ac0f6d2435558e4a6aaba198ffc /chrome
parentea15e98a9353494df754a11fb49f0e4b8c0d4789 (diff)
downloadchromium_src-1eb89e8fbf2d31247f5ceb271d8887a63d4a2bcf.zip
chromium_src-1eb89e8fbf2d31247f5ceb271d8887a63d4a2bcf.tar.gz
chromium_src-1eb89e8fbf2d31247f5ceb271d8887a63d4a2bcf.tar.bz2
Large patch set (159 files total) to cleanup the includes.
- Slightly reduce the size of the generated .lib files ~3%. - Reduce the number of implicit and explicit atl and windows includes. hooray! - Help incremental build by reducing the number of unnecessary included files. - Split some template class in two, one base class for the common code and the specialization that inherits from the base class. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@937 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/SConscript1
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit.cc10
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit.h29
-rw-r--r--chrome/browser/automation/automation_provider.cc2
-rw-r--r--chrome/browser/bookmark_bar_context_menu_controller.cc3
-rw-r--r--chrome/browser/browser.cc3
-rw-r--r--chrome/browser/browser.h15
-rw-r--r--chrome/browser/browser.vcproj8
-rw-r--r--chrome/browser/browser_commands.cc33
-rw-r--r--chrome/browser/browser_init.cc3
-rw-r--r--chrome/browser/browser_main.cc1
-rw-r--r--chrome/browser/browser_prefs.cc2
-rw-r--r--chrome/browser/browser_window.cc39
-rw-r--r--chrome/browser/browser_window.h7
-rw-r--r--chrome/browser/debugger/debugger_io.h14
-rw-r--r--chrome/browser/debugger/debugger_node.cc3
-rw-r--r--chrome/browser/debugger/debugger_wrapper.h22
-rw-r--r--chrome/browser/dom_ui/new_tab_ui.cc1
-rw-r--r--chrome/browser/download_tab_view.cc4
-rw-r--r--chrome/browser/encoding_menu_controller_delegate.cc3
-rw-r--r--chrome/browser/external_tab_container.cc1
-rw-r--r--chrome/browser/external_tab_container.h8
-rw-r--r--chrome/browser/find_in_page_controller.cc4
-rw-r--r--chrome/browser/find_in_page_controller.h13
-rw-r--r--chrome/browser/frame_util.cc2
-rw-r--r--chrome/browser/frame_view.cc1
-rw-r--r--chrome/browser/history_view.cc1
-rw-r--r--chrome/browser/jsmessage_box_handler.cc1
-rw-r--r--chrome/browser/native_ui_contents.cc4
-rw-r--r--chrome/browser/navigation_controller_base.cc1
-rw-r--r--chrome/browser/navigation_controller_base.h11
-rw-r--r--chrome/browser/network_status_view.cc5
-rw-r--r--chrome/browser/page_load_tracker.cc3
-rw-r--r--chrome/browser/page_load_tracker.h14
-rw-r--r--chrome/browser/password_manager.cc6
-rw-r--r--chrome/browser/printing/page_overlays.cc1
-rw-r--r--chrome/browser/printing/page_overlays_unittest.cc2
-rw-r--r--chrome/browser/printing/printer_query.h9
-rw-r--r--chrome/browser/render_widget_host_hwnd.cc3
-rw-r--r--chrome/browser/session_id.h60
-rw-r--r--chrome/browser/session_restore.cc2
-rw-r--r--chrome/browser/session_service.cc6
-rw-r--r--chrome/browser/session_service.h28
-rw-r--r--chrome/browser/shell_dialogs.h11
-rw-r--r--chrome/browser/simple_xp_frame.cc2
-rw-r--r--chrome/browser/ssl_manager.h9
-rw-r--r--chrome/browser/tab_contents.cc3
-rw-r--r--chrome/browser/tab_contents_delegate.h14
-rw-r--r--chrome/browser/tabs/dragged_tab_controller.cc5
-rw-r--r--chrome/browser/tabs/dragged_tab_controller.h10
-rw-r--r--chrome/browser/tabs/tab.cc6
-rw-r--r--chrome/browser/tabs/tab.h12
-rw-r--r--chrome/browser/tabs/tab_strip.cc1
-rw-r--r--chrome/browser/task_manager.cc1
-rw-r--r--chrome/browser/toolbar_model.cc1
-rw-r--r--chrome/browser/views/SConscript1
-rw-r--r--chrome/browser/views/about_chrome_view.cc1
-rw-r--r--chrome/browser/views/bookmark_bar_view.cc7
-rw-r--r--chrome/browser/views/bookmark_bar_view_test.cc1
-rw-r--r--chrome/browser/views/browser_views.vcproj4
-rw-r--r--chrome/browser/views/constrained_window_impl.cc2
-rw-r--r--chrome/browser/views/constrained_window_impl.h9
-rw-r--r--chrome/browser/views/dom_view.cc64
-rw-r--r--chrome/browser/views/dom_view.h51
-rw-r--r--chrome/browser/views/download_item_view.cc12
-rw-r--r--chrome/browser/views/first_run_bubble.cc1
-rw-r--r--chrome/browser/views/frame/browser_view2.cc4
-rw-r--r--chrome/browser/views/html_dialog_view.cc3
-rw-r--r--chrome/browser/views/hung_renderer_view.cc2
-rw-r--r--chrome/browser/views/info_bar_item_view.cc1
-rw-r--r--chrome/browser/views/info_bubble.cc2
-rw-r--r--chrome/browser/views/info_bubble.h11
-rw-r--r--chrome/browser/views/location_bar_view.cc3
-rw-r--r--chrome/browser/views/options/general_page_view.cc1
-rw-r--r--chrome/browser/views/options/language_combobox_model.cc1
-rw-r--r--chrome/browser/views/options/options_page_view.cc2
-rw-r--r--chrome/browser/views/options/options_window_view.cc1
-rw-r--r--chrome/browser/views/restart_message_box.cc1
-rw-r--r--chrome/browser/views/star_toggle.cc4
-rw-r--r--chrome/browser/views/status_bubble.cc1
-rw-r--r--chrome/browser/views/toolbar_view.cc2
-rw-r--r--chrome/browser/web_app_launcher.cc1
-rw-r--r--chrome/browser/web_contents.cc1
-rw-r--r--chrome/browser/web_contents.h13
-rw-r--r--chrome/browser/wizard/wizard.cc1
-rw-r--r--chrome/common/SConscript1
-rw-r--r--chrome/common/chrome_plugin_lib.cc6
-rw-r--r--chrome/common/chrome_plugin_lib.h14
-rw-r--r--chrome/common/common.vcproj4
-rw-r--r--chrome/common/drag_drop_types.cc6
-rw-r--r--chrome/common/drag_drop_types.h12
-rw-r--r--chrome/common/gfx/chrome_font.cc25
-rw-r--r--chrome/common/gfx/chrome_font.h30
-rw-r--r--chrome/common/pref_member.cc111
-rw-r--r--chrome/common/pref_member.h140
-rw-r--r--chrome/common/pref_member_unittest.cc1
-rw-r--r--chrome/common/pref_service.h11
-rw-r--r--chrome/test/ui/view_event_test_base.cc5
-rw-r--r--chrome/test/ui/view_event_test_base.h6
-rw-r--r--chrome/views/SConscript2
-rw-r--r--chrome/views/accelerator.cc3
-rw-r--r--chrome/views/accelerator.h8
-rw-r--r--chrome/views/accessibility/accessible_wrapper.h10
-rw-r--r--chrome/views/accessibility/autocomplete_accessibility.cc1
-rw-r--r--chrome/views/accessibility/view_accessibility.cc1
-rw-r--r--chrome/views/base_button.cc12
-rw-r--r--chrome/views/base_button.h6
-rw-r--r--chrome/views/bitmap_scroll_bar.cc1
-rw-r--r--chrome/views/button.cc1
-rw-r--r--chrome/views/button.h2
-rw-r--r--chrome/views/button_dropdown.cc4
-rw-r--r--chrome/views/checkbox.cc4
-rw-r--r--chrome/views/chrome_menu.cc1
-rw-r--r--chrome/views/combo_box.cc1
-rw-r--r--chrome/views/controller.h4
-rw-r--r--chrome/views/custom_frame_window.cc1
-rw-r--r--chrome/views/dialog_delegate.cc58
-rw-r--r--chrome/views/dialog_delegate.h27
-rw-r--r--chrome/views/event.cc10
-rw-r--r--chrome/views/event.h23
-rw-r--r--chrome/views/focus_manager_unittest.cc3
-rw-r--r--chrome/views/hwnd_view_container.cc3
-rw-r--r--chrome/views/hwnd_view_container.h17
-rw-r--r--chrome/views/label.cc3
-rw-r--r--chrome/views/link.cc4
-rw-r--r--chrome/views/menu.cc26
-rw-r--r--chrome/views/menu.h43
-rw-r--r--chrome/views/menu_button.cc5
-rw-r--r--chrome/views/native_button.cc1
-rw-r--r--chrome/views/native_control.cc1
-rw-r--r--chrome/views/painter.cc1
-rw-r--r--chrome/views/root_view.cc24
-rw-r--r--chrome/views/root_view_drop_target.cc1
-rw-r--r--chrome/views/tabbed_pane.cc5
-rw-r--r--chrome/views/text_button.cc4
-rw-r--r--chrome/views/text_field.cc1
-rw-r--r--chrome/views/tree_view.cc2
-rw-r--r--chrome/views/view.cc14
-rw-r--r--chrome/views/view.h45
-rw-r--r--chrome/views/view_container.h24
-rw-r--r--chrome/views/view_unittest.cc7
-rw-r--r--chrome/views/views.vcproj8
-rw-r--r--chrome/views/window.cc4
-rw-r--r--chrome/views/window_delegate.cc54
-rw-r--r--chrome/views/window_delegate.h36
145 files changed, 987 insertions, 573 deletions
diff --git a/chrome/browser/SConscript b/chrome/browser/SConscript
index 0824ce5..6b9ba58 100644
--- a/chrome/browser/SConscript
+++ b/chrome/browser/SConscript
@@ -113,6 +113,7 @@ input_files = [
'browser_process_impl.cc',
'browser_shutdown.cc',
'browser_url_handler.cc',
+ 'browser_window.cc',
'browsing_data_remover.cc',
'browsing_instance.cc',
'cache_manager_host.cc',
diff --git a/chrome/browser/autocomplete/autocomplete_edit.cc b/chrome/browser/autocomplete/autocomplete_edit.cc
index 416b0b3..de2e2f1 100644
--- a/chrome/browser/autocomplete/autocomplete_edit.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit.cc
@@ -34,9 +34,11 @@
#include "base/base_drag_source.h"
#include "base/clipboard_util.h"
#include "base/gfx/skia_utils.h"
+#include "base/iat_patch.h"
#include "base/ref_counted.h"
#include "base/string_util.h"
#include "chrome/app/chrome_dll_resource.h"
+#include "chrome/browser/autocomplete/autocomplete_popup.h"
#include "chrome/browser/autocomplete/edit_drop_target.h"
#include "chrome/browser/autocomplete/keyword_provider.h"
#include "chrome/browser/browser_process.h"
@@ -504,6 +506,14 @@ void AutocompleteEdit::ClosePopup() {
popup_->StopAutocomplete();
}
+bool AutocompleteEdit::query_in_progress() const {
+ return popup_->query_in_progress();
+}
+
+const AutocompleteResult* AutocompleteEdit::latest_result() const {
+ return popup_->latest_result();
+}
+
IAccessible* AutocompleteEdit::GetIAccessible() {
if (!autocomplete_accessibility_) {
CComObject<AutocompleteAccessibility>* accessibility = NULL;
diff --git a/chrome/browser/autocomplete/autocomplete_edit.h b/chrome/browser/autocomplete/autocomplete_edit.h
index 9f3ecca..35b4b01 100644
--- a/chrome/browser/autocomplete/autocomplete_edit.h
+++ b/chrome/browser/autocomplete/autocomplete_edit.h
@@ -27,28 +27,33 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H__
-#define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H__
+#ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_
+#define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_
#include <atlbase.h>
#include <atlapp.h>
-#include <atlcomcli.h>
+#include <atlcrack.h>
#include <atlctrls.h>
-#include <oleacc.h>
+#include <atlmisc.h>
#include <tom.h> // For ITextDocument, a COM interface to CRichEditCtrl
-#include "base/iat_patch.h"
#include "base/scoped_ptr.h"
-#include "chrome/browser/autocomplete/autocomplete_popup.h"
-#include "chrome/browser/security_style.h"
+#include "chrome/browser/autocomplete/autocomplete.h"
#include "chrome/browser/toolbar_model.h"
#include "chrome/common/gfx/chrome_font.h"
+#include "chrome/common/page_transition_types.h"
#include "chrome/views/menu.h"
+#include "webkit/glue/window_open_disposition.h"
+class AutocompletePopup;
class CommandController;
class Profile;
class TabContents;
+namespace ChromeViews {
+class View;
+}
+
// Provides the implementation of an edit control with a drop-down
// autocomplete box. The box itself is implemented in autocomplete_popup.cc
// This file implements the edit box and management for the popup.
@@ -236,14 +241,12 @@ class AutocompleteEdit
// in progress. This logic should in the future live in
// AutocompleteController but resides here for now. This method is used by
// AutomationProvider::AutocompleteEditIsQueryInProgress.
- bool query_in_progress() const { return popup_->query_in_progress(); }
+ bool query_in_progress() const;
// Returns the lastest autocomplete results. This logic should in the future
// live in AutocompleteController but resides here for now. This method is
// used by AutomationProvider::AutocompleteEditGetMatches.
- const AutocompleteResult* latest_result() const {
- return popup_->latest_result();
- }
+ const AutocompleteResult* latest_result() const;
// Exposes custom IAccessible implementation to the overall MSAA hierarchy.
IAccessible* GetIAccessible();
@@ -807,7 +810,7 @@ class AutocompleteEdit
// Instance of accessibility information and handling.
mutable CComPtr<IAccessible> autocomplete_accessibility_;
- DISALLOW_EVIL_CONSTRUCTORS(AutocompleteEdit);
+ DISALLOW_COPY_AND_ASSIGN(AutocompleteEdit);
};
-#endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H__
+#endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index d6e6b08..e580aa3 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -30,6 +30,7 @@
#include "chrome/browser/automation/automation_provider.h"
#include "base/path_service.h"
+#include "chrome/app/chrome_dll_resource.h"
#include "chrome/browser/automation/automation_provider_list.h"
#include "chrome/browser/automation/ui_controls.h"
#include "chrome/browser/automation/url_request_failed_dns_job.h"
@@ -45,6 +46,7 @@
#include "chrome/browser/printing/print_job.h"
#include "chrome/browser/save_package.h"
#include "chrome/browser/ssl_blocking_page.h"
+#include "chrome/browser/web_contents.h"
#include "chrome/browser/views/location_bar_view.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/test/automation/automation_messages.h"
diff --git a/chrome/browser/bookmark_bar_context_menu_controller.cc b/chrome/browser/bookmark_bar_context_menu_controller.cc
index 75bd4fb..472bad2 100644
--- a/chrome/browser/bookmark_bar_context_menu_controller.cc
+++ b/chrome/browser/bookmark_bar_context_menu_controller.cc
@@ -34,11 +34,14 @@
#include "chrome/browser/browser_list.h"
#include "chrome/browser/page_navigator.h"
#include "chrome/browser/profile.h"
+#include "chrome/browser/tab_contents.h"
#include "chrome/browser/user_metrics.h"
#include "chrome/browser/views/bookmark_editor_view.h"
#include "chrome/browser/views/input_window.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
+#include "chrome/views/view_container.h"
+#include "chrome/views/window.h"
#include "generated_resources.h"
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index b1c5d88..bc8408f 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -41,6 +41,7 @@
#include "chrome/browser/browser_shutdown.h"
#include "chrome/browser/browser_url_handler.h"
#include "chrome/browser/cert_store.h"
+#include "chrome/browser/debugger/debugger_window.h"
#include "chrome/browser/dom_ui/new_tab_ui.h"
#include "chrome/browser/frame_util.h"
#include "chrome/browser/navigation_controller.h"
@@ -58,6 +59,7 @@
#include "chrome/browser/views/download_shelf_view.h"
#include "chrome/browser/views/go_button.h"
#include "chrome/browser/views/bookmark_bar_view.h"
+#include "chrome/browser/views/html_dialog_view.h"
#include "chrome/browser/views/location_bar_view.h"
#include "chrome/browser/views/toolbar_star_toggle.h"
#include "chrome/browser/vista_frame.h"
@@ -67,6 +69,7 @@
#include "chrome/common/l10n_util.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
+#include "chrome/common/win_util.h"
#include "net/base/cookie_monster.h"
#include "net/base/cookie_policy.h"
#include "net/base/net_util.h"
diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h
index 35ccb37..6b467183 100644
--- a/chrome/browser/browser.h
+++ b/chrome/browser/browser.h
@@ -30,31 +30,28 @@
#ifndef CHROME_BROWSER_BROWSER_H_
#define CHROME_BROWSER_BROWSER_H_
-#include "chrome/app/chrome_dll_resource.h"
-#include "chrome/browser/browser_type.h"
#include "chrome/browser/controller.h"
#include "chrome/browser/hang_monitor/hung_plugin_action.h"
#include "chrome/browser/hang_monitor/hung_window_detector.h"
-#include "chrome/browser/render_process_host.h"
#include "chrome/browser/shell_dialogs.h"
-#include "chrome/browser/debugger/debugger_window.h"
+#include "chrome/browser/browser_type.h"
+#include "chrome/browser/session_id.h"
#include "chrome/browser/tab_contents_delegate.h"
-#include "chrome/browser/tab_contents_type.h"
#include "chrome/browser/tabs/tab_strip_model.h"
-#include "chrome/browser/tabs/tab.h"
#include "chrome/browser/toolbar_model.h"
-#include "chrome/browser/views/html_dialog_view.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/pref_member.h"
+class BrowserIdleTask;
class BrowserWindow;
+class DebuggerWindow;
class GoButton;
class LocationBarView;
class PrefService;
class Profile;
class StatusBubble;
+struct TabNavigation;
class WebContents;
-class BrowserIdleTask;
class WebApp;
class Browser : public TabStripModelDelegate,
@@ -649,7 +646,7 @@ class Browser : public TabStripModelDelegate,
// Keep track of the encoding auto detect pref.
BooleanPrefMember encoding_auto_detect_;
- DISALLOW_EVIL_CONSTRUCTORS(Browser);
+ DISALLOW_COPY_AND_ASSIGN(Browser);
};
#endif // CHROME_BROWSER_BROWSER_H_
diff --git a/chrome/browser/browser.vcproj b/chrome/browser/browser.vcproj
index 98286a1..d6fd648 100644
--- a/chrome/browser/browser.vcproj
+++ b/chrome/browser/browser.vcproj
@@ -1022,6 +1022,10 @@
>
</File>
<File
+ RelativePath=".\browser_window.cc"
+ >
+ </File>
+ <File
RelativePath=".\browser_window.h"
>
</File>
@@ -1578,6 +1582,10 @@
>
</File>
<File
+ RelativePath=".\session_id.h"
+ >
+ </File>
+ <File
RelativePath=".\session_service.cc"
>
</File>
diff --git a/chrome/browser/browser_commands.cc b/chrome/browser/browser_commands.cc
index e0e14e1..0514dfb 100644
--- a/chrome/browser/browser_commands.cc
+++ b/chrome/browser/browser_commands.cc
@@ -32,60 +32,37 @@
#include <commdlg.h>
#include <shellapi.h>
-#include <map>
-#include <iostream>
-#include <fstream>
-
-#include "base/command_line.h"
#include "base/file_version_info.h"
-#include "base/gfx/png_encoder.h"
-#include "base/path_service.h"
-#include "base/string_util.h"
-#include "base/win_util.h"
+#include "chrome/app/chrome_dll_resource.h"
#include "chrome/app/locales/locale_settings.h"
#include "chrome/browser/automation/ui_controls.h"
#include "chrome/browser/browser_list.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/browser_shutdown.h"
#include "chrome/browser/browser_window.h"
#include "chrome/browser/character_encoding.h"
-#include "chrome/browser/dom_ui/new_tab_ui.h"
+#include "chrome/browser/debugger/debugger_window.h"
#include "chrome/browser/download_tab_view.h"
#include "chrome/browser/history_tab_ui.h"
#include "chrome/browser/interstitial_page_delegate.h"
-#include "chrome/browser/navigation_controller.h"
#include "chrome/browser/navigation_entry.h"
-#include "chrome/browser/network_status_view.h"
#include "chrome/browser/options_window.h"
-#include "chrome/browser/profile.h"
-#include "chrome/browser/session_startup_pref.h"
#include "chrome/browser/tab_restore_service.h"
#include "chrome/browser/task_manager.h"
-#include "chrome/browser/url_fixer_upper.h"
#include "chrome/browser/user_metrics.h"
-#include "chrome/browser/view_ids.h"
#include "chrome/browser/views/about_chrome_view.h"
-#include "chrome/browser/views/bookmark_bubble_view.h"
#include "chrome/browser/views/bug_report_view.h"
#include "chrome/browser/views/clear_browsing_data.h"
#include "chrome/browser/views/importer_view.h"
-#include "chrome/browser/views/info_bubble.h"
-#include "chrome/browser/views/first_run_view.h"
#include "chrome/browser/views/keyword_editor_view.h"
-#include "chrome/browser/views/location_bar_view.h"
#include "chrome/browser/views/password_manager_view.h"
#include "chrome/browser/views/toolbar_star_toggle.h"
#include "chrome/browser/views/toolbar_view.h"
-#include "chrome/common/chrome_constants.h"
-#include "chrome/common/chrome_switches.h"
-#include "chrome/common/l10n_util.h"
-#include "chrome/common/notification_service.h"
+#include "chrome/browser/web_contents.h"
#include "chrome/common/pref_names.h"
-#include "chrome/common/text_zoom.h"
+#include "chrome/common/pref_service.h"
#include "chrome/common/win_util.h"
-#include "chrome/views/window.h"
-#include "net/base/escape.h"
#include "net/base/net_util.h"
+
#include "generated_resources.h"
///////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/browser/browser_init.cc b/chrome/browser/browser_init.cc
index e3a4630..9745026 100644
--- a/chrome/browser/browser_init.cc
+++ b/chrome/browser/browser_init.cc
@@ -29,7 +29,6 @@
#include "chrome/browser/browser_init.h"
-#include <windows.h>
#include <shellapi.h>
#include "base/basictypes.h"
@@ -39,6 +38,7 @@
#include "base/histogram.h"
#include "base/path_service.h"
#include "base/string_util.h"
+#include "base/win_util.h"
#include "chrome/app/locales/locale_settings.h"
#include "chrome/app/result_codes.h"
#include "chrome/browser/automation/automation_provider.h"
@@ -61,6 +61,7 @@
#include "chrome/common/logging_chrome.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
+#include "chrome/common/win_util.h"
#include "net/base/cookie_monster.h"
#include "net/base/net_util.h"
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index 2287533..c0b3d03 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -40,6 +40,7 @@
#include "base/registry.h"
#include "base/string_util.h"
#include "base/tracked_objects.h"
+#include "base/win_util.h"
#include "chrome/app/result_codes.h"
#include "chrome/browser/automation/automation_provider.h"
#include "chrome/browser/browser.h"
diff --git a/chrome/browser/browser_prefs.cc b/chrome/browser/browser_prefs.cc
index 986e2d3..16eee27 100644
--- a/chrome/browser/browser_prefs.cc
+++ b/chrome/browser/browser_prefs.cc
@@ -43,12 +43,12 @@
#include "chrome/browser/session_startup_pref.h"
#include "chrome/browser/spellchecker.h"
#include "chrome/browser/ssl_manager.h"
-#include "chrome/browser/tab_contents.h"
#include "chrome/browser/tabs/tab_strip_model.h"
#include "chrome/browser/task_manager.h"
#include "chrome/browser/template_url_prepopulate_data.h"
#include "chrome/browser/views/bookmark_bar_view.h"
#include "chrome/browser/views/keyword_editor_view.h"
+#include "chrome/browser/web_contents.h"
namespace browser {
diff --git a/chrome/browser/browser_window.cc b/chrome/browser/browser_window.cc
new file mode 100644
index 0000000..7098ae7
--- /dev/null
+++ b/chrome/browser/browser_window.cc
@@ -0,0 +1,39 @@
+// Copyright 2008, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "chrome/browser/browser_window.h"
+
+#include <windows.h>
+
+void BrowserWindow::InfoBubbleClosing() {
+ // TODO(beng): (Cleanup) - move out of here!
+ HWND hwnd = static_cast<HWND>(GetPlatformID());
+ // The frame is really inactive, send notification now.
+ DefWindowProc(hwnd, WM_NCACTIVATE, FALSE, 0);
+} \ No newline at end of file
diff --git a/chrome/browser/browser_window.h b/chrome/browser/browser_window.h
index c450562..c5a9420 100644
--- a/chrome/browser/browser_window.h
+++ b/chrome/browser/browser_window.h
@@ -169,12 +169,7 @@ class BrowserWindow {
// The implementation for this sends WM_NCACTIVATE with a value of FALSE for
// the window. Subclasses that need to customize should be sure and invoke
// this implementation too.
- virtual void InfoBubbleClosing() {
- // TODO(beng): (Cleanup) - move out of here!
- HWND hwnd = static_cast<HWND>(GetPlatformID());
- // The frame is really inactive, send notification now.
- DefWindowProc(hwnd, WM_NCACTIVATE, FALSE, 0);
- }
+ virtual void InfoBubbleClosing();
// Returns the star button.
virtual ToolbarStarToggle* GetStarButton() const = 0;
diff --git a/chrome/browser/debugger/debugger_io.h b/chrome/browser/debugger/debugger_io.h
index 6d6e792..7408c62 100644
--- a/chrome/browser/debugger/debugger_io.h
+++ b/chrome/browser/debugger/debugger_io.h
@@ -27,15 +27,18 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef CHROME_BROWSER_DEBUGGER_DEBUGGER_IO_H__
-#define CHROME_BROWSER_DEBUGGER_DEBUGGER_IO_H__
+#ifndef CHROME_BROWSER_DEBUGGER_DEBUGGER_IO_H_
+#define CHROME_BROWSER_DEBUGGER_DEBUGGER_IO_H_
+
+#include <string>
#include "base/basictypes.h"
#include "base/ref_counted.h"
class DebuggerShell;
-class DebuggerInputOutput: public base::RefCountedThreadSafe<DebuggerInputOutput> {
+class DebuggerInputOutput
+ : public base::RefCountedThreadSafe<DebuggerInputOutput> {
public:
DebuggerInputOutput() {}
virtual ~DebuggerInputOutput() {}
@@ -65,8 +68,7 @@ protected:
DebuggerShell* debugger_;
private:
-
- DISALLOW_EVIL_CONSTRUCTORS(DebuggerInputOutput);
+ DISALLOW_COPY_AND_ASSIGN(DebuggerInputOutput);
};
-#endif // CHROME_BROWSER_DEBUGGER_DEBUGGER_IO_H__ \ No newline at end of file
+#endif // CHROME_BROWSER_DEBUGGER_DEBUGGER_IO_H_ \ No newline at end of file
diff --git a/chrome/browser/debugger/debugger_node.cc b/chrome/browser/debugger/debugger_node.cc
index 6ae0c49..885bb82 100644
--- a/chrome/browser/debugger/debugger_node.cc
+++ b/chrome/browser/debugger/debugger_node.cc
@@ -27,7 +27,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "debugger_node.h"
+#include "chrome/browser/debugger/debugger_node.h"
#include "base/process_util.h"
#include "base/string_util.h"
@@ -36,6 +36,7 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/render_process_host.h"
#include "chrome/browser/render_view_host.h"
+#include "chrome/browser/web_contents.h"
#include "chrome/browser/debugger/debugger_shell.h"
DebuggerNode::DebuggerNode() : valid_(true), observing_(false), data_(NULL) {
diff --git a/chrome/browser/debugger/debugger_wrapper.h b/chrome/browser/debugger/debugger_wrapper.h
index 92d9c6c..33ba584 100644
--- a/chrome/browser/debugger/debugger_wrapper.h
+++ b/chrome/browser/debugger/debugger_wrapper.h
@@ -32,15 +32,18 @@
// Debugger needed, add new wrapper methods to this file.
//
// This is a workaround to enable the Debugger without breaking the KJS build.
-// It wraps all methods in Debugger which are called from outside of the debugger
-// project. Each solution has its own project with debugger files. KJS has only
-// debugger_wrapper* and debugger.h, and defines CHROME_DEBUGGER_DISABLED, which makes
-// it compile only a stub version of Debugger that doesn't reference V8. Meanwhile
-// the V8 solution includes all of the debugger files without CHROME_DEBUGGER_DISABLED
-// so the full functionality is enabled.
+// It wraps all methods in Debugger which are called from outside of the
+// debugger project. Each solution has its own project with debugger files.
+// KJS has only debugger_wrapper* and debugger.h, and defines
+// CHROME_DEBUGGER_DISABLED, which makes it compile only a stub version of
+// Debugger that doesn't reference V8. Meanwhile the V8 solution includes all
+// of the debugger files without CHROME_DEBUGGER_DISABLED so the full
+// functionality is enabled.
-#ifndef CHROME_BROWSER_DEBUGGER_DEBUGGER_INTERFACE_H__
-#define CHROME_BROWSER_DEBUGGER_DEBUGGER_INTERFACE_H__
+#ifndef CHROME_BROWSER_DEBUGGER_DEBUGGER_INTERFACE_H_
+#define CHROME_BROWSER_DEBUGGER_DEBUGGER_INTERFACE_H_
+
+#include <string>
#include "base/basictypes.h"
#include "base/ref_counted.h"
@@ -64,5 +67,4 @@ class DebuggerWrapper : public base::RefCountedThreadSafe<DebuggerWrapper> {
scoped_refptr<DebuggerShell> debugger_;
};
-
-#endif // CHROME_BROWSER_DEBUGGER_DEBUGGER_INTERFACE_H__ \ No newline at end of file
+#endif // CHROME_BROWSER_DEBUGGER_DEBUGGER_INTERFACE_H_ \ No newline at end of file
diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc
index e45c6ef..ef36f49 100644
--- a/chrome/browser/dom_ui/new_tab_ui.cc
+++ b/chrome/browser/dom_ui/new_tab_ui.cc
@@ -46,6 +46,7 @@
#include "chrome/common/jstemplate_builder.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/pref_names.h"
+#include "chrome/common/pref_service.h"
#include "chrome/common/resource_bundle.h"
#include "generated_resources.h"
diff --git a/chrome/browser/download_tab_view.cc b/chrome/browser/download_tab_view.cc
index 5f76810..d675833 100644
--- a/chrome/browser/download_tab_view.cc
+++ b/chrome/browser/download_tab_view.cc
@@ -607,7 +607,7 @@ void DownloadItemTabView::DidChangeBounds(const CRect& previous,
}
bool DownloadItemTabView::OnMousePressed(const ChromeViews::MouseEvent& event) {
- CPoint point(event.GetLocation());
+ CPoint point(event.GetX(), event.GetY());
// If the click is in the highlight region, then highlight this download.
// Otherwise, remove the highlighting from any download.
@@ -642,7 +642,7 @@ bool DownloadItemTabView::OnMouseDragged(const ChromeViews::MouseEvent& event) {
if (model_->state() != DownloadItem::COMPLETE)
return false;
- CPoint point(event.GetLocation());
+ CPoint point(event.GetX(), event.GetY());
// In order to make sure drag and drop works as expected when the UI is
// mirrored, we can either flip the mouse X coordinate or flip the X position
diff --git a/chrome/browser/encoding_menu_controller_delegate.cc b/chrome/browser/encoding_menu_controller_delegate.cc
index f0c26c0..8ebd8d8 100644
--- a/chrome/browser/encoding_menu_controller_delegate.cc
+++ b/chrome/browser/encoding_menu_controller_delegate.cc
@@ -29,11 +29,14 @@
#include "chrome/browser/encoding_menu_controller_delegate.h"
+#include "chrome/app/chrome_dll_resource.h"
#include "chrome/browser/browser.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/character_encoding.h"
#include "chrome/browser/profile.h"
+#include "chrome/browser/tab_contents.h"
#include "chrome/common/pref_names.h"
+#include "chrome/common/pref_service.h"
#include "generated_resources.h"
diff --git a/chrome/browser/external_tab_container.cc b/chrome/browser/external_tab_container.cc
index ad872d9..069896a 100644
--- a/chrome/browser/external_tab_container.cc
+++ b/chrome/browser/external_tab_container.cc
@@ -30,6 +30,7 @@
#include "chrome/browser/external_tab_container.h"
#include "base/logging.h"
+#include "base/win_util.h"
#include "chrome/browser/automation/automation_provider.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/tab_contents.h"
diff --git a/chrome/browser/external_tab_container.h b/chrome/browser/external_tab_container.h
index e31340d..eb8bd94 100644
--- a/chrome/browser/external_tab_container.h
+++ b/chrome/browser/external_tab_container.h
@@ -27,8 +27,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef CHROME_BROWSER_EXTERNAL_TAB_CONTAINER_H__
-#define CHROME_BROWSER_EXTERNAL_TAB_CONTAINER_H__
+#ifndef CHROME_BROWSER_EXTERNAL_TAB_CONTAINER_H_
+#define CHROME_BROWSER_EXTERNAL_TAB_CONTAINER_H_
#include <atlbase.h>
#include <atlapp.h>
@@ -41,6 +41,7 @@
#include "chrome/common/notification_service.h"
#include "chrome/views/focus_manager.h"
#include "chrome/views/root_view.h"
+#include "chrome/views/view_container.h"
class AutomationProvider;
class TabContents;
@@ -161,6 +162,7 @@ class ExternalTabContainer : public TabContentsDelegate,
// A view to handle focus cycling
TabContentsContainerView* tab_contents_container_;
private:
- DISALLOW_EVIL_CONSTRUCTORS(ExternalTabContainer);
+ DISALLOW_COPY_AND_ASSIGN(ExternalTabContainer);
};
+
#endif // CHROME_BROWSER_EXTERNAL_TAB_CONTAINER_H__
diff --git a/chrome/browser/find_in_page_controller.cc b/chrome/browser/find_in_page_controller.cc
index 4d5c8ef..d5af4a8 100644
--- a/chrome/browser/find_in_page_controller.cc
+++ b/chrome/browser/find_in_page_controller.cc
@@ -37,9 +37,9 @@
#include "chrome/browser/view_ids.h"
#include "chrome/browser/views/bookmark_bar_view.h"
#include "chrome/views/external_focus_tracker.h"
-#include "chrome/views/focus_manager.h"
-#include "chrome/views/native_scroll_bar.h"
#include "chrome/views/hwnd_view_container.h"
+#include "chrome/views/native_scroll_bar.h"
+#include "chrome/views/root_view.h"
#include "chrome/views/view_storage.h"
int FindInPageController::request_id_counter_ = 0;
diff --git a/chrome/browser/find_in_page_controller.h b/chrome/browser/find_in_page_controller.h
index 1ee56d4..b0d06ac 100644
--- a/chrome/browser/find_in_page_controller.h
+++ b/chrome/browser/find_in_page_controller.h
@@ -27,15 +27,16 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef CHROME_BROWSER_FIND_IN_PAGE_CONTROLLER_H__
-#define CHROME_BROWSER_FIND_IN_PAGE_CONTROLLER_H__
+#ifndef CHROME_BROWSER_FIND_IN_PAGE_CONTROLLER_H_
+#define CHROME_BROWSER_FIND_IN_PAGE_CONTROLLER_H_
-#include "base/gfx/size.h"
+#include "base/gfx/rect.h"
#include "chrome/browser/render_view_host_delegate.h"
-#include "chrome/common/slide_animation.h"
+#include "chrome/common/animation.h"
#include "chrome/views/hwnd_view_container.h"
class FindInPageView;
+class SlideAnimation;
class TabContents;
namespace ChromeViews {
@@ -253,7 +254,7 @@ class FindInPageController : public RenderViewHostDelegate::FindInPage,
// closed.
scoped_ptr<ChromeViews::ExternalFocusTracker> focus_tracker_;
- DISALLOW_EVIL_CONSTRUCTORS(FindInPageController);
+ DISALLOW_COPY_AND_ASSIGN(FindInPageController);
};
-#endif // CHROME_BROWSER_FIND_IN_PAGE_CONTROLLER_H__
+#endif // CHROME_BROWSER_FIND_IN_PAGE_CONTROLLER_H_
diff --git a/chrome/browser/frame_util.cc b/chrome/browser/frame_util.cc
index 2cad99b..90e413c 100644
--- a/chrome/browser/frame_util.cc
+++ b/chrome/browser/frame_util.cc
@@ -30,6 +30,7 @@
#include "chrome/browser/frame_util.h"
#include "base/message_loop.h"
+#include "base/win_util.h"
#include "chrome/app/result_codes.h"
#include "chrome/browser/app_modal_dialog_queue.h"
#include "chrome/browser/browser.h"
@@ -42,6 +43,7 @@
#include "chrome/browser/simple_vista_frame.h"
#include "chrome/browser/simple_xp_frame.h"
#include "chrome/browser/vista_frame.h"
+#include "chrome/browser/web_contents.h"
#include "chrome/browser/xp_frame.h"
#include "chrome/common/notification_source.h"
#include "chrome/common/win_util.h"
diff --git a/chrome/browser/frame_view.cc b/chrome/browser/frame_view.cc
index cb6d7bc..3d1c680 100644
--- a/chrome/browser/frame_view.cc
+++ b/chrome/browser/frame_view.cc
@@ -31,6 +31,7 @@
#include "chrome/browser/browser_window.h"
#include "chrome/browser/tabs/tab_strip.h"
+#include "chrome/common/drag_drop_types.h"
#include "chrome/common/os_exchange_data.h"
FrameView::FrameView(BrowserWindow* window)
diff --git a/chrome/browser/history_view.cc b/chrome/browser/history_view.cc
index de95322..7af3135 100644
--- a/chrome/browser/history_view.cc
+++ b/chrome/browser/history_view.cc
@@ -39,6 +39,7 @@
#include "chrome/browser/views/bookmark_bubble_view.h"
#include "chrome/browser/views/event_utils.h"
#include "chrome/browser/views/star_toggle.h"
+#include "chrome/common/drag_drop_types.h"
#include "chrome/common/gfx/chrome_canvas.h"
#include "chrome/common/gfx/favicon_size.h"
#include "chrome/common/resource_bundle.h"
diff --git a/chrome/browser/jsmessage_box_handler.cc b/chrome/browser/jsmessage_box_handler.cc
index a2e3174..09b9757 100644
--- a/chrome/browser/jsmessage_box_handler.cc
+++ b/chrome/browser/jsmessage_box_handler.cc
@@ -37,6 +37,7 @@
#include "chrome/common/notification_service.h"
#include "chrome/common/notification_types.h"
#include "chrome/common/pref_names.h"
+#include "chrome/common/pref_service.h"
#include "chrome/views/message_box_view.h"
#include "chrome/views/window.h"
diff --git a/chrome/browser/native_ui_contents.cc b/chrome/browser/native_ui_contents.cc
index 67b1186..8d12b52 100644
--- a/chrome/browser/native_ui_contents.cc
+++ b/chrome/browser/native_ui_contents.cc
@@ -27,11 +27,13 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#include "chrome/browser/native_ui_contents.h"
+
#include "chrome/browser/browser.h"
#include "chrome/browser/download_tab_view.h"
#include "chrome/browser/history_tab_ui.h"
-#include "chrome/browser/native_ui_contents.h"
#include "chrome/browser/navigation_entry.h"
+#include "chrome/common/drag_drop_types.h"
#include "chrome/common/gfx/chrome_canvas.h"
#include "chrome/common/gfx/chrome_font.h"
#include "chrome/common/l10n_util.h"
diff --git a/chrome/browser/navigation_controller_base.cc b/chrome/browser/navigation_controller_base.cc
index 3216bc9..f34876d 100644
--- a/chrome/browser/navigation_controller_base.cc
+++ b/chrome/browser/navigation_controller_base.cc
@@ -33,7 +33,6 @@
#include "base/logging.h"
#include "chrome/browser/navigation_entry.h"
-#include "net/base/registry_controlled_domain.h"
#include "webkit/glue/webkit_glue.h"
// The maximum number of entries that a navigation controller can store.
diff --git a/chrome/browser/navigation_controller_base.h b/chrome/browser/navigation_controller_base.h
index ada690f..6b33a58 100644
--- a/chrome/browser/navigation_controller_base.h
+++ b/chrome/browser/navigation_controller_base.h
@@ -27,16 +27,17 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef CHROME_BROWSER_NAVIGATION_CONTROLLER_BASE_H__
-#define CHROME_BROWSER_NAVIGATION_CONTROLLER_BASE_H__
+#ifndef CHROME_BROWSER_NAVIGATION_CONTROLLER_BASE_H_
+#define CHROME_BROWSER_NAVIGATION_CONTROLLER_BASE_H_
#include <vector>
-#include "chrome/browser/site_instance.h"
#include "chrome/browser/tab_contents_type.h"
#include "chrome/common/page_transition_types.h"
+#include "testing/gtest/include/gtest/gtest_prod.h"
class NavigationEntry;
+class SiteInstance;
////////////////////////////////////////////////////////////////////////////////
//
@@ -232,7 +233,7 @@ class NavigationControllerBase {
// The maximum number of entries that a navigation controller can store.
size_t max_entry_count_;
- DISALLOW_EVIL_CONSTRUCTORS(NavigationControllerBase);
+ DISALLOW_COPY_AND_ASSIGN(NavigationControllerBase);
};
-#endif // CHROME_BROWSER_NAVIGATION_CONTROLLER_BASE_H__
+#endif // CHROME_BROWSER_NAVIGATION_CONTROLLER_BASE_H_
diff --git a/chrome/browser/network_status_view.cc b/chrome/browser/network_status_view.cc
index d901324..39c9e92 100644
--- a/chrome/browser/network_status_view.cc
+++ b/chrome/browser/network_status_view.cc
@@ -27,10 +27,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include <stdio.h>
-
#include "chrome/browser/network_status_view.h"
+#include <stdio.h>
+
#include "base/string_util.h"
#include "base/thread.h"
#include "chrome/browser/browser.h"
@@ -40,6 +40,7 @@
#include "chrome/browser/page_load_tracker.h"
#include "chrome/browser/tab_contents_delegate.h"
#include "chrome/views/hwnd_view_container.h"
+#include "chrome/views/root_view.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_job.h"
diff --git a/chrome/browser/page_load_tracker.cc b/chrome/browser/page_load_tracker.cc
index a1d8f2b..1c0bc8a 100644
--- a/chrome/browser/page_load_tracker.cc
+++ b/chrome/browser/page_load_tracker.cc
@@ -29,9 +29,6 @@
#include "chrome/browser/page_load_tracker.h"
-#include <stdlib.h>
-#include <string>
-
#include "base/string_util.h"
#include "chrome/common/gfx/chrome_canvas.h"
#include "chrome/common/gfx/chrome_font.h"
diff --git a/chrome/browser/page_load_tracker.h b/chrome/browser/page_load_tracker.h
index dda772f..3bf8984 100644
--- a/chrome/browser/page_load_tracker.h
+++ b/chrome/browser/page_load_tracker.h
@@ -42,25 +42,19 @@
// See the comments in navigation_profiler.h for an overview of profiling
// architecture.
-#ifndef CHROME_BROWSER_PAGE_LOAD_TRACKER_H__
-#define CHROME_BROWSER_PAGE_LOAD_TRACKER_H__
-
-#include <windows.h>
-#include <atlbase.h>
-#include <atlapp.h>
-#include <atlmisc.h>
+#ifndef CHROME_BROWSER_PAGE_LOAD_TRACKER_H_
+#define CHROME_BROWSER_PAGE_LOAD_TRACKER_H_
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/time.h"
#include "chrome/common/page_transition_types.h"
#include "chrome/views/view.h"
#include "googleurl/src/gurl.h"
-#include "net/url_request/url_request_job.h"
#include "testing/gtest/include/gtest/gtest_prod.h"
+class URLRequestJobMetrics;
class ChromeCanvas;
// Tracks one frame navigation within the page.
@@ -198,4 +192,4 @@ class PageLoadView : public ChromeViews::View {
PageLoadTracker* page_;
};
-#endif // CHROME_BROWSER_PAGE_LOAD_TRACKER_H__
+#endif // CHROME_BROWSER_PAGE_LOAD_TRACKER_H_
diff --git a/chrome/browser/password_manager.cc b/chrome/browser/password_manager.cc
index 0015188..84590cd 100644
--- a/chrome/browser/password_manager.cc
+++ b/chrome/browser/password_manager.cc
@@ -27,15 +27,17 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "chrome/app/theme/theme_resources.h"
#include "chrome/browser/password_manager.h"
+
+#include "base/string_util.h"
+#include "chrome/app/theme/theme_resources.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/web_contents.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/pref_names.h"
+#include "chrome/common/pref_service.h"
#include "chrome/common/resource_bundle.h"
#include "chrome/common/stl_util-inl.h"
-#include "base/string_util.h"
#include "generated_resources.h"
diff --git a/chrome/browser/printing/page_overlays.cc b/chrome/browser/printing/page_overlays.cc
index 6f9d8c3..2b99396 100644
--- a/chrome/browser/printing/page_overlays.cc
+++ b/chrome/browser/printing/page_overlays.cc
@@ -29,6 +29,7 @@
#include "chrome/browser/printing/page_overlays.h"
+#include "base/logging.h"
#include "base/string_util.h"
#include "chrome/browser/printing/printed_document.h"
#include "chrome/browser/printing/printed_page.h"
diff --git a/chrome/browser/printing/page_overlays_unittest.cc b/chrome/browser/printing/page_overlays_unittest.cc
index d15453a..90ac1a2 100644
--- a/chrome/browser/printing/page_overlays_unittest.cc
+++ b/chrome/browser/printing/page_overlays_unittest.cc
@@ -56,7 +56,7 @@ class PagesSource : public printing::PrintedPagesSource {
public:
virtual void RenderOnePrintedPage(printing::PrintedDocument* document,
int page_number) {
- NOTREACHED();
+ EXPECT_FALSE(true);
}
virtual std::wstring RenderSourceName() {
diff --git a/chrome/browser/printing/printer_query.h b/chrome/browser/printing/printer_query.h
index 9b1e50b..70b47df 100644
--- a/chrome/browser/printing/printer_query.h
+++ b/chrome/browser/printing/printer_query.h
@@ -27,9 +27,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef CHROME_BROWSER_PRINTING_PRINTER_QUERY_H__
-#define CHROME_BROWSER_PRINTING_PRINTER_QUERY_H__
+#ifndef CHROME_BROWSER_PRINTING_PRINTER_QUERY_H_
+#define CHROME_BROWSER_PRINTING_PRINTER_QUERY_H_
+#include "base/scoped_ptr.h"
#include "base/ref_counted.h"
#include "chrome/browser/printing/print_job_worker_owner.h"
@@ -119,9 +120,9 @@ class PrinterQuery : public base::RefCountedThreadSafe<PrinterQuery>,
// Task waiting to be executed.
scoped_ptr<CancelableTask> callback_;
- DISALLOW_EVIL_CONSTRUCTORS(PrinterQuery);
+ DISALLOW_COPY_AND_ASSIGN(PrinterQuery);
};
} // namespace printing
-#endif // CHROME_BROWSER_PRINTING_PRINTER_QUERY_H__
+#endif // CHROME_BROWSER_PRINTING_PRINTER_QUERY_H_
diff --git a/chrome/browser/render_widget_host_hwnd.cc b/chrome/browser/render_widget_host_hwnd.cc
index d0adcc3..f17fc7a 100644
--- a/chrome/browser/render_widget_host_hwnd.cc
+++ b/chrome/browser/render_widget_host_hwnd.cc
@@ -29,8 +29,6 @@
#include "chrome/browser/render_widget_host_hwnd.h"
-#include <windows.h>
-
#include "base/command_line.h"
#include "base/gfx/bitmap_header.h"
#include "base/gfx/rect.h"
@@ -43,6 +41,7 @@
#include "chrome/browser/render_widget_host.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/l10n_util.h"
#include "chrome/common/plugin_messages.h"
#include "chrome/common/win_util.h"
#include "chrome/views/hwnd_view_container.h"
diff --git a/chrome/browser/session_id.h b/chrome/browser/session_id.h
new file mode 100644
index 0000000..073f8ed
--- /dev/null
+++ b/chrome/browser/session_id.h
@@ -0,0 +1,60 @@
+// Copyright 2008, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef CHROME_BROWSER_SESSION_ID_H_
+#define CHROME_BROWSER_SESSION_ID_H_
+
+// SessionID ------------------------------------------------------------------
+
+// Uniquely identifies a session, tab or window.
+
+class SessionID {
+ friend class SessionService;
+ public:
+ typedef int32 id_type;
+
+ SessionID();
+ ~SessionID() {}
+
+ // Returns the underlying id.
+ id_type id() const { return id_; }
+
+ // Returns true if the two commands are equal.
+ bool Equals(const SessionID& other) const;
+
+ private:
+ explicit SessionID(id_type id) : id_(id) {}
+
+ // Resets the id. This is used when restoring a session
+ void set_id(id_type id) { id_ = id; }
+
+ id_type id_;
+};
+
+#endif // CHROME_BROWSER_SESSION_ID_H_
diff --git a/chrome/browser/session_restore.cc b/chrome/browser/session_restore.cc
index 57cc6d8..1cc86ef 100644
--- a/chrome/browser/session_restore.cc
+++ b/chrome/browser/session_restore.cc
@@ -35,7 +35,9 @@
#include "chrome/browser/browser.h"
#include "chrome/browser/browser_list.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/navigation_controller.h"
#include "chrome/browser/profile.h"
+#include "chrome/browser/tab_contents.h"
#include "chrome/common/notification_service.h"
namespace {
diff --git a/chrome/browser/session_service.cc b/chrome/browser/session_service.cc
index 6e78f9c..9ed3d9f 100644
--- a/chrome/browser/session_service.cc
+++ b/chrome/browser/session_service.cc
@@ -27,11 +27,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include <limits>
-#include <Windows.h>
-
#include "chrome/browser/session_service.h"
+#include <limits>
+
#include "base/file_util.h"
#include "base/message_loop.h"
#include "base/pickle.h"
@@ -43,6 +42,7 @@
#include "chrome/browser/navigation_entry.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/session_backend.h"
+#include "chrome/browser/tab_contents.h"
#include "chrome/common/notification_details.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/notification_types.h"
diff --git a/chrome/browser/session_service.h b/chrome/browser/session_service.h
index df932f9..8c7a6a6 100644
--- a/chrome/browser/session_service.h
+++ b/chrome/browser/session_service.h
@@ -38,6 +38,7 @@
#include "base/time.h"
#include "chrome/browser/browser_type.h"
#include "chrome/browser/cancelable_request.h"
+#include "chrome/browser/session_id.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/page_transition_types.h"
#include "chrome/common/stl_util-inl.h"
@@ -53,33 +54,6 @@ class Timer;
class SessionBackend;
class SessionCommand;
-// SessionID ------------------------------------------------------------------
-
-// Uniquely identifies a session, tab or window.
-
-class SessionID {
- friend class SessionService;
- public:
- typedef int32 id_type;
-
- SessionID();
- ~SessionID() {}
-
- // Returns the underlying id.
- id_type id() const { return id_; }
-
- // Returns true if the two commands are equal.
- bool Equals(const SessionID& other) const;
-
- private:
- explicit SessionID(id_type id) : id_(id) {}
-
- // Resets the id. This is used when restoring a session
- void set_id(id_type id) { id_ = id; }
-
- id_type id_;
-};
-
// TabNavigation ------------------------------------------------------------
// TabNavigation corresponds to a NavigationEntry.
diff --git a/chrome/browser/shell_dialogs.h b/chrome/browser/shell_dialogs.h
index 8b11060..aee15a1 100644
--- a/chrome/browser/shell_dialogs.h
+++ b/chrome/browser/shell_dialogs.h
@@ -27,8 +27,13 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef CHROME_BROWSER_SHELL_DIALOGS_H__
-#define CHROME_BROWSER_SHELL_DIALOGS_H__
+#ifndef CHROME_BROWSER_SHELL_DIALOGS_H_
+#define CHROME_BROWSER_SHELL_DIALOGS_H_
+
+// TODO(maruel): Remove once HWND is typedef.
+#include <windows.h>
+
+#include <string>
#include "base/ref_counted.h"
@@ -156,4 +161,4 @@ class SelectFontDialog
int font_size) = 0;
};
-#endif // #ifndef CHROME_BROWSER_SHELL_DIALOGS_H__
+#endif // #ifndef CHROME_BROWSER_SHELL_DIALOGS_H_
diff --git a/chrome/browser/simple_xp_frame.cc b/chrome/browser/simple_xp_frame.cc
index f6120f8..a1bf084 100644
--- a/chrome/browser/simple_xp_frame.cc
+++ b/chrome/browser/simple_xp_frame.cc
@@ -148,7 +148,7 @@ void TitleBarMenuButton::Paint(ChromeCanvas* canvas) {
bool TitleBarMenuButton::OnMousePressed(const ChromeViews::MouseEvent& e) {
if (e.GetFlags() & ChromeViews::MouseEvent::EF_IS_DOUBLE_CLICK) {
- if (!HitTest(e.GetLocation()))
+ if (!HitTest(WTL::CPoint(e.GetX(), e.GetY())))
return true;
title_bar_->CloseWindow();
return true;
diff --git a/chrome/browser/ssl_manager.h b/chrome/browser/ssl_manager.h
index 89ca87b..d90af2a 100644
--- a/chrome/browser/ssl_manager.h
+++ b/chrome/browser/ssl_manager.h
@@ -27,8 +27,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef CHROME_BROWSER_SSL_MANAGER_H__
-#define CHROME_BROWSER_SSL_MANAGER_H__
+#ifndef CHROME_BROWSER_SSL_MANAGER_H_
+#define CHROME_BROWSER_SSL_MANAGER_H_
#include <string>
#include <map>
@@ -54,6 +54,7 @@ class NavigationController;
class NavigationEntry;
class LoadFromMemoryCacheDetails;
class LoadNotificationDetails;
+class PrefService;
class ResourceRedirectDetails;
class ResourceRequestDetails;
class SSLErrorInfo;
@@ -479,7 +480,7 @@ class SSLManager : public NotificationObserver {
// currently loading had loaded.
std::vector<SSLMessageInfo> pending_messages_;
- DISALLOW_EVIL_CONSTRUCTORS(SSLManager);
+ DISALLOW_COPY_AND_ASSIGN(SSLManager);
};
-#endif // CHROME_BROWSER_SSL_MANAGER_H__
+#endif // CHROME_BROWSER_SSL_MANAGER_H_
diff --git a/chrome/browser/tab_contents.cc b/chrome/browser/tab_contents.cc
index 43c4b15..419a796 100644
--- a/chrome/browser/tab_contents.cc
+++ b/chrome/browser/tab_contents.cc
@@ -36,8 +36,9 @@
#include "chrome/browser/web_contents.h"
#include "chrome/browser/tab_contents_delegate.h"
#include "chrome/common/pref_names.h"
-#include "chrome/views/focus_manager.h"
+#include "chrome/common/pref_service.h"
#include "chrome/views/native_scroll_bar.h"
+#include "chrome/views/root_view.h"
#include "chrome/views/view.h"
#include "chrome/views/view_storage.h"
diff --git a/chrome/browser/tab_contents_delegate.h b/chrome/browser/tab_contents_delegate.h
index 30d6cbc..40183d6 100644
--- a/chrome/browser/tab_contents_delegate.h
+++ b/chrome/browser/tab_contents_delegate.h
@@ -27,20 +27,18 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef CHROME_BROWSER_TAB_CONTENTS_DELEGATE_H__
-#define CHROME_BROWSER_TAB_CONTENTS_DELEGATE_H__
+#ifndef CHROME_BROWSER_TAB_CONTENTS_DELEGATE_H_
+#define CHROME_BROWSER_TAB_CONTENTS_DELEGATE_H_
+// TODO(maruel): Remove once UINT and HWND are replaced / typedef.
#include <windows.h>
-#include <string>
#include "chrome/browser/page_navigator.h"
-#include "chrome/common/page_transition_types.h"
#include "chrome/common/navigation_types.h"
-#include "webkit/glue/window_open_disposition.h"
namespace gfx {
- class Point;
- class Rect;
+class Point;
+class Rect;
}
class TabContents;
@@ -192,4 +190,4 @@ class TabContentsDelegate : public PageNavigator {
}
};
-#endif // CHROME_BROWSER_TAB_CONTENTS_DELEGATE_H__
+#endif // CHROME_BROWSER_TAB_CONTENTS_DELEGATE_H_
diff --git a/chrome/browser/tabs/dragged_tab_controller.cc b/chrome/browser/tabs/dragged_tab_controller.cc
index c522276..6a17a459 100644
--- a/chrome/browser/tabs/dragged_tab_controller.cc
+++ b/chrome/browser/tabs/dragged_tab_controller.cc
@@ -27,10 +27,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include <math.h>
-
#include "chrome/browser/tabs/dragged_tab_controller.h"
+#include <math.h>
+
#include "chrome/browser/browser_window.h"
#include "chrome/browser/frame_util.h"
#include "chrome/browser/tab_contents.h"
@@ -40,6 +40,7 @@
#include "chrome/browser/tabs/tab_strip.h"
#include "chrome/browser/web_contents.h"
#include "chrome/views/event.h"
+#include "chrome/views/root_view.h"
#include "skia/include/SkBitmap.h"
static const int kHorizontalMoveThreshold = 16; // pixels
diff --git a/chrome/browser/tabs/dragged_tab_controller.h b/chrome/browser/tabs/dragged_tab_controller.h
index 690baf9..d3352c5 100644
--- a/chrome/browser/tabs/dragged_tab_controller.h
+++ b/chrome/browser/tabs/dragged_tab_controller.h
@@ -27,11 +27,11 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef CHROME_BROWSER_TABS_DRAGGED_TAB_CONTROLLER_H__
-#define CHROME_BROWSER_TABS_DRAGGED_TAB_CONTROLLER_H__
+#ifndef CHROME_BROWSER_TABS_DRAGGED_TAB_CONTROLLER_H_
+#define CHROME_BROWSER_TABS_DRAGGED_TAB_CONTROLLER_H_
-#include "base/gfx/point.h"
#include "base/gfx/rect.h"
+#include "base/message_loop.h"
#include "chrome/browser/tab_contents_delegate.h"
#include "chrome/browser/tabs/tab_renderer.h"
#include "chrome/common/notification_service.h"
@@ -303,7 +303,7 @@ class DraggedTabController : public TabContentsDelegate,
// time of the last re-order event.
int last_move_screen_x_;
- DISALLOW_EVIL_CONSTRUCTORS(DraggedTabController);
+ DISALLOW_COPY_AND_ASSIGN(DraggedTabController);
};
-#endif // CHROME_BROWSER_TABS_DRAGGED_TAB_CONTROLLER_H__
+#endif // CHROME_BROWSER_TABS_DRAGGED_TAB_CONTROLLER_H_
diff --git a/chrome/browser/tabs/tab.cc b/chrome/browser/tabs/tab.cc
index f253faa..3dd5427 100644
--- a/chrome/browser/tabs/tab.cc
+++ b/chrome/browser/tabs/tab.cc
@@ -30,11 +30,7 @@
#include "chrome/browser/tabs/tab.h"
#include "base/gfx/size.h"
-#include "chrome/browser/tab_contents.h"
-#include "chrome/browser/tabs/tab_strip.h"
-#include "chrome/browser/profile.h"
-#include "chrome/browser/user_metrics.h"
-#include "chrome/common/l10n_util.h"
+#include "chrome/views/view_container.h"
#include "chrome/common/resource_bundle.h"
#include "chrome/views/chrome_menu.h"
#include "chrome/views/tooltip_manager.h"
diff --git a/chrome/browser/tabs/tab.h b/chrome/browser/tabs/tab.h
index 8c78190..5b909cb 100644
--- a/chrome/browser/tabs/tab.h
+++ b/chrome/browser/tabs/tab.h
@@ -27,14 +27,12 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef CHROME_BROWSER_TABS_TAB_H__
-#define CHROME_BROWSER_TABS_TAB_H__
+#ifndef CHROME_BROWSER_TABS_TAB_H_
+#define CHROME_BROWSER_TABS_TAB_H_
-#include "base/gfx/point.h"
#include "chrome/browser/tabs/tab_renderer.h"
#include "chrome/browser/tabs/tab_strip_model.h"
-#include "chrome/views/button.h"
-#include "chrome/views/menu.h"
+#include "chrome/views/base_button.h"
namespace gfx {
class Point;
@@ -138,7 +136,7 @@ class Tab : public TabRenderer,
// True if the tab is being animated closed.
bool closing_;
- DISALLOW_EVIL_CONSTRUCTORS(Tab);
+ DISALLOW_COPY_AND_ASSIGN(Tab);
};
-#endif // CHROME_BROWSER_TABS_TAB_H__
+#endif // CHROME_BROWSER_TABS_TAB_H_
diff --git a/chrome/browser/tabs/tab_strip.cc b/chrome/browser/tabs/tab_strip.cc
index f4b1447..1a757fa 100644
--- a/chrome/browser/tabs/tab_strip.cc
+++ b/chrome/browser/tabs/tab_strip.cc
@@ -40,6 +40,7 @@
#include "chrome/browser/view_ids.h"
#include "chrome/browser/vista_frame.h"
#include "chrome/browser/web_contents.h"
+#include "chrome/common/drag_drop_types.h"
#include "chrome/common/gfx/chrome_canvas.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/os_exchange_data.h"
diff --git a/chrome/browser/task_manager.cc b/chrome/browser/task_manager.cc
index 17cddba..95a8798 100644
--- a/chrome/browser/task_manager.cc
+++ b/chrome/browser/task_manager.cc
@@ -45,6 +45,7 @@
#include "chrome/views/accelerator.h"
#include "chrome/views/background.h"
#include "chrome/views/link.h"
+#include "chrome/views/menu.h"
#include "chrome/views/native_button.h"
#include "chrome/views/window.h"
#include "net/url_request/url_request.h"
diff --git a/chrome/browser/toolbar_model.cc b/chrome/browser/toolbar_model.cc
index 6321555..2e2b1be 100644
--- a/chrome/browser/toolbar_model.cc
+++ b/chrome/browser/toolbar_model.cc
@@ -35,6 +35,7 @@
#include "chrome/browser/ssl_error_info.h"
#include "chrome/browser/tab_contents.h"
#include "chrome/common/gfx/url_elider.h"
+#include "chrome/common/l10n_util.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
#include "net/base/net_util.h"
diff --git a/chrome/browser/views/SConscript b/chrome/browser/views/SConscript
index f494e9b..350b3e0 100644
--- a/chrome/browser/views/SConscript
+++ b/chrome/browser/views/SConscript
@@ -85,6 +85,7 @@ input_files = [
'constrained_window_animation.cc',
'constrained_window_impl.cc',
'delay_view.cc',
+ 'dom_view.cc',
'download_item_view.cc',
'download_shelf_view.cc',
'download_started_animation.cc',
diff --git a/chrome/browser/views/about_chrome_view.cc b/chrome/browser/views/about_chrome_view.cc
index e7084cd..c7128e3 100644
--- a/chrome/browser/views/about_chrome_view.cc
+++ b/chrome/browser/views/about_chrome_view.cc
@@ -40,6 +40,7 @@
#include "chrome/browser/standard_layout.h"
#include "chrome/browser/user_metrics.h"
#include "chrome/browser/views/restart_message_box.h"
+#include "chrome/common/l10n_util.h"
#include "chrome/common/resource_bundle.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/installer/util/install_util.h"
diff --git a/chrome/browser/views/bookmark_bar_view.cc b/chrome/browser/views/bookmark_bar_view.cc
index d249d38..3ece239 100644
--- a/chrome/browser/views/bookmark_bar_view.cc
+++ b/chrome/browser/views/bookmark_bar_view.cc
@@ -27,10 +27,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include <limits>
-
#include "chrome/browser/views/bookmark_bar_view.h"
+#include <limits>
+
#include "base/base_drag_source.h"
#include "base/gfx/skia_utils.h"
#include "chrome/app/theme/theme_resources.h"
@@ -46,6 +46,7 @@
#include "chrome/browser/history/history.h"
#include "chrome/browser/page_navigator.h"
#include "chrome/browser/profile.h"
+#include "chrome/browser/tab_contents.h"
#include "chrome/browser/user_metrics.h"
#include "chrome/browser/view_ids.h"
#include "chrome/browser/views/bookmark_editor_view.h"
@@ -66,6 +67,8 @@
#include "chrome/views/chrome_menu.h"
#include "chrome/views/menu_button.h"
#include "chrome/views/tooltip_manager.h"
+#include "chrome/views/view_container.h"
+#include "chrome/views/window.h"
#include "generated_resources.h"
using ChromeViews::BaseButton;
diff --git a/chrome/browser/views/bookmark_bar_view_test.cc b/chrome/browser/views/bookmark_bar_view_test.cc
index a2a84e7..b2f43c0 100644
--- a/chrome/browser/views/bookmark_bar_view_test.cc
+++ b/chrome/browser/views/bookmark_bar_view_test.cc
@@ -39,6 +39,7 @@
#include "chrome/test/ui/view_event_test_base.h"
#include "chrome/views/chrome_menu.h"
#include "chrome/views/text_button.h"
+#include "chrome/views/window.h"
namespace {
diff --git a/chrome/browser/views/browser_views.vcproj b/chrome/browser/views/browser_views.vcproj
index b63141e..1ff0c1d2 100644
--- a/chrome/browser/views/browser_views.vcproj
+++ b/chrome/browser/views/browser_views.vcproj
@@ -402,6 +402,10 @@
>
</File>
<File
+ RelativePath=".\dom_view.cc"
+ >
+ </File>
+ <File
RelativePath=".\dom_view.h"
>
</File>
diff --git a/chrome/browser/views/constrained_window_impl.cc b/chrome/browser/views/constrained_window_impl.cc
index f12a41a..7524debc 100644
--- a/chrome/browser/views/constrained_window_impl.cc
+++ b/chrome/browser/views/constrained_window_impl.cc
@@ -29,6 +29,7 @@
#include "chrome/browser/views/constrained_window_impl.h"
+#include "base/gfx/rect.h"
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/app/theme/theme_resources.h"
#include "chrome/browser/tab_contents.h"
@@ -49,6 +50,7 @@
#include "chrome/common/pref_service.h"
#include "chrome/common/resource_bundle.h"
#include "chrome/common/win_util.h"
+#include "chrome/views/client_view.h"
#include "chrome/views/button.h"
#include "chrome/views/focus_manager.h"
#include "chrome/views/hwnd_view.h"
diff --git a/chrome/browser/views/constrained_window_impl.h b/chrome/browser/views/constrained_window_impl.h
index 7ccd067..5a37e10 100644
--- a/chrome/browser/views/constrained_window_impl.h
+++ b/chrome/browser/views/constrained_window_impl.h
@@ -27,9 +27,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef CHROME_BROWSER_CONSTRAINED_WINDOW_IMPL_H__
-#define CHROME_BROWSER_CONSTRAINED_WINDOW_IMPL_H__
+#ifndef CHROME_BROWSER_CONSTRAINED_WINDOW_IMPL_H_
+#define CHROME_BROWSER_CONSTRAINED_WINDOW_IMPL_H_
+#include "base/gfx/rect.h"
#include "chrome/browser/constrained_window.h"
#include "chrome/browser/tab_contents_delegate.h"
#include "chrome/views/custom_frame_window.h"
@@ -221,7 +222,7 @@ class ConstrainedWindowImpl : public ConstrainedWindow,
// Current display rectangle (relative to owner_'s visible area).
gfx::Rect current_bounds_;
- DISALLOW_EVIL_CONSTRUCTORS(ConstrainedWindowImpl);
+ DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowImpl);
};
-#endif // #ifndef CHROME_BROWSER_CONSTRAINED_WINDOW_IMPL_H__
+#endif // #ifndef CHROME_BROWSER_CONSTRAINED_WINDOW_IMPL_H_
diff --git a/chrome/browser/views/dom_view.cc b/chrome/browser/views/dom_view.cc
new file mode 100644
index 0000000..d0473a9
--- /dev/null
+++ b/chrome/browser/views/dom_view.cc
@@ -0,0 +1,64 @@
+// Copyright 2008, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "chrome/browser/views/dom_view.h"
+
+#include "chrome/browser/dom_ui/dom_ui_host.h"
+
+DOMView::DOMView(const GURL& contents)
+ : contents_(contents), initialized_(false), host_(NULL) {
+}
+
+DOMView::~DOMView() {
+ if (host_) {
+ Detach();
+ host_->Destroy();
+ host_ = NULL;
+ }
+}
+
+bool DOMView::Init(Profile* profile, SiteInstance* instance) {
+ if (initialized_)
+ return true;
+ initialized_ = true;
+
+ // TODO(timsteele): This should use a separate factory method; e.g
+ // a DOMUIHostFactory rather than TabContentsFactory, because DOMView's
+ // should only be associated with instances of DOMUIHost.
+ TabContentsType type = TabContents::TypeForURL(&contents_);
+ TabContents* tab_contents = TabContents::CreateWithType(type,
+ GetViewContainer()->GetHWND(), profile, instance);
+ host_ = tab_contents->AsDOMUIHost();
+ DCHECK(host_);
+
+ ChromeViews::HWNDView::Attach(host_->GetContainerHWND());
+ host_->SetupController(profile);
+ host_->controller()->LoadURL(contents_, PageTransition::START_PAGE);
+ return true;
+}
diff --git a/chrome/browser/views/dom_view.h b/chrome/browser/views/dom_view.h
index 07a5f71..d55914d 100644
--- a/chrome/browser/views/dom_view.h
+++ b/chrome/browser/views/dom_view.h
@@ -30,53 +30,27 @@
// DOMView is a ChromeView that displays the content of a web DOM.
// It should be used with data: URLs.
-#ifndef CHROME_BROWSER_VIEWS_DOM_VIEW_H__
-#define CHROME_BROWSER_VIEWS_DOM_VIEW_H__
+#ifndef CHROME_BROWSER_VIEWS_DOM_VIEW_H_
+#define CHROME_BROWSER_VIEWS_DOM_VIEW_H_
-#include "base/basictypes.h"
-#include "base/scoped_ptr.h"
-#include "base/string_util.h"
-#include "chrome/browser/render_process_host.h"
-#include "chrome/browser/dom_ui/dom_ui_host.h"
#include "chrome/views/hwnd_view.h"
+#include "googleurl/src/gurl.h"
+
+class DOMUIHost;
+class Profile;
+class SiteInstance;
class DOMView : public ChromeViews::HWNDView {
public:
// Construct a DOMView to display the given data: URL.
- explicit DOMView(const GURL& contents)
- : contents_(contents), initialized_(false), host_(NULL) {}
-
- virtual ~DOMView() {
- if (host_) {
- Detach();
- host_->Destroy();
- host_ = NULL;
- }
- }
+ explicit DOMView(const GURL& contents);
+ virtual ~DOMView();
// Initialize the view, causing it to load its contents. This should be
// called once the view has been added to a container.
// If |instance| is not null, then the view will be loaded in the same
// process as the given instance.
- bool Init(Profile* profile, SiteInstance* instance) {
- if (initialized_)
- return true;
- initialized_ = true;
-
- // TODO(timsteele): This should use a separate factory method; e.g
- // a DOMUIHostFactory rather than TabContentsFactory, because DOMView's
- // should only be associated with instances of DOMUIHost.
- TabContentsType type = TabContents::TypeForURL(&contents_);
- TabContents* tab_contents = TabContents::CreateWithType(type,
- GetViewContainer()->GetHWND(), profile, instance);
- host_ = tab_contents->AsDOMUIHost();
- DCHECK(host_);
-
- ChromeViews::HWNDView::Attach(host_->GetContainerHWND());
- host_->SetupController(profile);
- host_->controller()->LoadURL(contents_, PageTransition::START_PAGE);
- return true;
- }
+ bool Init(Profile* profile, SiteInstance* instance);
protected:
DOMUIHost* host_;
@@ -85,8 +59,7 @@ class DOMView : public ChromeViews::HWNDView {
GURL contents_;
bool initialized_;
- DISALLOW_EVIL_CONSTRUCTORS(DOMView);
+ DISALLOW_COPY_AND_ASSIGN(DOMView);
};
-#endif // CHROME_BROWSER_VIEWS_DOM_VIEW_H__
-
+#endif // CHROME_BROWSER_VIEWS_DOM_VIEW_H_
diff --git a/chrome/browser/views/download_item_view.cc b/chrome/browser/views/download_item_view.cc
index 4cd218d..b9612b1 100644
--- a/chrome/browser/views/download_item_view.cc
+++ b/chrome/browser/views/download_item_view.cc
@@ -27,23 +27,20 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include <vector>
-
#include "chrome/browser/views/download_item_view.h"
-#include "base/message_loop.h"
-#include "base/task.h"
-#include "base/timer.h"
+#include <vector>
+
#include "chrome/app/theme/theme_resources.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/download_util.h"
#include "chrome/browser/views/download_shelf_view.h"
#include "chrome/common/gfx/chrome_canvas.h"
-#include "chrome/common/l10n_util.h"
#include "chrome/common/resource_bundle.h"
#include "chrome/common/win_util.h"
#include "chrome/views/root_view.h"
#include "chrome/views/view_container.h"
+
#include "generated_resources.h"
// TODO(paulg): These may need to be adjusted when download progress
@@ -466,7 +463,7 @@ bool DownloadItemView::OnMousePressed(const ChromeViews::MouseEvent& event) {
complete_animation_->End();
if (event.IsOnlyLeftMouseButton()) {
- CPoint point(event.GetLocation());
+ WTL::CPoint point(event.GetX(), event.GetY());
if (event.GetX() < drop_down_x_) {
SetState(PUSHED, NORMAL);
return true;
@@ -530,7 +527,6 @@ void DownloadItemView::OnMouseReleased(const ChromeViews::MouseEvent& event,
starting_drag_ = false;
return;
}
- CPoint point(event.GetLocation());
if (event.IsOnlyLeftMouseButton() && event.GetX() < drop_down_x_)
OpenDownload();
diff --git a/chrome/browser/views/first_run_bubble.cc b/chrome/browser/views/first_run_bubble.cc
index f17071c..b880abf 100644
--- a/chrome/browser/views/first_run_bubble.cc
+++ b/chrome/browser/views/first_run_bubble.cc
@@ -41,6 +41,7 @@
#include "chrome/views/event.h"
#include "chrome/views/label.h"
#include "chrome/views/native_button.h"
+#include "chrome/views/window.h"
#include "generated_resources.h"
diff --git a/chrome/browser/views/frame/browser_view2.cc b/chrome/browser/views/frame/browser_view2.cc
index 40d5a50..5db1c58 100644
--- a/chrome/browser/views/frame/browser_view2.cc
+++ b/chrome/browser/views/frame/browser_view2.cc
@@ -29,6 +29,7 @@
#include "chrome/browser/views/frame/browser_view2.h"
+#include "chrome/app/chrome_dll_resource.h"
#include "chrome/app/theme/theme_resources.h"
#include "chrome/browser/app_modal_dialog_queue.h"
#include "chrome/browser/browser.h"
@@ -41,10 +42,13 @@
#include "chrome/browser/views/frame/browser_frame.h"
#include "chrome/browser/views/status_bubble.h"
#include "chrome/browser/views/toolbar_view.h"
+#include "chrome/common/drag_drop_types.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/os_exchange_data.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/resource_bundle.h"
+#include "chrome/views/view.h"
+#include "chrome/views/window.h"
#include "generated_resources.h"
// static
diff --git a/chrome/browser/views/html_dialog_view.cc b/chrome/browser/views/html_dialog_view.cc
index cdf48e8..890d5a4 100644
--- a/chrome/browser/views/html_dialog_view.cc
+++ b/chrome/browser/views/html_dialog_view.cc
@@ -27,9 +27,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "chrome/browser/browser.h"
#include "chrome/browser/views/html_dialog_view.h"
+#include "chrome/browser/browser.h"
+#include "chrome/views/root_view.h"
#include "chrome/views/window.h"
////////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/browser/views/hung_renderer_view.cc b/chrome/browser/views/hung_renderer_view.cc
index b121b00..80f8b03 100644
--- a/chrome/browser/views/hung_renderer_view.cc
+++ b/chrome/browser/views/hung_renderer_view.cc
@@ -34,7 +34,7 @@
#include "chrome/browser/browser_list.h"
#include "chrome/browser/render_view_host.h"
#include "chrome/browser/standard_layout.h"
-#include "chrome/browser/tab_contents.h"
+#include "chrome/browser/web_contents.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/gfx/chrome_canvas.h"
#include "chrome/common/gfx/path.h"
diff --git a/chrome/browser/views/info_bar_item_view.cc b/chrome/browser/views/info_bar_item_view.cc
index 99740f7..6fc6242 100644
--- a/chrome/browser/views/info_bar_item_view.cc
+++ b/chrome/browser/views/info_bar_item_view.cc
@@ -35,6 +35,7 @@
#include "chrome/views/external_focus_tracker.h"
#include "chrome/views/image_view.h"
#include "chrome/views/root_view.h"
+#include "chrome/views/view_container.h"
#include "generated_resources.h"
diff --git a/chrome/browser/views/info_bubble.cc b/chrome/browser/views/info_bubble.cc
index a9671f6..b087451b 100644
--- a/chrome/browser/views/info_bubble.cc
+++ b/chrome/browser/views/info_bubble.cc
@@ -37,7 +37,7 @@
#include "chrome/common/gfx/path.h"
#include "chrome/common/resource_bundle.h"
#include "chrome/common/win_util.h"
-#include "chrome/views/focus_manager.h"
+#include "chrome/views/root_view.h"
using ChromeViews::View;
diff --git a/chrome/browser/views/info_bubble.h b/chrome/browser/views/info_bubble.h
index adb46c7..1fa01d9 100644
--- a/chrome/browser/views/info_bubble.h
+++ b/chrome/browser/views/info_bubble.h
@@ -27,11 +27,12 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef CHROME_BROWSER_VIEWS_INFO_BUBBLE_H__
-#define CHROME_BROWSER_VIEWS_INFO_BUBBLE_H__
+#ifndef CHROME_BROWSER_VIEWS_INFO_BUBBLE_H_
+#define CHROME_BROWSER_VIEWS_INFO_BUBBLE_H_
#include "chrome/common/slide_animation.h"
#include "chrome/views/hwnd_view_container.h"
+#include "chrome/views/view.h"
// InfoBubble is used to display an arbitrary view above all other windows.
// Think of InfoBubble as a tooltip that allows you to embed an arbitrary view
@@ -167,7 +168,7 @@ class InfoBubble : public ChromeViews::HWNDViewContainer,
// The bubble we're in.
InfoBubble* host_;
- DISALLOW_EVIL_CONSTRUCTORS(ContentView);
+ DISALLOW_COPY_AND_ASSIGN(ContentView);
};
// Creates and return a new ContentView containing content.
@@ -186,7 +187,7 @@ class InfoBubble : public ChromeViews::HWNDViewContainer,
// The fade-in animation.
scoped_ptr<SlideAnimation> fade_animation_;
- DISALLOW_EVIL_CONSTRUCTORS(InfoBubble);
+ DISALLOW_COPY_AND_ASSIGN(InfoBubble);
};
-#endif // CHROME_BROWSER_VIEWS_INFO_BUBBLE_H__
+#endif // CHROME_BROWSER_VIEWS_INFO_BUBBLE_H_
diff --git a/chrome/browser/views/location_bar_view.cc b/chrome/browser/views/location_bar_view.cc
index ad2a7b5..f354ef4 100644
--- a/chrome/browser/views/location_bar_view.cc
+++ b/chrome/browser/views/location_bar_view.cc
@@ -52,6 +52,7 @@
#include "chrome/common/win_util.h"
#include "chrome/views/background.h"
#include "chrome/views/border.h"
+#include "chrome/views/root_view.h"
#include "chrome/views/view_container.h"
#include "googleurl/src/gurl.h"
#include "googleurl/src/url_canon.h"
@@ -603,7 +604,7 @@ void LocationBarView::OnMouseEvent(const ChromeViews::MouseEvent& event,
if (event.IsRightMouseButton())
flags |= MK_RBUTTON;
- CPoint screen_point(event.GetLocation());
+ CPoint screen_point(event.GetX(), event.GetY());
ConvertPointToScreen(this, &screen_point);
location_entry_->HandleExternalMsg(msg, flags, screen_point);
diff --git a/chrome/browser/views/options/general_page_view.cc b/chrome/browser/views/options/general_page_view.cc
index 2902ff1..58991e9 100644
--- a/chrome/browser/views/options/general_page_view.cc
+++ b/chrome/browser/views/options/general_page_view.cc
@@ -51,6 +51,7 @@
#include "chrome/common/chrome_constants.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/pref_names.h"
+#include "chrome/common/pref_service.h"
#include "chrome/common/resource_bundle.h"
#include "chrome/views/checkbox.h"
#include "chrome/views/grid_layout.h"
diff --git a/chrome/browser/views/options/language_combobox_model.cc b/chrome/browser/views/options/language_combobox_model.cc
index 29a6659..a2da0c3 100644
--- a/chrome/browser/views/options/language_combobox_model.cc
+++ b/chrome/browser/views/options/language_combobox_model.cc
@@ -32,6 +32,7 @@
#include "base/string_util.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/user_metrics.h"
+#include "chrome/common/l10n_util.h"
#include "chrome/common/pref_service.h"
#include "unicode/uloc.h"
diff --git a/chrome/browser/views/options/options_page_view.cc b/chrome/browser/views/options/options_page_view.cc
index b659249..93ed694 100644
--- a/chrome/browser/views/options/options_page_view.cc
+++ b/chrome/browser/views/options/options_page_view.cc
@@ -28,9 +28,11 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "chrome/browser/views/options/options_page_view.h"
+
#include "chrome/browser/browser_process.h"
#include "chrome/browser/user_metrics.h"
#include "chrome/common/pref_service.h"
+#include "chrome/views/view_container.h"
///////////////////////////////////////////////////////////////////////////////
// OptionsPageView
diff --git a/chrome/browser/views/options/options_window_view.cc b/chrome/browser/views/options/options_window_view.cc
index 5b29fdb..904e54e 100644
--- a/chrome/browser/views/options/options_window_view.cc
+++ b/chrome/browser/views/options/options_window_view.cc
@@ -42,6 +42,7 @@
#include "chrome/common/resource_bundle.h"
#include "chrome/views/dialog_delegate.h"
#include "chrome/views/tabbed_pane.h"
+#include "chrome/views/root_view.h"
#include "chrome/views/window.h"
#include "generated_resources.h"
diff --git a/chrome/browser/views/restart_message_box.cc b/chrome/browser/views/restart_message_box.cc
index d3f52cd..757ad52 100644
--- a/chrome/browser/views/restart_message_box.cc
+++ b/chrome/browser/views/restart_message_box.cc
@@ -29,6 +29,7 @@
#include "chrome/browser/views/restart_message_box.h"
+#include "chrome/common/l10n_util.h"
#include "chrome/views/message_box_view.h"
#include "chrome/views/window.h"
diff --git a/chrome/browser/views/star_toggle.cc b/chrome/browser/views/star_toggle.cc
index e480c40..4387998 100644
--- a/chrome/browser/views/star_toggle.cc
+++ b/chrome/browser/views/star_toggle.cc
@@ -75,7 +75,7 @@ bool StarToggle::OnMouseDragged(const ChromeViews::MouseEvent& e) {
}
bool StarToggle::OnMousePressed(const ChromeViews::MouseEvent& e) {
- if (e.IsLeftMouseButton() && HitTest(e.GetLocation())) {
+ if (e.IsLeftMouseButton() && HitTest(WTL::CPoint(e.GetX(), e.GetY()))) {
RequestFocus();
return true;
}
@@ -84,7 +84,7 @@ bool StarToggle::OnMousePressed(const ChromeViews::MouseEvent& e) {
void StarToggle::OnMouseReleased(const ChromeViews::MouseEvent& e,
bool canceled) {
- if (e.IsLeftMouseButton() && HitTest(e.GetLocation()))
+ if (e.IsLeftMouseButton() && HitTest(WTL::CPoint(e.GetX(), e.GetY())))
SwitchState();
}
diff --git a/chrome/browser/views/status_bubble.cc b/chrome/browser/views/status_bubble.cc
index 04b44f3..a9e76a7 100644
--- a/chrome/browser/views/status_bubble.cc
+++ b/chrome/browser/views/status_bubble.cc
@@ -41,6 +41,7 @@
#include "chrome/common/resource_bundle.h"
#include "chrome/views/hwnd_view_container.h"
#include "chrome/views/label.h"
+#include "chrome/views/root_view.h"
#include "chrome/views/view_container.h"
#include "googleurl/src/gurl.h"
#include "net/base/net_util.h"
diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc
index 476318d..c9cbc43 100644
--- a/chrome/browser/views/toolbar_view.cc
+++ b/chrome/browser/views/toolbar_view.cc
@@ -50,10 +50,12 @@
#include "chrome/browser/views/toolbar_star_toggle.h"
#include "chrome/browser/view_ids.h"
#include "chrome/common/chrome_constants.h"
+#include "chrome/common/drag_drop_types.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/os_exchange_data.h"
#include "chrome/common/pref_names.h"
+#include "chrome/common/pref_service.h"
#include "chrome/common/resource_bundle.h"
#include "chrome/views/button_dropdown.h"
#include "chrome/views/hwnd_view.h"
diff --git a/chrome/browser/web_app_launcher.cc b/chrome/browser/web_app_launcher.cc
index 08aa02a..51394d4 100644
--- a/chrome/browser/web_app_launcher.cc
+++ b/chrome/browser/web_app_launcher.cc
@@ -32,6 +32,7 @@
#include "base/string_util.h"
#include "chrome/browser/browser.h"
#include "chrome/browser/profile.h"
+#include "chrome/browser/web_app.h"
// static
void WebAppLauncher::Launch(Profile* profile,
diff --git a/chrome/browser/web_contents.cc b/chrome/browser/web_contents.cc
index 3732714..32b1ecd 100644
--- a/chrome/browser/web_contents.cc
+++ b/chrome/browser/web_contents.cc
@@ -68,6 +68,7 @@
#include "chrome/common/gfx/chrome_canvas.h"
#include "chrome/common/os_exchange_data.h"
#include "chrome/common/pref_names.h"
+#include "chrome/common/pref_service.h"
#include "chrome/common/resource_bundle.h"
#include "net/base/mime_util.h"
#include "net/base/registry_controlled_domain.h"
diff --git a/chrome/browser/web_contents.h b/chrome/browser/web_contents.h
index 0ece47b..b61eb70 100644
--- a/chrome/browser/web_contents.h
+++ b/chrome/browser/web_contents.h
@@ -27,13 +27,11 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef CHROME_BROWSER_WEB_CONTENTS_H__
-#define CHROME_BROWSER_WEB_CONTENTS_H__
+#ifndef CHROME_BROWSER_WEB_CONTENTS_H_
+#define CHROME_BROWSER_WEB_CONTENTS_H_
#include <hash_map>
-#include "base/scoped_handle.h"
-#include "chrome/common/win_util.h"
#include "chrome/browser/fav_icon_helper.h"
#include "chrome/browser/printing/print_view_manager.h"
#include "chrome/browser/render_view_host_delegate.h"
@@ -152,7 +150,7 @@ class WebContents : public TabContents,
void SetDownloadShelfVisible(bool visible);
// Returns the SavePackage which manages the page saving job.
- inline SavePackage* get_save_package() const { return save_package_.get(); }
+ SavePackage* get_save_package() const { return save_package_.get(); }
// Whether or not the info bar is visible. This delegates to
// the ChromeFrame method InfoBarVisibilityChanged.
@@ -822,8 +820,7 @@ class WebContents : public TabContents,
// Non-null if we're displaying content for a web app.
scoped_refptr<WebApp> web_app_;
-
- DISALLOW_EVIL_CONSTRUCTORS(WebContents);
+ DISALLOW_COPY_AND_ASSIGN(WebContents);
};
-#endif // CHROME_BROWSER_WEB_CONTENTS_H__
+#endif // CHROME_BROWSER_WEB_CONTENTS_H_
diff --git a/chrome/browser/wizard/wizard.cc b/chrome/browser/wizard/wizard.cc
index cce4f4a..0514bf4 100644
--- a/chrome/browser/wizard/wizard.cc
+++ b/chrome/browser/wizard/wizard.cc
@@ -31,6 +31,7 @@
#include <math.h>
+#include "base/logging.h"
#include "chrome/browser/wizard/wizard_step.h"
#include "chrome/browser/standard_layout.h"
diff --git a/chrome/common/SConscript b/chrome/common/SConscript
index 6543cfe..7f17c97 100644
--- a/chrome/common/SConscript
+++ b/chrome/common/SConscript
@@ -110,6 +110,7 @@ input_files = [
'notification_service.cc',
'os_exchange_data.cc',
'plugin_messages.cc',
+ 'pref_member.cc',
'pref_names.cc',
'pref_service.cc',
'process_watcher.cc',
diff --git a/chrome/common/chrome_plugin_lib.cc b/chrome/common/chrome_plugin_lib.cc
index f1d85eb..cd4e08c 100644
--- a/chrome/common/chrome_plugin_lib.cc
+++ b/chrome/common/chrome_plugin_lib.cc
@@ -185,6 +185,12 @@ void ChromePluginLib::UnloadAllPlugins() {
}
}
+const CPPluginFuncs& ChromePluginLib::functions() const {
+ DCHECK(initialized_);
+ DCHECK(IsPluginThread());
+ return plugin_funcs_;
+}
+
ChromePluginLib::ChromePluginLib(const std::wstring& filename)
: filename_(filename),
module_(0),
diff --git a/chrome/common/chrome_plugin_lib.h b/chrome/common/chrome_plugin_lib.h
index 287eb1e..b52c63f 100644
--- a/chrome/common/chrome_plugin_lib.h
+++ b/chrome/common/chrome_plugin_lib.h
@@ -27,8 +27,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef CHROME_COMMON_CHROME_PLUGIN_LIB_H__
-#define CHROME_COMMON_CHROME_PLUGIN_LIB_H__
+#ifndef CHROME_COMMON_CHROME_PLUGIN_LIB_H_
+#define CHROME_COMMON_CHROME_PLUGIN_LIB_H_
#include <hash_map>
#include <string>
@@ -68,11 +68,7 @@ class ChromePluginLib : public base::RefCounted<ChromePluginLib> {
const bool is_loaded() const { return initialized_; }
// Get the Plugin's function pointer table.
- const CPPluginFuncs& functions() const {
- DCHECK(initialized_);
- DCHECK(IsPluginThread());
- return plugin_funcs_;
- }
+ const CPPluginFuncs& functions() const;
CPID cpid() { return reinterpret_cast<CPID>(this); }
@@ -121,7 +117,7 @@ class ChromePluginLib : public base::RefCounted<ChromePluginLib> {
typedef int (STDCALL *CP_TestFunc)(void*);
CP_TestFunc CP_Test_;
- DISALLOW_EVIL_CONSTRUCTORS(ChromePluginLib);
+ DISALLOW_COPY_AND_ASSIGN(ChromePluginLib);
};
-#endif // CHROME_COMMON_CHROME_PLUGIN_LIB_H__
+#endif // CHROME_COMMON_CHROME_PLUGIN_LIB_H_
diff --git a/chrome/common/common.vcproj b/chrome/common/common.vcproj
index 5c31f33..3cd2809 100644
--- a/chrome/common/common.vcproj
+++ b/chrome/common/common.vcproj
@@ -554,6 +554,10 @@
>
</File>
<File
+ RelativePath=".\pref_member.cc"
+ >
+ </File>
+ <File
RelativePath=".\pref_member.h"
>
</File>
diff --git a/chrome/common/drag_drop_types.cc b/chrome/common/drag_drop_types.cc
index 0b83cdf..b3df154 100644
--- a/chrome/common/drag_drop_types.cc
+++ b/chrome/common/drag_drop_types.cc
@@ -32,7 +32,7 @@
#include <oleidl.h>
int DragDropTypes::DropEffectToDragOperation(
- DWORD effect) {
+ uint32 effect) {
int drag_operation = DRAG_NONE;
if (effect & DROPEFFECT_LINK)
drag_operation |= DRAG_LINK;
@@ -43,8 +43,8 @@ int DragDropTypes::DropEffectToDragOperation(
return drag_operation;
}
-DWORD DragDropTypes::DragOperationToDropEffect(int drag_operation) {
- DWORD drop_effect = DROPEFFECT_NONE;
+uint32 DragDropTypes::DragOperationToDropEffect(int drag_operation) {
+ uint32 drop_effect = DROPEFFECT_NONE;
if (drag_operation & DRAG_LINK)
drop_effect |= DROPEFFECT_LINK;
if (drag_operation & DRAG_COPY)
diff --git a/chrome/common/drag_drop_types.h b/chrome/common/drag_drop_types.h
index f3a7a6e..1b58f07 100644
--- a/chrome/common/drag_drop_types.h
+++ b/chrome/common/drag_drop_types.h
@@ -27,10 +27,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef CHROME_COMMON_DRAG_DROP_TYPES_H__
-#define CHROME_COMMON_DRAG_DROP_TYPES_H__
+#ifndef CHROME_COMMON_DRAG_DROP_TYPES_H_
+#define CHROME_COMMON_DRAG_DROP_TYPES_H_
-#include <windows.h>
+#include "base/basictypes.h"
class DragDropTypes {
public:
@@ -41,8 +41,8 @@ class DragDropTypes {
DRAG_LINK = 1 << 2
};
- static DWORD DragOperationToDropEffect(int drag_operation);
- static int DropEffectToDragOperation(DWORD effect);
+ static uint32 DragOperationToDropEffect(int drag_operation);
+ static int DropEffectToDragOperation(uint32 effect);
};
-#endif
+#endif // CHROME_COMMON_DRAG_DROP_TYPES_H_
diff --git a/chrome/common/gfx/chrome_font.cc b/chrome/common/gfx/chrome_font.cc
index 198227e..670eeb2 100644
--- a/chrome/common/gfx/chrome_font.cc
+++ b/chrome/common/gfx/chrome_font.cc
@@ -26,11 +26,14 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
#include "chrome/common/gfx/chrome_font.h"
-#include <algorithm>
+#include <windows.h>
#include <math.h>
+#include <algorithm>
+
#include "base/logging.h"
#include "base/win_util.h"
#include "chrome/app/locales/locale_settings.h"
@@ -105,6 +108,26 @@ int ChromeFont::FontSize() {
return font_size;
}
+ChromeFont::HFontRef::HFontRef(HFONT hfont,
+ int height,
+ int baseline,
+ int ave_char_width,
+ int style,
+ int dlu_base_x)
+ : hfont_(hfont),
+ height_(height),
+ baseline_(baseline),
+ ave_char_width_(ave_char_width),
+ style_(style),
+ dlu_base_x_(dlu_base_x) {
+ DLOG_ASSERT(hfont);
+}
+
+ChromeFont::HFontRef::~HFontRef() {
+ DeleteObject(hfont_);
+}
+
+
ChromeFont ChromeFont::DeriveFont(int size_delta, int style) const {
LOGFONT font_info;
GetObject(hfont(), sizeof(LOGFONT), &font_info);
diff --git a/chrome/common/gfx/chrome_font.h b/chrome/common/gfx/chrome_font.h
index ad0fd8d..e831b6d 100644
--- a/chrome/common/gfx/chrome_font.h
+++ b/chrome/common/gfx/chrome_font.h
@@ -27,12 +27,17 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef CHROME_COMMON_GFX_CHROME_FONT_H__
-#define CHROME_COMMON_GFX_CHROME_FONT_H__
+#ifndef CHROME_COMMON_GFX_CHROME_FONT_H_
+#define CHROME_COMMON_GFX_CHROME_FONT_H_
+
+#include "build/build_config.h"
-#include <windows.h>
#include <string>
+#if defined(OS_WIN)
+typedef struct HFONT__* HFONT;
+#endif
+
#include "base/basictypes.h"
#include "base/ref_counted.h"
@@ -127,19 +132,8 @@ class ChromeFont {
int baseline,
int ave_char_width,
int style,
- int dlu_base_x)
- : hfont_(hfont),
- height_(height),
- baseline_(baseline),
- ave_char_width_(ave_char_width),
- style_(style),
- dlu_base_x_(dlu_base_x) {
- DLOG_ASSERT(hfont);
- }
-
- ~HFontRef() {
- DeleteObject(hfont_);
- }
+ int dlu_base_x);
+ ~HFontRef();
// Accessors
HFONT hfont() const { return hfont_; }
@@ -158,7 +152,7 @@ class ChromeFont {
// Constants used in converting dialog units to pixels.
const int dlu_base_x_;
- DISALLOW_EVIL_CONSTRUCTORS(HFontRef);
+ DISALLOW_COPY_AND_ASSIGN(HFontRef);
};
@@ -178,4 +172,4 @@ class ChromeFont {
scoped_refptr<HFontRef> font_ref_;
};
-#endif // CHROME_COMMON_GFX_CHROME_FONT_H__
+#endif // CHROME_COMMON_GFX_CHROME_FONT_H_
diff --git a/chrome/common/pref_member.cc b/chrome/common/pref_member.cc
new file mode 100644
index 0000000..bed95d3
--- /dev/null
+++ b/chrome/common/pref_member.cc
@@ -0,0 +1,111 @@
+// Copyright 2008, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "chrome/common/pref_member.h"
+
+#include "base/logging.h"
+#include "chrome/common/pref_service.h"
+
+namespace subtle {
+
+PrefMemberBase::PrefMemberBase()
+ : observer_(NULL),
+ prefs_(NULL),
+ is_synced_(false),
+ setting_value_(false) {
+}
+
+PrefMemberBase::~PrefMemberBase() {
+ if (!pref_name_.empty())
+ prefs_->RemovePrefObserver(pref_name_.c_str(), this);
+}
+
+
+void PrefMemberBase::Init(const wchar_t* pref_name, PrefService* prefs,
+ NotificationObserver* observer) {
+ DCHECK(pref_name);
+ DCHECK(prefs);
+ DCHECK(pref_name_.empty()); // Check that Init is only called once.
+ observer_ = observer;
+ prefs_ = prefs;
+ pref_name_ = pref_name;
+ DCHECK(!pref_name_.empty());
+
+ // Add ourself as a pref observer so we can keep our local value in sync.
+ prefs_->AddPrefObserver(pref_name, this);
+}
+
+void PrefMemberBase::Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details) {
+ DCHECK(!pref_name_.empty());
+ DCHECK(NOTIFY_PREF_CHANGED == type);
+ UpdateValueFromPref();
+ is_synced_ = true;
+ if (!setting_value_ && observer_)
+ observer_->Observe(type, source, details);
+}
+
+void PrefMemberBase::VerifyValuePrefName() {
+ DCHECK(!pref_name_.empty());
+}
+
+} // namespace subtle
+
+void BooleanPrefMember::UpdateValueFromPref() {
+ value_ = prefs()->GetBoolean(pref_name().c_str());
+}
+
+void BooleanPrefMember::UpdatePref(const bool& value) {
+ prefs()->SetBoolean(pref_name().c_str(), value);
+}
+
+void IntegerPrefMember::UpdateValueFromPref() {
+ value_ = prefs()->GetInteger(pref_name().c_str());
+}
+
+void IntegerPrefMember::UpdatePref(const int& value) {
+ prefs()->SetInteger(pref_name().c_str(), value);
+}
+
+void RealPrefMember::UpdateValueFromPref() {
+ value_ = prefs()->GetReal(pref_name().c_str());
+}
+
+void RealPrefMember::UpdatePref(const double& value) {
+ prefs()->SetReal(pref_name().c_str(), value);
+}
+
+void StringPrefMember::UpdateValueFromPref() {
+ value_ = prefs()->GetString(pref_name().c_str());
+}
+
+void StringPrefMember::UpdatePref(const std::wstring& value) {
+ prefs()->SetString(pref_name().c_str(), value);
+}
diff --git a/chrome/common/pref_member.h b/chrome/common/pref_member.h
index 9e175d2..5525d78 100644
--- a/chrome/common/pref_member.h
+++ b/chrome/common/pref_member.h
@@ -45,58 +45,70 @@
// An optional observer can be passed into the Init method which can be used to
// notify MyClass of changes.
-#ifndef CHROME_COMMON_PREF_MEMBER_H__
-#define CHROME_COMMON_PREF_MEMBER_H__
+#ifndef CHROME_COMMON_PREF_MEMBER_H_
+#define CHROME_COMMON_PREF_MEMBER_H_
#include <string>
-#include "base/logging.h"
#include "chrome/common/notification_service.h"
-#include "chrome/common/pref_service.h"
+
+class PrefService;
+
+namespace subtle {
+
+class PrefMemberBase : public NotificationObserver {
+ protected:
+ PrefMemberBase();
+ virtual ~PrefMemberBase();
+
+ // See PrefMember<> for description.
+ void Init(const wchar_t* pref_name, PrefService* prefs,
+ NotificationObserver* observer);
+
+ // NotificationObserver
+ virtual void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
+
+ void VerifyValuePrefName();
+
+ // This methods is used to do the actual sync with pref of the specified type.
+ virtual void UpdateValueFromPref() = 0;
+
+ const std::wstring& pref_name() const { return pref_name_; }
+ PrefService* prefs() { return prefs_; }
+
+ protected:
+ bool is_synced_;
+ bool setting_value_;
+
+ private:
+ std::wstring pref_name_;
+ PrefService* prefs_;
+ NotificationObserver* observer_;
+};
+
+} // namespace subtle
+
template <typename ValueType>
-class PrefMember : public NotificationObserver {
+class PrefMember : public subtle::PrefMemberBase {
public:
// Defer initialization to an Init method so it's easy to make this class be
// a member variable.
- PrefMember() : observer_(NULL), prefs_(NULL), is_synced_(false),
- setting_value_(false) {}
+ PrefMember() { }
+ virtual ~PrefMember() { }
// Do the actual initialization of the class. |observer| may be null if you
// don't want any notifications of changes.
void Init(const wchar_t* pref_name, PrefService* prefs,
NotificationObserver* observer) {
- DCHECK(pref_name);
- DCHECK(prefs);
- DCHECK(pref_name_.empty()); // Check that Init is only called once.
- observer_ = observer;
- prefs_ = prefs;
- pref_name_ = pref_name;
- DCHECK(!pref_name_.empty());
-
- // Add ourself as a pref observer so we can keep our local value in sync.
- prefs_->AddPrefObserver(pref_name, this);
- }
-
- virtual ~PrefMember() {
- if (!pref_name_.empty())
- prefs_->RemovePrefObserver(pref_name_.c_str(), this);
- }
-
- virtual void Observe(NotificationType type,
- const NotificationSource& source,
- const NotificationDetails& details) {
- DCHECK(!pref_name_.empty());
- DCHECK(NOTIFY_PREF_CHANGED == type);
- UpdateValueFromPref();
- is_synced_ = true;
- if (!setting_value_ && observer_)
- observer_->Observe(type, source, details);
+ subtle::PrefMemberBase::Init(pref_name, prefs, observer);
}
// Retrieve the value of the member variable.
ValueType GetValue() {
- DCHECK(!pref_name_.empty());
+ VerifyValuePrefName();
// We lazily fetch the value from the pref service the first time GetValue
// is called.
if (!is_synced_) {
@@ -113,29 +125,19 @@ class PrefMember : public NotificationObserver {
// Set the value of the member variable.
void SetValue(const ValueType& value) {
- DCHECK(!pref_name_.empty());
+ VerifyValuePrefName();
setting_value_ = true;
UpdatePref(value);
setting_value_ = false;
}
protected:
- // These methods are used to do the actual sync with pref of the specified
- // type.
- virtual void UpdateValueFromPref() = 0;
+ // This methods is used to do the actual sync with pref of the specified type.
virtual void UpdatePref(const ValueType& value) = 0;
- std::wstring pref_name_;
- PrefService* prefs_;
-
// We cache the value of the pref so we don't have to keep walking the pref
// tree.
ValueType value_;
-
- private:
- NotificationObserver* observer_;
- bool is_synced_;
- bool setting_value_;
};
///////////////////////////////////////////////////////////////////////////////
@@ -147,16 +149,11 @@ class BooleanPrefMember : public PrefMember<bool> {
virtual ~BooleanPrefMember() { }
protected:
- virtual void UpdateValueFromPref() {
- value_ = prefs_->GetBoolean(pref_name_.c_str());
- }
-
- virtual void UpdatePref(const bool& value) {
- prefs_->SetBoolean(pref_name_.c_str(), value);
- }
+ virtual void UpdateValueFromPref();
+ virtual void UpdatePref(const bool& value);
private:
- DISALLOW_EVIL_CONSTRUCTORS(BooleanPrefMember);
+ DISALLOW_COPY_AND_ASSIGN(BooleanPrefMember);
};
class IntegerPrefMember : public PrefMember<int> {
@@ -165,16 +162,11 @@ class IntegerPrefMember : public PrefMember<int> {
virtual ~IntegerPrefMember() { }
protected:
- virtual void UpdateValueFromPref() {
- value_ = prefs_->GetInteger(pref_name_.c_str());
- }
-
- virtual void UpdatePref(const int& value) {
- prefs_->SetInteger(pref_name_.c_str(), value);
- }
+ virtual void UpdateValueFromPref();
+ virtual void UpdatePref(const int& value);
private:
- DISALLOW_EVIL_CONSTRUCTORS(IntegerPrefMember);
+ DISALLOW_COPY_AND_ASSIGN(IntegerPrefMember);
};
class RealPrefMember : public PrefMember<double> {
@@ -183,16 +175,11 @@ class RealPrefMember : public PrefMember<double> {
virtual ~RealPrefMember() { }
protected:
- virtual void UpdateValueFromPref() {
- value_ = prefs_->GetReal(pref_name_.c_str());
- }
-
- virtual void UpdatePref(const double& value) {
- prefs_->SetReal(pref_name_.c_str(), value);
- }
+ virtual void UpdateValueFromPref();
+ virtual void UpdatePref(const double& value);
private:
- DISALLOW_EVIL_CONSTRUCTORS(RealPrefMember);
+ DISALLOW_COPY_AND_ASSIGN(RealPrefMember);
};
class StringPrefMember : public PrefMember<std::wstring> {
@@ -201,16 +188,11 @@ class StringPrefMember : public PrefMember<std::wstring> {
virtual ~StringPrefMember() { }
protected:
- virtual void UpdateValueFromPref() {
- value_ = prefs_->GetString(pref_name_.c_str());
- }
-
- virtual void UpdatePref(const std::wstring& value) {
- prefs_->SetString(pref_name_.c_str(), value);
- }
+ virtual void UpdateValueFromPref();
+ virtual void UpdatePref(const std::wstring& value);
private:
- DISALLOW_EVIL_CONSTRUCTORS(StringPrefMember);
+ DISALLOW_COPY_AND_ASSIGN(StringPrefMember);
};
-#endif // CHROME_COMMON_PREF_MEMBER_H__
+#endif // CHROME_COMMON_PREF_MEMBER_H_
diff --git a/chrome/common/pref_member_unittest.cc b/chrome/common/pref_member_unittest.cc
index 5a26ece..fc88b70 100644
--- a/chrome/common/pref_member_unittest.cc
+++ b/chrome/common/pref_member_unittest.cc
@@ -28,6 +28,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "chrome/common/pref_member.h"
+#include "chrome/common/pref_service.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
diff --git a/chrome/common/pref_service.h b/chrome/common/pref_service.h
index fed3cf2..ab87960 100644
--- a/chrome/common/pref_service.h
+++ b/chrome/common/pref_service.h
@@ -37,14 +37,13 @@
// persistent and transient stores, where any corresponding value in the
// transient store overrides the one in the persistent store.
-#ifndef CHROME_COMMON_PREF_SERVICE_H__
-#define CHROME_COMMON_PREF_SERVICE_H__
+#ifndef CHROME_COMMON_PREF_SERVICE_H_
+#define CHROME_COMMON_PREF_SERVICE_H_
#include <hash_map>
#include <string>
#include "base/basictypes.h"
-#include "base/logging.h"
#include "base/non_thread_safe.h"
#include "base/observer_list.h"
#include "base/scoped_ptr.h"
@@ -96,7 +95,7 @@ class PrefService : public NonThreadSafe {
// A reference to the pref service's persistent prefs.
DictionaryValue* root_pref_;
- DISALLOW_EVIL_CONSTRUCTORS(Preference);
+ DISALLOW_COPY_AND_ASSIGN(Preference);
};
// |pref_filename| is the path to the prefs file we will try to load or save to.
@@ -257,7 +256,7 @@ class PrefService : public NonThreadSafe {
PrefObserverMap;
PrefObserverMap pref_observers_;
- DISALLOW_EVIL_CONSTRUCTORS(PrefService);
+ DISALLOW_COPY_AND_ASSIGN(PrefService);
};
-#endif // CHROME_COMMON_PREF_SERVICE_H__
+#endif // CHROME_COMMON_PREF_SERVICE_H_
diff --git a/chrome/test/ui/view_event_test_base.cc b/chrome/test/ui/view_event_test_base.cc
index bf0aa84..7027444 100644
--- a/chrome/test/ui/view_event_test_base.cc
+++ b/chrome/test/ui/view_event_test_base.cc
@@ -31,6 +31,7 @@
#include "base/message_loop.h"
#include "chrome/browser/automation/ui_controls.h"
+#include "chrome/views/view.h"
#include "chrome/views/window.h"
namespace {
@@ -111,6 +112,10 @@ void ViewEventTestBase::StartMessageLoopAndRunTest() {
MessageLoop::current()->Run();
}
+gfx::Size ViewEventTestBase::GetPreferredSize() {
+ return gfx::Size();
+}
+
void ViewEventTestBase::ScheduleMouseMoveInBackground(int x, int y) {
if (!dnd_thread_.get()) {
dnd_thread_.reset(new Thread("mouse-move-thread"));
diff --git a/chrome/test/ui/view_event_test_base.h b/chrome/test/ui/view_event_test_base.h
index 4582f8a..6ae7e34 100644
--- a/chrome/test/ui/view_event_test_base.h
+++ b/chrome/test/ui/view_event_test_base.h
@@ -36,6 +36,10 @@
class Task;
+namespace gfx {
+class Size;
+}
+
// Base class for Views based tests that dispatch events.
//
// As views based event test involves waiting for events to be processed,
@@ -114,7 +118,7 @@ class ViewEventTestBase : public ChromeViews::WindowDelegate,
// Returns an empty Size. Subclasses that want a preferred size other than
// that of the View returned by CreateContentsView should override this
// appropriately.
- virtual gfx::Size GetPreferredSize() { return gfx::Size(); }
+ virtual gfx::Size GetPreferredSize();
// Creates a task that calls the specified method back. The specified
// method is called in such a way that if there are any test failures
diff --git a/chrome/views/SConscript b/chrome/views/SConscript
index eb5a380..e627aea 100644
--- a/chrome/views/SConscript
+++ b/chrome/views/SConscript
@@ -71,6 +71,7 @@ input_files = [
'client_view.cc',
'combo_box.cc',
'custom_frame_window.cc',
+ 'dialog_delegate.cc',
'dialog_client_view.cc',
'decision.cc',
'event.cc',
@@ -112,6 +113,7 @@ input_files = [
'view.cc',
'view_storage.cc',
'window.cc',
+ 'window_delegate.cc',
]
env.ChromeStaticLibrary('views', input_files)
diff --git a/chrome/views/accelerator.cc b/chrome/views/accelerator.cc
index e8152ce..c0ff1dd 100644
--- a/chrome/views/accelerator.cc
+++ b/chrome/views/accelerator.cc
@@ -27,9 +27,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include <string>
-#include <windows.h>
-
#include "chrome/views/accelerator.h"
#include "base/logging.h"
diff --git a/chrome/views/accelerator.h b/chrome/views/accelerator.h
index 468e0d2..c803b43 100644
--- a/chrome/views/accelerator.h
+++ b/chrome/views/accelerator.h
@@ -33,8 +33,10 @@
// It also defines the < operator so that it can be used as a key in a std::map.
//
-#ifndef CHROME_VIEWS_ACCELERATOR_H__
-#define CHROME_VIEWS_ACCELERATOR_H__
+#ifndef CHROME_VIEWS_ACCELERATOR_H_
+#define CHROME_VIEWS_ACCELERATOR_H_
+
+#include <string>
#include "chrome/views/event.h"
@@ -117,4 +119,4 @@ class AcceleratorTarget {
};
}
-#endif // #ifndef CHROME_VIEWS_ACCELERATOR_H__ \ No newline at end of file
+#endif // CHROME_VIEWS_ACCELERATOR_H_
diff --git a/chrome/views/accessibility/accessible_wrapper.h b/chrome/views/accessibility/accessible_wrapper.h
index 05a4d6a..81ee3e4 100644
--- a/chrome/views/accessibility/accessible_wrapper.h
+++ b/chrome/views/accessibility/accessible_wrapper.h
@@ -27,12 +27,11 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef CHROME_VIEWS_ACCESSIBILITY_ACCESSIBLE_WRAPPER_H__
-#define CHROME_VIEWS_ACCESSIBILITY_ACCESSIBLE_WRAPPER_H__
+#ifndef CHROME_VIEWS_ACCESSIBILITY_ACCESSIBLE_WRAPPER_H_
+#define CHROME_VIEWS_ACCESSIBILITY_ACCESSIBLE_WRAPPER_H_
#include <atlcomcli.h>
#include <oleacc.h>
-#include <windows.h>
#include "base/basictypes.h"
@@ -75,6 +74,7 @@ class AccessibleWrapper {
// View needed to initialize IAccessible.
ChromeViews::View* view_;
- DISALLOW_EVIL_CONSTRUCTORS(AccessibleWrapper);
+ DISALLOW_COPY_AND_ASSIGN(AccessibleWrapper);
};
-#endif // CHROME_VIEWS_ACCESSIBILITY_ACCESSIBLE_WRAPPER_H__
+
+#endif // CHROME_VIEWS_ACCESSIBILITY_ACCESSIBLE_WRAPPER_H_
diff --git a/chrome/views/accessibility/autocomplete_accessibility.cc b/chrome/views/accessibility/autocomplete_accessibility.cc
index cb88ff6..fc6d710 100644
--- a/chrome/views/accessibility/autocomplete_accessibility.cc
+++ b/chrome/views/accessibility/autocomplete_accessibility.cc
@@ -31,6 +31,7 @@
#include "base/logging.h"
#include "chrome/common/l10n_util.h"
+#include "chrome/views/accessibility/accessible_wrapper.h"
#include "generated_resources.h"
diff --git a/chrome/views/accessibility/view_accessibility.cc b/chrome/views/accessibility/view_accessibility.cc
index c435f1e..b1fdb9a 100644
--- a/chrome/views/accessibility/view_accessibility.cc
+++ b/chrome/views/accessibility/view_accessibility.cc
@@ -32,6 +32,7 @@
#include "base/logging.h"
#include "chrome/browser/view_ids.h"
#include "chrome/browser/views/location_bar_view.h"
+#include "chrome/views/accessibility/accessible_wrapper.h"
HRESULT ViewAccessibility::Initialize(ChromeViews::View* view) {
if (!view) {
diff --git a/chrome/views/base_button.cc b/chrome/views/base_button.cc
index 6fc440a..81b97ab 100644
--- a/chrome/views/base_button.cc
+++ b/chrome/views/base_button.cc
@@ -27,9 +27,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include <atlbase.h>
-#include <atlapp.h>
-
#include "chrome/views/base_button.h"
#include "base/base_drag_source.h"
@@ -37,6 +34,7 @@
#include "chrome/common/drag_drop_types.h"
#include "chrome/common/gfx/chrome_canvas.h"
#include "chrome/common/os_exchange_data.h"
+#include "chrome/common/throb_animation.h"
namespace ChromeViews {
@@ -171,7 +169,7 @@ void BaseButton::SetTooltipText(const std::wstring& tooltip) {
bool BaseButton::OnMousePressed(const ChromeViews::MouseEvent& e) {
if (state_ != BS_DISABLED) {
- if (IsTriggerableEvent(e) && HitTest(e.GetLocation())) {
+ if (IsTriggerableEvent(e) && HitTest(WTL::CPoint(e.GetX(), e.GetY()))) {
SetState(BS_PUSHED);
}
if (IsFocusable())
@@ -182,7 +180,7 @@ bool BaseButton::OnMousePressed(const ChromeViews::MouseEvent& e) {
bool BaseButton::OnMouseDragged(const ChromeViews::MouseEvent& e) {
if (state_ != BS_DISABLED) {
- if (!HitTest(e.GetLocation()))
+ if (!HitTest(WTL::CPoint(e.GetX(), e.GetY())))
SetState(BS_NORMAL);
else if (IsTriggerableEvent(e))
SetState(BS_PUSHED);
@@ -200,7 +198,7 @@ void BaseButton::OnMouseReleased(const ChromeViews::MouseEvent& e,
}
if (state_ != BS_DISABLED) {
- if (canceled || !HitTest(e.GetLocation())) {
+ if (canceled || !HitTest(WTL::CPoint(e.GetX(), e.GetY()))) {
SetState(BS_NORMAL);
} else {
SetState(BS_HOT);
@@ -225,7 +223,7 @@ void BaseButton::OnMouseMoved(const ChromeViews::MouseEvent& e) {
using namespace ChromeViews;
if (state_ != BS_DISABLED) {
- if (HitTest(e.GetLocation())) {
+ if (HitTest(WTL::CPoint(e.GetX(), e.GetY()))) {
SetState(BS_HOT);
} else {
SetState(BS_NORMAL);
diff --git a/chrome/views/base_button.h b/chrome/views/base_button.h
index 7b655bb..21fc9bf 100644
--- a/chrome/views/base_button.h
+++ b/chrome/views/base_button.h
@@ -30,14 +30,12 @@
#ifndef CHROME_VIEWS_BASE_BUTTON_H__
#define CHROME_VIEWS_BASE_BUTTON_H__
-#include <windows.h>
-
-#include "base/logging.h"
-#include "chrome/common/throb_animation.h"
+#include "chrome/common/animation.h"
#include "chrome/views/event.h"
#include "chrome/views/view.h"
class OSExchangeData;
+class ThrobAnimation;
namespace ChromeViews {
diff --git a/chrome/views/bitmap_scroll_bar.cc b/chrome/views/bitmap_scroll_bar.cc
index ac7f5f6..43e3b9d 100644
--- a/chrome/views/bitmap_scroll_bar.cc
+++ b/chrome/views/bitmap_scroll_bar.cc
@@ -34,6 +34,7 @@
#include "chrome/common/l10n_util.h"
#include "chrome/views/menu.h"
#include "chrome/views/scroll_view.h"
+#include "chrome/views/view_container.h"
#include "skia/include/SkBitmap.h"
#include "generated_resources.h"
diff --git a/chrome/views/button.cc b/chrome/views/button.cc
index adc0647..680ace9 100644
--- a/chrome/views/button.cc
+++ b/chrome/views/button.cc
@@ -35,6 +35,7 @@
#include "base/gfx/image_operations.h"
#include "chrome/common/gfx/chrome_canvas.h"
#include "chrome/common/l10n_util.h"
+#include "chrome/common/throb_animation.h"
#include "chrome/views/event.h"
#include "chrome/views/view_container.h"
#include "chrome/app/chrome_dll_resource.h"
diff --git a/chrome/views/button.h b/chrome/views/button.h
index 9840ea3..f85201e 100644
--- a/chrome/views/button.h
+++ b/chrome/views/button.h
@@ -30,8 +30,6 @@
#ifndef CHROME_VIEWS_BUTTON_H_
#define CHROME_VIEWS_BUTTON_H_
-#include <windows.h>
-
#include "chrome/views/base_button.h"
#include "skia/include/SkBitmap.h"
diff --git a/chrome/views/button_dropdown.cc b/chrome/views/button_dropdown.cc
index dfcd3da..196c170 100644
--- a/chrome/views/button_dropdown.cc
+++ b/chrome/views/button_dropdown.cc
@@ -65,7 +65,7 @@ ButtonDropDown::~ButtonDropDown() {
////////////////////////////////////////////////////////////////////////////////
bool ButtonDropDown::OnMousePressed(const ChromeViews::MouseEvent& e) {
- if (IsEnabled() && e.IsLeftMouseButton() && HitTest(e.GetLocation())) {
+ if (IsEnabled() && e.IsLeftMouseButton() && HitTest(WTL::CPoint(e.GetX(), e.GetY()))) {
// Store the y pos of the mouse coordinates so we can use them later to
// determine if the user dragged the mouse down (which should pop up the
// drag down menu immediately, instead of waiting for the timer)
@@ -91,7 +91,7 @@ void ButtonDropDown::OnMouseReleased(const ChromeViews::MouseEvent& e,
if (e.IsLeftMouseButton())
show_menu_factory_.RevokeAll();
- if (IsEnabled() && e.IsRightMouseButton() && HitTest(e.GetLocation())) {
+ if (IsEnabled() && e.IsRightMouseButton() && HitTest(WTL::CPoint(e.GetX(), e.GetY()))) {
show_menu_factory_.RevokeAll();
// Make the button look depressed while the menu is open.
// NOTE: SetState() schedules a paint, but it won't occur until after the
diff --git a/chrome/views/checkbox.cc b/chrome/views/checkbox.cc
index 56ac361..f9df22c2 100644
--- a/chrome/views/checkbox.cc
+++ b/chrome/views/checkbox.cc
@@ -166,10 +166,10 @@ void CheckBox::HighlightButton(bool f) {
}
bool CheckBox::LabelHitTest(const MouseEvent& event) {
- CPoint p(event.GetLocation());
+ CPoint p(event.GetX(), event.GetY());
gfx::Rect r;
ComputeTextRect(&r);
- return r.Contains(event.GetLocation().x, event.GetLocation().y);
+ return r.Contains(event.GetX(), event.GetY());
}
void CheckBox::OnMouseEntered(const MouseEvent& event) {
diff --git a/chrome/views/chrome_menu.cc b/chrome/views/chrome_menu.cc
index 75736d9..6b74d50 100644
--- a/chrome/views/chrome_menu.cc
+++ b/chrome/views/chrome_menu.cc
@@ -47,6 +47,7 @@
#include "chrome/common/os_exchange_data.h"
#include "chrome/views/border.h"
#include "chrome/views/hwnd_view_container.h"
+#include "chrome/views/root_view.h"
#include "generated_resources.h"
// Margins between the top of the item and the label.
diff --git a/chrome/views/combo_box.cc b/chrome/views/combo_box.cc
index 7aad1cf..3c19ee0 100644
--- a/chrome/views/combo_box.cc
+++ b/chrome/views/combo_box.cc
@@ -33,6 +33,7 @@
#include "base/gfx/rect.h"
#include "chrome/common/gfx/chrome_canvas.h"
#include "chrome/common/gfx/chrome_font.h"
+#include "chrome/common/l10n_util.h"
#include "chrome/common/resource_bundle.h"
// Limit how small a combobox can be.
diff --git a/chrome/views/controller.h b/chrome/views/controller.h
index 9101131..d57b2de 100644
--- a/chrome/views/controller.h
+++ b/chrome/views/controller.h
@@ -30,6 +30,8 @@
#ifndef CHROME_VIEWS_CONTROLLER_H_
#define CHROME_VIEWS_CONTROLLER_H_
+#include <string>
+
///////////////////////////////////////////////////////////////////////////////
//
// Controller class
@@ -41,6 +43,8 @@
///////////////////////////////////////////////////////////////////////////////
class Controller {
public:
+ virtual ~Controller() { }
+
// Whether or not a command is supported by this controller.
virtual bool SupportsCommand(int id) const = 0;
diff --git a/chrome/views/custom_frame_window.cc b/chrome/views/custom_frame_window.cc
index 2a96cb9..7679e3f 100644
--- a/chrome/views/custom_frame_window.cc
+++ b/chrome/views/custom_frame_window.cc
@@ -42,6 +42,7 @@
#include "chrome/views/client_view.h"
#include "chrome/views/native_button.h"
#include "chrome/views/non_client_view.h"
+#include "chrome/views/root_view.h"
#include "chrome/views/window_delegate.h"
#include "generated_resources.h"
diff --git a/chrome/views/dialog_delegate.cc b/chrome/views/dialog_delegate.cc
new file mode 100644
index 0000000..8aa375d
--- /dev/null
+++ b/chrome/views/dialog_delegate.cc
@@ -0,0 +1,58 @@
+// Copyright 2008, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "chrome/views/dialog_delegate.h"
+
+#include "chrome/views/window.h"
+
+namespace ChromeViews {
+
+// Overridden from WindowDelegate:
+View* DialogDelegate::GetInitiallyFocusedView() const {
+ // Try to focus the OK then the Cancel button if present.
+ DialogClientView* dcv = GetDialogClientView();
+ if (GetDialogButtons() & DIALOGBUTTON_OK)
+ return dcv->ok_button();
+ if (GetDialogButtons() & DIALOGBUTTON_CANCEL)
+ return dcv->cancel_button();
+ return NULL;
+}
+
+ClientView* DialogDelegate::CreateClientView(Window* window) {
+ return new DialogClientView(window, GetContentsView());
+}
+
+DialogClientView* DialogDelegate::GetDialogClientView() const {
+ ClientView* client_view = window()->client_view();
+ DialogClientView* dialog_client_view = client_view->AsDialogClientView();
+ DCHECK(dialog_client_view);
+ return dialog_client_view;
+}
+
+} // namespace ChromeViews
diff --git a/chrome/views/dialog_delegate.h b/chrome/views/dialog_delegate.h
index 9ca4ade..cf55b36 100644
--- a/chrome/views/dialog_delegate.h
+++ b/chrome/views/dialog_delegate.h
@@ -27,8 +27,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef CHROME_VIEWS_DIALOG_DELEGATE_H__
-#define CHROME_VIEWS_DIALOG_DELEGATE_H__
+#ifndef CHROME_VIEWS_DIALOG_DELEGATE_H_
+#define CHROME_VIEWS_DIALOG_DELEGATE_H_
#include "chrome/views/dialog_client_view.h"
#include "chrome/views/window_delegate.h"
@@ -122,31 +122,16 @@ class DialogDelegate : public WindowDelegate {
virtual bool Accept() { return true; }
// Overridden from WindowDelegate:
- virtual View* GetInitiallyFocusedView() const {
- // Try to focus the OK then the Cancel button if present.
- DialogClientView* dcv = GetDialogClientView();
- if (GetDialogButtons() & DIALOGBUTTON_OK)
- return dcv->ok_button();
- if (GetDialogButtons() & DIALOGBUTTON_CANCEL)
- return dcv->cancel_button();
- return NULL;
- }
+ virtual View* GetInitiallyFocusedView() const;
// Overridden from WindowDelegate:
- virtual ClientView* CreateClientView(Window* window) {
- return new DialogClientView(window, GetContentsView());
- }
+ virtual ClientView* CreateClientView(Window* window);
// A helper for accessing the DialogClientView object contained by this
// delegate's Window.
- DialogClientView* GetDialogClientView() const {
- ClientView* client_view = window()->client_view();
- DialogClientView* dialog_client_view = client_view->AsDialogClientView();
- DCHECK(dialog_client_view);
- return dialog_client_view;
- }
+ DialogClientView* GetDialogClientView() const;
};
} // namespace ChromeViews
-#endif // #ifndef CHROME_VIEWS_DIALOG_DELEGATE_H__
+#endif // #ifndef CHROME_VIEWS_DIALOG_DELEGATE_H_
diff --git a/chrome/views/event.cc b/chrome/views/event.cc
index b3d9194..ac8d716 100644
--- a/chrome/views/event.cc
+++ b/chrome/views/event.cc
@@ -34,6 +34,12 @@
namespace ChromeViews {
+Event::Event(EventType type, int flags)
+ : type_(type),
+ time_stamp_(GetTickCount()),
+ flags_(flags) {
+}
+
int Event::GetWindowsFlags() const {
// TODO: need support for x1/x2.
int result = 0;
@@ -109,4 +115,8 @@ int KeyEvent::GetKeyStateFlags() const {
return flags;
}
+bool KeyEvent::IsExtendedKey() const {
+ return (message_flags_ & KF_EXTENDED) == KF_EXTENDED;
}
+
+} // namespace ChromeViews
diff --git a/chrome/views/event.h b/chrome/views/event.h
index a9b93bf..00bbdf8 100644
--- a/chrome/views/event.h
+++ b/chrome/views/event.h
@@ -30,12 +30,6 @@
#ifndef CHROME_VIEWS_EVENT_H__
#define CHROME_VIEWS_EVENT_H__
-// TODO(maruel): Remove these as soon as LocatedEvent::GetLocation() is
-// removed.
-#include <atlbase.h>
-#include <atlapp.h>
-#include <atlmisc.h>
-
#include "base/basictypes.h"
#include "base/gfx/point.h"
#include "webkit/glue/window_open_disposition.h"
@@ -115,18 +109,14 @@ class Event {
int GetWindowsFlags() const;
// Convert windows flags to ChromeViews::Event flags
- static int ConvertWindowsFlags(UINT win_flags);
+ static int ConvertWindowsFlags(uint32 win_flags);
// Convert WebInputEvent::Modifiers flags to ChromeViews::Event flags.
// Note that this only deals with keyboard modifiers.
static int ConvertWebInputEventFlags(int web_input_event_flags);
protected:
- Event(EventType type, int flags)
- : type_(type),
- time_stamp_(GetTickCount()),
- flags_(flags) {
- }
+ Event(EventType type, int flags);
Event(const Event& model)
: type_(model.GetType()),
@@ -177,11 +167,6 @@ class LocatedEvent : public Event {
return location_;
}
- // WARNING: DEPRECATED. Returns the location in WTL::CPoint format.
- WTL::CPoint GetLocation() const {
- return WTL::CPoint(location_.x(), location_.y());
- }
-
private:
gfx::Point location_;
};
@@ -271,9 +256,7 @@ class KeyEvent : public Event {
return character_;
}
- bool IsExtendedKey() const {
- return (message_flags_ & KF_EXTENDED) == KF_EXTENDED;
- }
+ bool IsExtendedKey() const;
int GetRepeatCount() const {
return repeat_count_;
diff --git a/chrome/views/focus_manager_unittest.cc b/chrome/views/focus_manager_unittest.cc
index ce26b04..cb99446 100644
--- a/chrome/views/focus_manager_unittest.cc
+++ b/chrome/views/focus_manager_unittest.cc
@@ -39,16 +39,15 @@
#include "chrome/views/background.h"
#include "chrome/views/border.h"
#include "chrome/views/checkbox.h"
-#include "chrome/views/focus_manager.h"
#include "chrome/views/hwnd_view_container.h"
#include "chrome/views/label.h"
#include "chrome/views/link.h"
#include "chrome/views/native_button.h"
#include "chrome/views/radio_button.h"
+#include "chrome/views/root_view.h"
#include "chrome/views/scroll_view.h"
#include "chrome/views/tabbed_pane.h"
#include "chrome/views/text_field.h"
-#include "chrome/views/view.h"
#include "chrome/views/window.h"
#include "chrome/views/window_delegate.h"
#include "SkColor.h"
diff --git a/chrome/views/hwnd_view_container.cc b/chrome/views/hwnd_view_container.cc
index cf1a58a..a360919 100644
--- a/chrome/views/hwnd_view_container.cc
+++ b/chrome/views/hwnd_view_container.cc
@@ -30,15 +30,12 @@
#include "chrome/views/hwnd_view_container.h"
#include "base/gfx/native_theme.h"
-#include "base/message_loop.h"
#include "base/string_util.h"
#include "base/win_util.h"
#include "chrome/common/gfx/chrome_canvas.h"
-#include "chrome/common/notification_service.h"
#include "chrome/common/win_util.h"
#include "chrome/views/aero_tooltip_manager.h"
#include "chrome/views/accessibility/view_accessibility.h"
-#include "chrome/views/focus_manager.h"
#include "chrome/views/hwnd_notification_source.h"
#include "chrome/views/root_view.h"
diff --git a/chrome/views/hwnd_view_container.h b/chrome/views/hwnd_view_container.h
index 5a13c16..8187d47 100644
--- a/chrome/views/hwnd_view_container.h
+++ b/chrome/views/hwnd_view_container.h
@@ -27,21 +27,26 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef CHROME_VIEWS_HWND_VIEW_CONTAINER_H__
-#define CHROME_VIEWS_HWND_VIEW_CONTAINER_H__
+#ifndef CHROME_VIEWS_HWND_VIEW_CONTAINER_H_
+#define CHROME_VIEWS_HWND_VIEW_CONTAINER_H_
#include <atlbase.h>
-#include <atlapp.h>
#include <atlcrack.h>
#include "base/message_loop.h"
#include "chrome/views/focus_manager.h"
#include "chrome/views/layout_manager.h"
-#include "chrome/views/root_view.h"
#include "chrome/views/view_container.h"
+class ChromeCanvas;
+
+namespace gfx {
+class Rect;
+}
+
namespace ChromeViews {
+class RootView;
class TooltipManager;
bool SetRootViewForHWND(HWND hwnd, RootView* root_view);
@@ -555,6 +560,6 @@ class HWNDViewContainer : public ViewContainer,
HWND hwnd_;
};
-}
+} // namespace ChromeViews
-#endif // #ifndef CHROME_VIEWS_HWND_VIEW_CONTAINER_H__
+#endif // #ifndef CHROME_VIEWS_HWND_VIEW_CONTAINER_H_
diff --git a/chrome/views/label.cc b/chrome/views/label.cc
index 590294b..4237336 100644
--- a/chrome/views/label.cc
+++ b/chrome/views/label.cc
@@ -31,10 +31,13 @@
#include <math.h>
+#include "base/logging.h"
#include "base/string_util.h"
#include "chrome/common/gfx/chrome_canvas.h"
#include "chrome/common/gfx/chrome_font.h"
+#include "chrome/common/gfx/insets.h"
#include "chrome/common/gfx/url_elider.h"
+#include "chrome/common/l10n_util.h"
#include "chrome/common/resource_bundle.h"
#include "chrome/views/background.h"
#include "chrome/views/view_container.h"
diff --git a/chrome/views/link.cc b/chrome/views/link.cc
index 3b19aa1..b42ca6e 100644
--- a/chrome/views/link.cc
+++ b/chrome/views/link.cc
@@ -109,7 +109,7 @@ bool Link::OnMousePressed(const MouseEvent& e) {
bool Link::OnMouseDragged(const MouseEvent& e) {
SetHighlighted(enabled_ &&
(e.IsLeftMouseButton() || e.IsMiddleMouseButton()) &&
- HitTest(e.GetLocation()));
+ HitTest(WTL::CPoint(e.GetX(), e.GetY())));
return true;
}
@@ -119,7 +119,7 @@ void Link::OnMouseReleased(const MouseEvent& e, bool canceled) {
SetHighlighted(false);
if (enabled_ && !canceled &&
(e.IsLeftMouseButton() || e.IsMiddleMouseButton()) &&
- HitTest(e.GetLocation())) {
+ HitTest(WTL::CPoint(e.GetX(), e.GetY()))) {
// Focus the link on click.
RequestFocus();
diff --git a/chrome/views/menu.cc b/chrome/views/menu.cc
index 0b3b72f..81abcf3 100644
--- a/chrome/views/menu.cc
+++ b/chrome/views/menu.cc
@@ -27,23 +27,22 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include <windows.h>
+#include "chrome/views/menu.h"
+
#include <atlbase.h>
#include <atlcrack.h>
#include <atlapp.h>
#include <atlframe.h>
-
-#include "chrome/views/menu.h"
+#include <atlmisc.h>
#include "base/gfx/rect.h"
+#include "base/logging.h"
#include "chrome/views/accelerator.h"
-#include "chrome/views/controller.h"
#include "base/string_util.h"
#include "chrome/common/gfx/chrome_canvas.h"
#include "chrome/common/gfx/chrome_font.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/stl_util-inl.h"
-#include "chrome/common/win_util.h"
const SkBitmap* Menu::Delegate::kEmptyIcon = 0;
@@ -64,6 +63,13 @@ static const int kArrowWidth = 10;
// Current active MenuHostWindow. If NULL, no menu is active.
static MenuHostWindow* active_host_window = NULL;
+// The data of menu items needed to display.
+struct Menu::ItemData {
+ std::wstring label;
+ SkBitmap icon;
+ bool submenu;
+};
+
namespace {
static int ChromeGetMenuItemID(HMENU hMenu, int pos) {
@@ -219,6 +225,16 @@ class MenuHostWindow : public CWindowImpl<MenuHostWindow, CWindow,
} // namespace
+bool Menu::Delegate::IsRightToLeftUILayout() const {
+ return l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT;
+}
+
+const SkBitmap& Menu::Delegate::GetEmptyIcon() const {
+ if (kEmptyIcon == NULL)
+ kEmptyIcon = new SkBitmap();
+ return *kEmptyIcon;
+}
+
Menu::Menu(Delegate* delegate, AnchorPoint anchor, HWND owner)
: delegate_(delegate),
menu_(CreatePopupMenu()),
diff --git a/chrome/views/menu.h b/chrome/views/menu.h
index 44a69c2..07f00b1 100644
--- a/chrome/views/menu.h
+++ b/chrome/views/menu.h
@@ -27,18 +27,17 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef CHROME_VIEWS_MENU_H__
-#define CHROME_VIEWS_MENU_H__
+#ifndef CHROME_VIEWS_MENU_H_
+#define CHROME_VIEWS_MENU_H_
+
+#include <windows.h>
-#include <atlbase.h>
-#include <atlapp.h>
-#include <atlmisc.h>
#include <vector>
-#include "base/message_loop.h"
-#include "chrome/common/l10n_util.h"
+#include "base/basictypes.h"
#include "chrome/views/controller.h"
-#include "skia/include/SkBitmap.h"
+
+class SkBitmap;
namespace {
class MenuHostWindow;
@@ -70,6 +69,8 @@ class Menu {
/////////////////////////////////////////////////////////////////////////////
class Delegate : public Controller {
public:
+ virtual ~Delegate() { }
+
// Whether or not an item should be shown as checked.
virtual bool IsItemChecked(int id) const {
return false;
@@ -139,9 +140,7 @@ class Menu {
// is a right-to-left menu only if the view's layout is right-to-left
// (since the view can use a different layout than the locale's language
// layout).
- virtual bool IsRightToLeftUILayout() const {
- return l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT;
- }
+ virtual bool IsRightToLeftUILayout() const;
// Controller
virtual bool SupportsCommand(int id) const {
@@ -159,11 +158,7 @@ class Menu {
protected:
// Returns an empty icon. Will initialize kEmptyIcon if it hasn't been
// initialized.
- const SkBitmap& GetEmptyIcon() const {
- if (kEmptyIcon == NULL)
- kEmptyIcon = new SkBitmap();
- return *kEmptyIcon;
- }
+ const SkBitmap& GetEmptyIcon() const;
private:
// Will be initialized to an icon of 0 width and 0 height when first using.
@@ -200,7 +195,7 @@ class Menu {
// actions to.
Controller* controller_;
- DISALLOW_EVIL_CONSTRUCTORS(BaseControllerDelegate);
+ DISALLOW_COPY_AND_ASSIGN(BaseControllerDelegate);
};
// How this popup should align itself relative to the point it is run at.
@@ -217,13 +212,6 @@ class Menu {
SEPARATOR
};
- // The data of menu items needed to display.
- struct ItemData {
- std::wstring label;
- SkBitmap icon;
- bool submenu;
- };
-
// Construct a Menu using the specified controller to determine command
// state.
// delegate A Menu::Delegate implementation that provides more
@@ -324,6 +312,9 @@ class Menu {
Delegate* delegate_;
private:
+ // The data of menu items needed to display.
+ struct ItemData;
+
explicit Menu(Menu* parent);
void AddMenuItemInternal(int index,
@@ -378,7 +369,7 @@ class Menu {
// Whether the menu is visible.
bool is_menu_visible_;
- DISALLOW_EVIL_CONSTRUCTORS(Menu);
+ DISALLOW_COPY_AND_ASSIGN(Menu);
};
-#endif // CHROME_VIEWS_MENU_H__
+#endif // CHROME_VIEWS_MENU_H_
diff --git a/chrome/views/menu_button.cc b/chrome/views/menu_button.cc
index 452fbac..82fdb5c 100644
--- a/chrome/views/menu_button.cc
+++ b/chrome/views/menu_button.cc
@@ -33,6 +33,7 @@
#include "chrome/views/menu_button.h"
#include "chrome/app/theme/theme_resources.h"
+#include "chrome/common/drag_drop_types.h"
#include "chrome/common/gfx/chrome_canvas.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/resource_bundle.h"
@@ -206,7 +207,7 @@ bool MenuButton::OnMousePressed(const ChromeViews::MouseEvent& e) {
if (GetState() != BS_DISABLED) {
// If we're draggable (GetDragOperations returns a non-zero value), then
// don't pop on press, instead wait for release.
- if (e.IsOnlyLeftMouseButton() && HitTest(e.GetLocation()) &&
+ if (e.IsOnlyLeftMouseButton() && HitTest(WTL::CPoint(e.GetX(), e.GetY())) &&
GetDragOperations(e.GetX(), e.GetY()) == DragDropTypes::DRAG_NONE) {
TimeDelta delta = Time::Now() - menu_closed_time_;
int64 delta_in_milliseconds = delta.InMilliseconds();
@@ -222,7 +223,7 @@ void MenuButton::OnMouseReleased(const ChromeViews::MouseEvent& e,
bool canceled) {
if (GetDragOperations(e.GetX(), e.GetY()) != DragDropTypes::DRAG_NONE &&
GetState() != BS_DISABLED && !canceled && !InDrag() &&
- e.IsOnlyLeftMouseButton() && HitTest(e.GetLocation())) {
+ e.IsOnlyLeftMouseButton() && HitTest(WTL::CPoint(e.GetX(), e.GetY()))) {
Activate();
} else {
TextButton::OnMouseReleased(e, canceled);
diff --git a/chrome/views/native_button.cc b/chrome/views/native_button.cc
index 97b66e1..fa9e0c6 100644
--- a/chrome/views/native_button.cc
+++ b/chrome/views/native_button.cc
@@ -29,6 +29,7 @@
#include "chrome/views/native_button.h"
+#include "base/logging.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/resource_bundle.h"
#include "chrome/views/background.h"
diff --git a/chrome/views/native_control.cc b/chrome/views/native_control.cc
index d9ef5a9..f16bb74 100644
--- a/chrome/views/native_control.cc
+++ b/chrome/views/native_control.cc
@@ -35,6 +35,7 @@
#include <atlframe.h>
#include "base/win_util.h"
+#include "chrome/common/l10n_util.h"
#include "chrome/views/border.h"
#include "chrome/views/focus_manager.h"
#include "chrome/views/view_container.h"
diff --git a/chrome/views/painter.cc b/chrome/views/painter.cc
index a45d179..dcc69675 100644
--- a/chrome/views/painter.cc
+++ b/chrome/views/painter.cc
@@ -29,6 +29,7 @@
#include "chrome/views/painter.h"
+#include "base/logging.h"
#include "chrome/app/theme/theme_resources.h"
#include "chrome/common/gfx/chrome_canvas.h"
#include "chrome/common/resource_bundle.h"
diff --git a/chrome/views/root_view.cc b/chrome/views/root_view.cc
index 8145d16..c533ef0 100644
--- a/chrome/views/root_view.cc
+++ b/chrome/views/root_view.cc
@@ -27,22 +27,18 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include <algorithm>
-
#include "chrome/views/root_view.h"
+#include <algorithm>
+
#include "base/base_drag_source.h"
#include "base/logging.h"
#include "base/message_loop.h"
-#include "chrome/common/notification_service.h"
-#include "chrome/common/os_exchange_data.h"
-#include "chrome/views/event.h"
-#include "chrome/views/focus_manager.h"
+#include "chrome/common/drag_drop_types.h"
+#include "chrome/common/gfx/chrome_canvas.h"
#include "chrome/views/root_view_drop_target.h"
#include "chrome/views/view_container.h"
-#include "chrome/common/gfx/chrome_canvas.h"
-
namespace ChromeViews {
/////////////////////////////////////////////////////////////////////////////
@@ -307,7 +303,7 @@ bool RootView::OnMousePressed(const MouseEvent& e) {
bool hit_disabled_view = false;
// Walk up the tree until we find a view that wants the mouse event.
- for (mouse_pressed_handler_ = GetViewForPoint(e.GetLocation());
+ for (mouse_pressed_handler_ = GetViewForPoint(WTL::CPoint(e.GetX(), e.GetY()));
mouse_pressed_handler_ && (mouse_pressed_handler_ != this);
mouse_pressed_handler_ = mouse_pressed_handler_->GetParent()) {
if (!mouse_pressed_handler_->IsEnabled()) {
@@ -384,7 +380,7 @@ bool RootView::OnMouseDragged(const MouseEvent& e) {
SetMouseLocationAndFlags(e);
CPoint p;
- ConvertPointToMouseHandler(e.GetLocation(), &p);
+ ConvertPointToMouseHandler(WTL::CPoint(e.GetX(), e.GetY()), &p);
MouseEvent mouse_event(e.GetType(), p.x, p.y, e.GetFlags());
if (!mouse_pressed_handler_->ProcessMouseDragged(mouse_event,
&drag_info)) {
@@ -402,7 +398,7 @@ void RootView::OnMouseReleased(const MouseEvent& e, bool canceled) {
if (mouse_pressed_handler_) {
CPoint p;
- ConvertPointToMouseHandler(e.GetLocation(), &p);
+ ConvertPointToMouseHandler(WTL::CPoint(e.GetX(), e.GetY()), &p);
MouseEvent mouse_released(e.GetType(), p.x, p.y, e.GetFlags());
// We allow the view to delete us from ProcessMouseReleased. As such,
// configure state such that we're done first, then call View.
@@ -415,10 +411,10 @@ void RootView::OnMouseReleased(const MouseEvent& e, bool canceled) {
}
void RootView::UpdateCursor(const MouseEvent& e) {
- View *v = GetViewForPoint(e.GetLocation());
+ View *v = GetViewForPoint(WTL::CPoint(e.GetX(), e.GetY()));
if (v && v != this) {
- CPoint l(e.GetLocation());
+ CPoint l(e.GetX(), e.GetY());
View::ConvertPointToView(this, v, &l);
HCURSOR cursor = v->GetCursorForPoint(e.GetType(), l.x, l.y);
if (cursor) {
@@ -432,7 +428,7 @@ void RootView::UpdateCursor(const MouseEvent& e) {
}
void RootView::OnMouseMoved(const MouseEvent& e) {
- View *v = GetViewForPoint(e.GetLocation());
+ View *v = GetViewForPoint(WTL::CPoint(e.GetX(), e.GetY()));
// Find the first enabled view.
while (v && !v->IsEnabled())
v = v->GetParent();
diff --git a/chrome/views/root_view_drop_target.cc b/chrome/views/root_view_drop_target.cc
index bad4e07..496a3561 100644
--- a/chrome/views/root_view_drop_target.cc
+++ b/chrome/views/root_view_drop_target.cc
@@ -32,6 +32,7 @@
#include "base/logging.h"
#include "chrome/common/drag_drop_types.h"
#include "chrome/views/root_view.h"
+#include "chrome/views/view_container.h"
namespace ChromeViews {
diff --git a/chrome/views/tabbed_pane.cc b/chrome/views/tabbed_pane.cc
index 5d9677a..dbb8b98 100644
--- a/chrome/views/tabbed_pane.cc
+++ b/chrome/views/tabbed_pane.cc
@@ -32,15 +32,18 @@
#include <vssym32.h>
#include "base/gfx/native_theme.h"
+#include "base/gfx/skia_utils.h"
#include "base/logging.h"
#include "chrome/common/gfx/chrome_canvas.h"
#include "chrome/common/gfx/chrome_font.h"
+#include "chrome/common/l10n_util.h"
#include "chrome/common/resource_bundle.h"
#include "chrome/common/stl_util-inl.h"
+#include "chrome/common/throb_animation.h"
#include "chrome/views/background.h"
#include "chrome/views/hwnd_view_container.h"
+#include "chrome/views/root_view.h"
#include "skia/include/SkColor.h"
-#include "base/gfx/skia_utils.h"
namespace ChromeViews {
diff --git a/chrome/views/text_button.cc b/chrome/views/text_button.cc
index 19a7eab..c5dae80 100644
--- a/chrome/views/text_button.cc
+++ b/chrome/views/text_button.cc
@@ -29,12 +29,10 @@
#include "chrome/views/text_button.h"
-#include <atlbase.h>
-#include <atlapp.h>
-
#include "chrome/app/theme/theme_resources.h"
#include "chrome/common/gfx/chrome_canvas.h"
#include "chrome/common/resource_bundle.h"
+#include "chrome/common/throb_animation.h"
#include "chrome/common/win_util.h"
#include "chrome/views/button.h"
#include "chrome/views/event.h"
diff --git a/chrome/views/text_field.cc b/chrome/views/text_field.cc
index 9d2d3e8..2c6efb6 100644
--- a/chrome/views/text_field.cc
+++ b/chrome/views/text_field.cc
@@ -41,6 +41,7 @@
#include "base/win_util.h"
#include "chrome/browser/browser_process.h"
#include "chrome/common/clipboard_service.h"
+#include "chrome/common/gfx/insets.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/logging_chrome.h"
#include "chrome/common/win_util.h"
diff --git a/chrome/views/tree_view.cc b/chrome/views/tree_view.cc
index f4e43e1..2d2c527 100644
--- a/chrome/views/tree_view.cc
+++ b/chrome/views/tree_view.cc
@@ -35,9 +35,11 @@
#include "chrome/app/theme/theme_resources.h"
#include "chrome/common/gfx/chrome_canvas.h"
#include "chrome/common/gfx/icon_util.h"
+#include "chrome/common/l10n_util.h"
#include "chrome/common/resource_bundle.h"
#include "chrome/common/stl_util-inl.h"
#include "chrome/views/focus_manager.h"
+#include "chrome/views/view_container.h"
namespace ChromeViews {
diff --git a/chrome/views/view.cc b/chrome/views/view.cc
index 8df8da5..ad80fee 100644
--- a/chrome/views/view.cc
+++ b/chrome/views/view.cc
@@ -30,14 +30,19 @@
#include "chrome/views/view.h"
#include <algorithm>
-#include <sstream>
+
+#ifndef NDEBUG
#include <iostream>
+#endif
#include "base/logging.h"
#include "base/message_loop.h"
#include "base/string_util.h"
+#include "chrome/common/drag_drop_types.h"
#include "chrome/common/gfx/chrome_canvas.h"
+#include "chrome/common/l10n_util.h"
#include "chrome/common/os_exchange_data.h"
+#include "chrome/views/accessibility/accessible_wrapper.h"
#include "chrome/views/background.h"
#include "chrome/views/border.h"
#include "chrome/views/layout_manager.h"
@@ -288,6 +293,11 @@ void View::SetLayoutManager(LayoutManager* layout_manager) {
}
}
+bool View::UILayoutIsRightToLeft() const {
+ return (ui_mirroring_is_enabled_for_rtl_languages_ &&
+ l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT);
+}
+
////////////////////////////////////////////////////////////////////////////////
//
// View - Right-to-left UI layout
@@ -540,7 +550,7 @@ void View::SetContextMenuController(ContextMenuController* menu_controller) {
bool View::ProcessMousePressed(const MouseEvent& e, DragInfo* drag_info) {
const bool enabled = enabled_;
int drag_operations;
- if (enabled && e.IsOnlyLeftMouseButton() && HitTest(e.GetLocation()))
+ if (enabled && e.IsOnlyLeftMouseButton() && HitTest(WTL::CPoint(e.GetX(), e.GetY())))
drag_operations = GetDragOperations(e.GetX(), e.GetY());
else
drag_operations = 0;
diff --git a/chrome/views/view.h b/chrome/views/view.h
index 066550a..41cb526 100644
--- a/chrome/views/view.h
+++ b/chrome/views/view.h
@@ -27,26 +27,26 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef CHROME_VIEWS_VIEW_H__
-#define CHROME_VIEWS_VIEW_H__
+#ifndef CHROME_VIEWS_VIEW_H_
+#define CHROME_VIEWS_VIEW_H_
+#include <map>
+#include <vector>
+
+// TODO(maruel): Remove these once WTL::CRect and WTL::CPoint are no more used.
#include <atlbase.h>
#include <atlapp.h>
#include <atlmisc.h>
-#include <map>
-#include <vector>
-#include "base/basictypes.h"
#include "base/gfx/rect.h"
#include "base/scoped_ptr.h"
-#include "chrome/common/drag_drop_types.h"
-#include "chrome/common/l10n_util.h"
-#include "chrome/common/gfx/insets.h"
-#include "chrome/views/accessibility/accessible_wrapper.h"
#include "chrome/views/accelerator.h"
-#include "chrome/views/event.h"
-#include "chrome/views/view_container.h"
+namespace gfx {
+class Insets;
+}
+
+class AccessibleWrapper;
class ChromeCanvas;
class OSExchangeData;
class SkBitmap;
@@ -193,7 +193,7 @@ class View : public AcceleratorTarget {
// This is the function subclasses should use whenever they need to obtain
// the left position of one of their child views (for example, when
// implementing View::Layout()).
- inline int GetX() const {
+ int GetX() const {
return GetX(IGNORE_MIRRORING_TRANSFORMATION);
};
@@ -209,13 +209,13 @@ class View : public AcceleratorTarget {
// coordinate of a child View.
int GetX(PositionMirroringSettings settings) const;
- inline int GetY() const {
+ int GetY() const {
return bounds_.top;
};
- inline int GetWidth() const {
+ int GetWidth() const {
return bounds_.Width();
};
- inline int GetHeight() const {
+ int GetHeight() const {
return bounds_.Height();
};
@@ -306,10 +306,7 @@ class View : public AcceleratorTarget {
// Indicates whether the UI layout for this view is right-to-left. The view
// has an RTL UI layout if RTL hasn't been disabled for the view and if the
// locale's language is an RTL language.
- bool UILayoutIsRightToLeft() const {
- return (ui_mirroring_is_enabled_for_rtl_languages_ &&
- l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT);
- }
+ bool UILayoutIsRightToLeft() const;
// Enables or disables the right-to-left layout for the view. If |enable| is
// true, the layout will become right-to-left only if the locale's language
@@ -356,7 +353,7 @@ class View : public AcceleratorTarget {
// UI mirroring is transparent to most View subclasses and therefore there is
// no need to call this routine from anywhere within your subclass
// implementation.
- inline int View::MirroredX() const;
+ int View::MirroredX() const;
// Given a rectangle specified in this View's coordinate system, the function
// computes the 'left' value for the mirrored rectangle within this View. If
@@ -1291,7 +1288,7 @@ class View : public AcceleratorTarget {
View* previous_focusable_view_;
// The list of accelerators.
- scoped_ptr<std::vector<Accelerator>> accelerators_;
+ scoped_ptr<std::vector<Accelerator> > accelerators_;
// The task used to restore automatically the focus to the last focused
// floating view.
@@ -1315,9 +1312,9 @@ class View : public AcceleratorTarget {
// right-to-left locales for this View.
bool flip_canvas_on_paint_for_rtl_ui_;
- DISALLOW_EVIL_CONSTRUCTORS(View);
+ DISALLOW_COPY_AND_ASSIGN(View);
};
-}
+} // namespace ChromeViews
-#endif // CHROME_VIEWS_VIEW_H__
+#endif // CHROME_VIEWS_VIEW_H_
diff --git a/chrome/views/view_container.h b/chrome/views/view_container.h
index daf106c..65269bb 100644
--- a/chrome/views/view_container.h
+++ b/chrome/views/view_container.h
@@ -27,12 +27,17 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef CHROME_VIEWS_VIEW_CONTAINER_H__
-#define CHROME_VIEWS_VIEW_CONTAINER_H__
+#ifndef CHROME_VIEWS_VIEW_CONTAINER_H_
+#define CHROME_VIEWS_VIEW_CONTAINER_H_
-#include <atlbase.h>
-#include <atlapp.h>
-#include <atlmisc.h>
+// TODO(maruel): Remove once HWND is abstracted.
+#include <windows.h>
+
+// TODO(maruel): Remove once gfx::Rect is used instead.
+namespace WTL {
+class CRect;
+}
+using WTL::CRect;
namespace ChromeViews {
@@ -59,6 +64,7 @@ class Accelerator;
class ViewContainer {
public:
+ virtual ~ViewContainer() { }
// Returns the bounds of this container in the screen coordinate system.
// If the receiving view container is a frame which is larger than its
@@ -96,11 +102,9 @@ class ViewContainer {
// Returns the accelerator given a command id. Returns false if there is
// no accelerator associated with a given id, which is a common condition.
virtual bool GetAccelerator(int cmd_id,
- ChromeViews::Accelerator* accelerator) = 0;
+ Accelerator* accelerator) = 0;
};
+} // namespace ChromeViews
-
-}
-
-#endif // CHROME_VIEWS_VIEW_CONTAINER_H__
+#endif // CHROME_VIEWS_VIEW_CONTAINER_H_
diff --git a/chrome/views/view_unittest.cc b/chrome/views/view_unittest.cc
index 9ecc585..284b9f5 100644
--- a/chrome/views/view_unittest.cc
+++ b/chrome/views/view_unittest.cc
@@ -27,15 +27,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include <atlbase.h>
-#include <atlapp.h>
-#include <atlmisc.h>
-#include <atlcrack.h>
-#include <atlwin.h>
-
#include "chrome/common/gfx/chrome_canvas.h"
#include "chrome/views/background.h"
#include "chrome/views/event.h"
+#include "chrome/views/root_view.h"
#include "chrome/views/view.h"
#include "chrome/views/window.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/views/views.vcproj b/chrome/views/views.vcproj
index 4baf1be..ff56556 100644
--- a/chrome/views/views.vcproj
+++ b/chrome/views/views.vcproj
@@ -286,6 +286,10 @@
>
</File>
<File
+ RelativePath=".\dialog_delegate.cc"
+ >
+ </File>
+ <File
RelativePath=".\dialog_delegate.h"
>
</File>
@@ -618,6 +622,10 @@
>
</File>
<File
+ RelativePath=".\window_delegate.cc"
+ >
+ </File>
+ <File
RelativePath=".\window_delegate.h"
>
</File>
diff --git a/chrome/views/window.cc b/chrome/views/window.cc
index 72b365d..681a802 100644
--- a/chrome/views/window.cc
+++ b/chrome/views/window.cc
@@ -29,16 +29,20 @@
#include "chrome/views/window.h"
+#include "base/win_util.h"
#include "chrome/app/chrome_dll_resource.h"
// TODO(beng): some day make this unfortunate dependency not exist.
#include "chrome/browser/browser_list.h"
+#include "chrome/common/gfx/chrome_font.h"
#include "chrome/common/gfx/icon_util.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/pref_service.h"
#include "chrome/common/resource_bundle.h"
#include "chrome/common/win_util.h"
+#include "chrome/views/client_view.h"
#include "chrome/views/custom_frame_window.h"
#include "chrome/views/non_client_view.h"
+#include "chrome/views/root_view.h"
#include "chrome/views/window_delegate.h"
#include "generated_resources.h"
diff --git a/chrome/views/window_delegate.cc b/chrome/views/window_delegate.cc
new file mode 100644
index 0000000..0613ca4
--- /dev/null
+++ b/chrome/views/window_delegate.cc
@@ -0,0 +1,54 @@
+// Copyright 2008, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "chrome/views/window_delegate.h"
+
+#include "chrome/views/client_view.h"
+#include "chrome/views/window.h"
+#include "skia/include/SkBitmap.h"
+
+namespace ChromeViews {
+
+WindowDelegate::WindowDelegate() {
+}
+
+WindowDelegate::~WindowDelegate() {
+ window_.release();
+}
+
+// Returns the icon to be displayed in the window.
+SkBitmap WindowDelegate::GetWindowIcon() {
+ return SkBitmap();
+}
+
+ClientView* WindowDelegate::CreateClientView(Window* window) {
+ return new ClientView(window, GetContentsView());
+}
+
+} // namespace ChromeViews
diff --git a/chrome/views/window_delegate.h b/chrome/views/window_delegate.h
index 67990a0..1d97b1b 100644
--- a/chrome/views/window_delegate.h
+++ b/chrome/views/window_delegate.h
@@ -27,22 +27,27 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef CHROME_VIEWS_WINDOW_DELEGATE_H__
-#define CHROME_VIEWS_WINDOW_DELEGATE_H__
+#ifndef CHROME_VIEWS_WINDOW_DELEGATE_H_
+#define CHROME_VIEWS_WINDOW_DELEGATE_H_
-#include <atlbase.h>
-#include <atlapp.h>
-#include <atlmisc.h>
#include <string>
-#include "chrome/views/client_view.h"
-#include "chrome/views/window.h"
-#include "skia/include/SkBitmap.h"
+#include "base/scoped_ptr.h"
+
+class SkBitmap;
+
+// TODO(maruel): Remove once gfx::Rect is used instead.
+namespace WTL {
+class CRect;
+}
+using WTL::CRect;
namespace ChromeViews {
+class ClientView;
class DialogDelegate;
class View;
+class Window;
///////////////////////////////////////////////////////////////////////////////
//
@@ -55,9 +60,8 @@ class View;
///////////////////////////////////////////////////////////////////////////////
class WindowDelegate {
public:
- virtual ~WindowDelegate() {
- window_.release();
- }
+ WindowDelegate();
+ virtual ~WindowDelegate();
virtual DialogDelegate* AsDialogDelegate() { return NULL; }
@@ -106,9 +110,7 @@ class WindowDelegate {
}
// Returns the icon to be displayed in the window.
- virtual SkBitmap GetWindowIcon() {
- return SkBitmap();
- }
+ virtual SkBitmap GetWindowIcon();
// Returns true if a window icon should be shown.
virtual bool ShouldShowWindowIcon() const {
@@ -142,9 +144,7 @@ class WindowDelegate {
// Called by the Window to create the Client View used to host the contents
// of the window.
- virtual ClientView* CreateClientView(Window* window) {
- return new ClientView(window, GetContentsView());
- }
+ virtual ClientView* CreateClientView(Window* window);
// An accessor to the Window this delegate is bound to.
Window* window() const { return window_.get(); }
@@ -161,4 +161,4 @@ class WindowDelegate {
} // namespace ChromeViews
-#endif // #ifndef CHROME_VIEWS_WINDOW_DELEGATE_H__
+#endif // CHROME_VIEWS_WINDOW_DELEGATE_H_