OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/extensions/extension_dom_ui.h" | 5 #include "chrome/browser/extensions/extension_dom_ui.h" |
6 | 6 |
7 #include "chrome/browser/browser.h" | 7 #include "chrome/browser/browser.h" |
8 #include "chrome/browser/browser_list.h" | 8 #include "chrome/browser/browser_list.h" |
9 #include "chrome/browser/profile.h" | 9 #include "chrome/browser/profile.h" |
10 #include "chrome/browser/tab_contents/tab_contents.h" | 10 #include "chrome/browser/tab_contents/tab_contents.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 should_hide_url_ = false; | 33 should_hide_url_ = false; |
34 } | 34 } |
35 } | 35 } |
36 } | 36 } |
37 | 37 |
38 void ExtensionDOMUI::ResetExtensionFunctionDispatcher( | 38 void ExtensionDOMUI::ResetExtensionFunctionDispatcher( |
39 RenderViewHost* render_view_host) { | 39 RenderViewHost* render_view_host) { |
40 // Use the NavigationController to get the URL rather than the TabContents | 40 // Use the NavigationController to get the URL rather than the TabContents |
41 // since this is the real underlying URL (see HandleChromeURLOverride). | 41 // since this is the real underlying URL (see HandleChromeURLOverride). |
42 NavigationController& controller = tab_contents()->controller(); | 42 NavigationController& controller = tab_contents()->controller(); |
43 const GURL& url = controller.pending_entry()->url(); | 43 const GURL& url = controller.GetActiveEntry()->url(); |
44 extension_function_dispatcher_.reset( | 44 extension_function_dispatcher_.reset( |
45 new ExtensionFunctionDispatcher(render_view_host, this, url)); | 45 new ExtensionFunctionDispatcher(render_view_host, this, url)); |
46 } | 46 } |
47 | 47 |
48 void ExtensionDOMUI::RenderViewCreated(RenderViewHost* render_view_host) { | 48 void ExtensionDOMUI::RenderViewCreated(RenderViewHost* render_view_host) { |
49 ResetExtensionFunctionDispatcher(render_view_host); | 49 ResetExtensionFunctionDispatcher(render_view_host); |
50 } | 50 } |
51 | 51 |
52 void ExtensionDOMUI::RenderViewReused(RenderViewHost* render_view_host) { | 52 void ExtensionDOMUI::RenderViewReused(RenderViewHost* render_view_host) { |
53 ResetExtensionFunctionDispatcher(render_view_host); | 53 ResetExtensionFunctionDispatcher(render_view_host); |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 if (!all_overrides->GetList(*iter, &page_overrides)) { | 242 if (!all_overrides->GetList(*iter, &page_overrides)) { |
243 // If it's being unregistered, it should already be in the list. | 243 // If it's being unregistered, it should already be in the list. |
244 NOTREACHED(); | 244 NOTREACHED(); |
245 continue; | 245 continue; |
246 } else { | 246 } else { |
247 UnregisterAndReplaceOverride(WideToUTF8(*iter), profile, page_overrides, | 247 UnregisterAndReplaceOverride(WideToUTF8(*iter), profile, page_overrides, |
248 val); | 248 val); |
249 } | 249 } |
250 } | 250 } |
251 } | 251 } |
OLD | NEW |