move constants to atom_constants.h
This commit is contained in:
parent
671a8a2cd6
commit
e90fd1444f
7 changed files with 27 additions and 22 deletions
|
@ -7,6 +7,7 @@
|
|||
#include <string>
|
||||
|
||||
#include "atom/browser/ui/webui/pdf_viewer_ui.h"
|
||||
#include "atom/common/atom_constants.h"
|
||||
#include "base/strings/string_split.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
|
@ -25,7 +26,7 @@ AtomWebUIControllerFactory::~AtomWebUIControllerFactory() {}
|
|||
content::WebUI::TypeID AtomWebUIControllerFactory::GetWebUIType(
|
||||
content::BrowserContext* browser_context,
|
||||
const GURL& url) const {
|
||||
if (url.host() == PdfViewerUI::kHost) {
|
||||
if (url.host() == kPdfViewerUIHost) {
|
||||
return const_cast<AtomWebUIControllerFactory*>(this);
|
||||
}
|
||||
|
||||
|
@ -47,14 +48,14 @@ bool AtomWebUIControllerFactory::UseWebUIBindingsForURL(
|
|||
content::WebUIController*
|
||||
AtomWebUIControllerFactory::CreateWebUIControllerForURL(content::WebUI* web_ui,
|
||||
const GURL& url) const {
|
||||
if (url.host() == PdfViewerUI::kHost) {
|
||||
if (url.host() == kPdfViewerUIHost) {
|
||||
base::StringPairs toplevel_params;
|
||||
base::SplitStringIntoKeyValuePairs(url.query(), '=', '&', &toplevel_params);
|
||||
std::string view_id, src;
|
||||
for (const auto& param : toplevel_params) {
|
||||
if (param.first == PdfViewerUI::kId) {
|
||||
if (param.first == kPdfViewerUIId) {
|
||||
view_id = param.second;
|
||||
} else if (param.first == PdfViewerUI::kSrc) {
|
||||
} else if (param.first == kPdfPluginSrc) {
|
||||
src = param.second;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue