Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: chrome/browser/ui/webui/uber/uber_ui.cc

Issue 2651793009: Convert UberUI to use the new navigation callbacks. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/webui/uber/uber_ui.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/webui/uber/uber_ui.h" 5 #include "chrome/browser/ui/webui/uber/uber_ui.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" 11 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h"
12 #include "chrome/browser/ui/webui/extensions/extensions_ui.h" 12 #include "chrome/browser/ui/webui/extensions/extensions_ui.h"
13 #include "chrome/browser/ui/webui/log_web_ui_url.h" 13 #include "chrome/browser/ui/webui/log_web_ui_url.h"
14 #include "chrome/browser/ui/webui/md_history_ui.h" 14 #include "chrome/browser/ui/webui/md_history_ui.h"
15 #include "chrome/browser/ui/webui/options/options_ui.h" 15 #include "chrome/browser/ui/webui/options/options_ui.h"
16 #include "chrome/common/chrome_features.h" 16 #include "chrome/common/chrome_features.h"
17 #include "chrome/common/chrome_switches.h" 17 #include "chrome/common/chrome_switches.h"
18 #include "chrome/common/extensions/chrome_manifest_url_handlers.h" 18 #include "chrome/common/extensions/chrome_manifest_url_handlers.h"
19 #include "chrome/common/url_constants.h" 19 #include "chrome/common/url_constants.h"
20 #include "chrome/grit/browser_resources.h" 20 #include "chrome/grit/browser_resources.h"
21 #include "chrome/grit/chromium_strings.h" 21 #include "chrome/grit/chromium_strings.h"
22 #include "chrome/grit/generated_resources.h" 22 #include "chrome/grit/generated_resources.h"
23 #include "components/strings/grit/components_strings.h" 23 #include "components/strings/grit/components_strings.h"
24 #include "content/public/browser/browser_context.h" 24 #include "content/public/browser/browser_context.h"
25 #include "content/public/browser/navigation_controller.h" 25 #include "content/public/browser/navigation_controller.h"
26 #include "content/public/browser/navigation_entry.h" 26 #include "content/public/browser/navigation_entry.h"
27 #include "content/public/browser/navigation_handle.h"
27 #include "content/public/browser/notification_source.h" 28 #include "content/public/browser/notification_source.h"
28 #include "content/public/browser/web_contents.h" 29 #include "content/public/browser/web_contents.h"
29 #include "content/public/browser/web_ui.h" 30 #include "content/public/browser/web_ui.h"
30 #include "content/public/browser/web_ui_data_source.h" 31 #include "content/public/browser/web_ui_data_source.h"
31 #include "content/public/common/browser_side_navigation_policy.h" 32 #include "content/public/common/browser_side_navigation_policy.h"
32 #include "extensions/browser/extension_registry.h" 33 #include "extensions/browser/extension_registry.h"
33 #include "extensions/common/extension_set.h" 34 #include "extensions/common/extension_set.h"
34 35
35 using content::NavigationController; 36 using content::NavigationController;
36 using content::NavigationEntry; 37 using content::NavigationEntry;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 base::StringValue(overrides_history ? "yes" : "no")); 138 base::StringValue(overrides_history ? "yes" : "no"));
138 } 139 }
139 140
140 } // namespace 141 } // namespace
141 142
142 SubframeLogger::SubframeLogger(content::WebContents* contents) 143 SubframeLogger::SubframeLogger(content::WebContents* contents)
143 : WebContentsObserver(contents) {} 144 : WebContentsObserver(contents) {}
144 145
145 SubframeLogger::~SubframeLogger() {} 146 SubframeLogger::~SubframeLogger() {}
146 147
147 void SubframeLogger::DidCommitProvisionalLoadForFrame( 148 void SubframeLogger::DidFinishNavigation(
148 content::RenderFrameHost* render_frame_host, 149 content::NavigationHandle* navigation_handle) {
149 const GURL& url, 150 if (!navigation_handle->HasCommitted())
150 ui::PageTransition transition_type) { 151 return;
152
153 const GURL& url = navigation_handle->GetURL();
151 if (url == chrome::kChromeUIExtensionsFrameURL || 154 if (url == chrome::kChromeUIExtensionsFrameURL ||
152 url == chrome::kChromeUIHelpFrameURL || 155 url == chrome::kChromeUIHelpFrameURL ||
153 url == chrome::kChromeUIHistoryFrameURL || 156 url == chrome::kChromeUIHistoryFrameURL ||
154 url == chrome::kChromeUISettingsFrameURL || 157 url == chrome::kChromeUISettingsFrameURL ||
155 url == chrome::kChromeUIUberFrameURL) { 158 url == chrome::kChromeUIUberFrameURL) {
156 webui::LogWebUIUrl(url); 159 webui::LogWebUIUrl(url);
157 } 160 }
158 } 161 }
159 162
160 UberUI::UberUI(content::WebUI* web_ui) : WebUIController(web_ui) { 163 UberUI::UberUI(content::WebUI* web_ui) : WebUIController(web_ui) {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 // opens the default history page if one is uninstalled or disabled. 251 // opens the default history page if one is uninstalled or disabled.
249 UpdateHistoryNavigation(web_ui()); 252 UpdateHistoryNavigation(web_ui());
250 } 253 }
251 254
252 void UberFrameUI::OnExtensionUnloaded( 255 void UberFrameUI::OnExtensionUnloaded(
253 content::BrowserContext* browser_context, 256 content::BrowserContext* browser_context,
254 const extensions::Extension* extension, 257 const extensions::Extension* extension,
255 extensions::UnloadedExtensionInfo::Reason reason) { 258 extensions::UnloadedExtensionInfo::Reason reason) {
256 UpdateHistoryNavigation(web_ui()); 259 UpdateHistoryNavigation(web_ui());
257 } 260 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/uber/uber_ui.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698