summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/frame_util.cc27
-rw-r--r--chrome/browser/frame_util.h3
-rw-r--r--chrome/browser/render_view_host.cc4
-rw-r--r--chrome/browser/render_view_host.h3
-rw-r--r--chrome/browser/render_widget_host.cc5
-rw-r--r--chrome/browser/render_widget_host.h5
-rw-r--r--chrome/browser/render_widget_host_hwnd.cc4
-rw-r--r--chrome/browser/render_widget_host_hwnd.h2
-rw-r--r--chrome/browser/vista_frame.cc1
-rw-r--r--chrome/browser/xp_frame.cc1
10 files changed, 18 insertions, 37 deletions
diff --git a/chrome/browser/frame_util.cc b/chrome/browser/frame_util.cc
index 85a1b6f..2cad99b 100644
--- a/chrome/browser/frame_util.cc
+++ b/chrome/browser/frame_util.cc
@@ -156,6 +156,8 @@ bool FrameUtil::LoadAccelerators(BrowserWindow* frame,
// static
bool FrameUtil::ActivateAppModalDialog(Browser* browser) {
+ DCHECK(!g_browser_process->IsUsingNewFrames());
+
// If another browser is app modal, flash and activate the modal browser.
if (BrowserList::IsShowingAppModalDialog()) {
if (browser != BrowserList::GetLastActive()) {
@@ -199,28 +201,3 @@ void FrameUtil::EndSession() {
// down. If any messages are processed we'll likely crash. Exit now.
ExitProcess(ResultCodes::NORMAL_EXIT);
}
-
-
-// static
-void FrameUtil::NotifyTabsOfThemeChange(Browser* browser) {
- if (!browser) {
- NOTREACHED();
- return;
- }
-
- int tab_count = browser->tab_count();
- for (int tab_index = 0; tab_index < tab_count; ++tab_index) {
- TabContents* tab_contents = browser->GetTabContentsAt(tab_index);
- DCHECK(tab_contents != NULL);
-
- WebContents* web_contents = tab_contents->AsWebContents();
- if (!web_contents) {
- continue;
- }
-
- RenderViewHost* render_view_host = web_contents->render_view_host();
- if (render_view_host) {
- render_view_host->OnThemeChanged();
- }
- }
-}
diff --git a/chrome/browser/frame_util.h b/chrome/browser/frame_util.h
index 7b0e2be..74f33ea 100644
--- a/chrome/browser/frame_util.h
+++ b/chrome/browser/frame_util.h
@@ -68,9 +68,6 @@ class FrameUtil {
// this method returns windows is going to kill our process. As such, this
// blocks until the shut-down has been marked as clean.
static void EndSession();
-
- // Notifies all tabs with associated WebContents of theme changes.
- static void NotifyTabsOfThemeChange(Browser* browser);
};
#endif // #ifndef CHROME_BROWSER_FRAME_UTIL_H__
diff --git a/chrome/browser/render_view_host.cc b/chrome/browser/render_view_host.cc
index c37db34..7e9dd5e 100644
--- a/chrome/browser/render_view_host.cc
+++ b/chrome/browser/render_view_host.cc
@@ -1193,7 +1193,3 @@ void RenderViewHost::OnDebugDisconnect() {
}
}
-void RenderViewHost::OnThemeChanged() {
- Send (new ViewMsg_ThemeChanged(routing_id_));
-}
-
diff --git a/chrome/browser/render_view_host.h b/chrome/browser/render_view_host.h
index 7fdbfe0..df158f9 100644
--- a/chrome/browser/render_view_host.h
+++ b/chrome/browser/render_view_host.h
@@ -395,9 +395,6 @@ class RenderViewHost : public RenderWidgetHost {
// and we're necessarily leaving the page.
void UnloadListenerHasFired() { has_unload_listener_ = false; }
- // Invoked on ui theme changes.
- void OnThemeChanged();
-
protected:
// Overridden from RenderWidgetHost:
virtual void UnhandledInputEvent(const WebInputEvent& event);
diff --git a/chrome/browser/render_widget_host.cc b/chrome/browser/render_widget_host.cc
index 9fcfdd2..2e17806 100644
--- a/chrome/browser/render_widget_host.cc
+++ b/chrome/browser/render_widget_host.cc
@@ -831,3 +831,8 @@ void RenderWidgetHost::StartHangMonitorTimeout(int delay) {
void RenderWidgetHost::RendererExited() {
BackingStoreManager::RemoveBackingStore(this);
}
+
+void RenderWidgetHost::SystemThemeChanged() {
+ Send(new ViewMsg_ThemeChanged(routing_id_));
+}
+
diff --git a/chrome/browser/render_widget_host.h b/chrome/browser/render_widget_host.h
index ceefea1..fc539b6 100644
--- a/chrome/browser/render_widget_host.h
+++ b/chrome/browser/render_widget_host.h
@@ -225,6 +225,11 @@ class RenderWidgetHost : public IPC::Channel::Listener {
// process has gone.
void RendererExited();
+ // Called when the system theme changes. At this time all existing native
+ // theme handles are invalid and the renderer must obtain new ones and
+ // repaint.
+ void SystemThemeChanged();
+
protected:
// Called when we an InputEvent was not processed by the renderer.
virtual void UnhandledInputEvent(const WebInputEvent& event) { }
diff --git a/chrome/browser/render_widget_host_hwnd.cc b/chrome/browser/render_widget_host_hwnd.cc
index fb3b2b5..d0adcc3 100644
--- a/chrome/browser/render_widget_host_hwnd.cc
+++ b/chrome/browser/render_widget_host_hwnd.cc
@@ -510,6 +510,10 @@ void RenderWidgetHostHWND::OnInputLangChange(DWORD character_set,
}
}
+void RenderWidgetHostHWND::OnThemeChanged() {
+ render_widget_host_->SystemThemeChanged();
+}
+
LRESULT RenderWidgetHostHWND::OnNotify(int w_param, NMHDR* header) {
if (tooltip_hwnd_ == NULL)
return 0;
diff --git a/chrome/browser/render_widget_host_hwnd.h b/chrome/browser/render_widget_host_hwnd.h
index 3121045..18f5d9d 100644
--- a/chrome/browser/render_widget_host_hwnd.h
+++ b/chrome/browser/render_widget_host_hwnd.h
@@ -104,6 +104,7 @@ class RenderWidgetHostHWND :
MSG_WM_CAPTURECHANGED(OnCaptureChanged)
MSG_WM_CANCELMODE(OnCancelMode)
MSG_WM_INPUTLANGCHANGE(OnInputLangChange)
+ MSG_WM_THEMECHANGED(OnThemeChanged)
MSG_WM_NOTIFY(OnNotify)
MESSAGE_HANDLER(WM_IME_SETCONTEXT, OnImeSetContext)
MESSAGE_HANDLER(WM_IME_STARTCOMPOSITION, OnImeStartComposition)
@@ -173,6 +174,7 @@ class RenderWidgetHostHWND :
void OnCaptureChanged(HWND window);
void OnCancelMode();
void OnInputLangChange(DWORD character_set, HKL input_language_id);
+ void OnThemeChanged();
LRESULT OnNotify(int w_param, NMHDR* header);
LRESULT OnImeSetContext(
UINT message, WPARAM wparam, LPARAM lparam, BOOL& handled);
diff --git a/chrome/browser/vista_frame.cc b/chrome/browser/vista_frame.cc
index 2a910ff..bdd3dbbd 100644
--- a/chrome/browser/vista_frame.cc
+++ b/chrome/browser/vista_frame.cc
@@ -712,7 +712,6 @@ BOOL VistaFrame::OnPowerBroadcast(DWORD power_event, DWORD data) {
void VistaFrame::OnThemeChanged() {
// Notify NativeTheme.
gfx::NativeTheme::instance()->CloseHandles();
- FrameUtil::NotifyTabsOfThemeChange(browser_);
}
void VistaFrame::OnMouseButtonDown(UINT flags, const CPoint& pt) {
diff --git a/chrome/browser/xp_frame.cc b/chrome/browser/xp_frame.cc
index dadab61..6f21f23 100644
--- a/chrome/browser/xp_frame.cc
+++ b/chrome/browser/xp_frame.cc
@@ -1499,7 +1499,6 @@ BOOL XPFrame::OnPowerBroadcast(DWORD power_event, DWORD data) {
void XPFrame::OnThemeChanged() {
// Notify NativeTheme.
gfx::NativeTheme::instance()->CloseHandles();
- FrameUtil::NotifyTabsOfThemeChange(browser_);
}
LRESULT XPFrame::OnAppCommand(