Index: mojo/examples/window_manager/window_manager.cc |
diff --git a/mojo/examples/window_manager/window_manager.cc b/mojo/examples/window_manager/window_manager.cc |
index 1f4e597d472a123cbade3544d112f1ec9195f437..c850886f63e796f524ea7ae34e43a5e2e1bf0e4f 100644 |
--- a/mojo/examples/window_manager/window_manager.cc |
+++ b/mojo/examples/window_manager/window_manager.cc |
@@ -72,7 +72,7 @@ class WindowManagerConnection : public InterfaceImpl<IWindowManager> { |
DISALLOW_COPY_AND_ASSIGN(WindowManagerConnection); |
}; |
-class NavigatorHost : public InterfaceImpl<navigation::NavigatorHost> { |
+class NavigatorHost : public InterfaceImpl<mojo::NavigatorHost> { |
darin (slow to review)
2014/07/25 03:37:29
nit: class NavigatorHostImpl
|
public: |
explicit NavigatorHost(WindowManager* window_manager) |
: window_manager_(window_manager) {} |
@@ -84,8 +84,8 @@ class NavigatorHost : public InterfaceImpl<navigation::NavigatorHost> { |
const mojo::String& url) OVERRIDE; |
virtual void RequestNavigate( |
uint32 source_node_id, |
- navigation::Target target, |
- navigation::NavigationDetailsPtr nav_details) OVERRIDE; |
+ Target target, |
+ NavigationDetailsPtr nav_details) OVERRIDE; |
WindowManager* window_manager_; |
DISALLOW_COPY_AND_ASSIGN(NavigatorHost); |
@@ -317,8 +317,8 @@ class WindowManager |
virtual void RequestNavigate( |
uint32 source_node_id, |
- navigation::Target target, |
- navigation::NavigationDetailsPtr nav_details) OVERRIDE { |
+ Target target, |
+ NavigationDetailsPtr nav_details) OVERRIDE { |
launcher_->Launch(nav_details->url, |
base::Bind(&WindowManager::OnLaunch, |
base::Unretained(this), |
@@ -337,7 +337,7 @@ class WindowManager |
virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) |
MOJO_OVERRIDE { |
connection->AddService<IWindowManager>(this); |
- connection->AddService<navigation::NavigatorHost>(this); |
+ connection->AddService<mojo::NavigatorHost>(this); |
connection->AddService(&view_manager_client_factory_); |
return true; |
} |
@@ -376,8 +376,8 @@ class WindowManager |
// Overridden from WindowManagerDelegate: |
virtual void Embed(const String& url) OVERRIDE { |
CreateWindow(url, |
- navigation::NavigationDetailsPtr().Pass(), |
- navigation::ResponseDetailsPtr().Pass()); |
+ NavigationDetailsPtr().Pass(), |
+ ResponseDetailsPtr().Pass()); |
} |
virtual void DispatchEvent(View* target, EventPtr event) OVERRIDE { |
// TODO(beng): More sophisticated focus handling than this is required! |
@@ -390,27 +390,26 @@ class WindowManager |
void OnLaunch( |
uint32 source_node_id, |
- navigation::Target requested_target, |
+ Target requested_target, |
const mojo::String& handler_url, |
const mojo::String& view_url, |
- navigation::ResponseDetailsPtr response) { |
- navigation::NavigationDetailsPtr nav_details( |
- navigation::NavigationDetails::New()); |
+ ResponseDetailsPtr response) { |
+ NavigationDetailsPtr nav_details(NavigationDetails::New()); |
nav_details->url = view_url; |
- navigation::Target target = debug_panel_->navigation_target(); |
- if (target == navigation::TARGET_DEFAULT) { |
- if (requested_target != navigation::TARGET_DEFAULT) { |
+ Target target = debug_panel_->navigation_target(); |
+ if (target == TARGET_DEFAULT) { |
+ if (requested_target != TARGET_DEFAULT) { |
target = requested_target; |
} else { |
// TODO(aa): Should be TARGET_NEW_NODE if source origin and dest origin |
// are different? |
- target = navigation::TARGET_SOURCE_NODE; |
+ target = TARGET_SOURCE_NODE; |
} |
} |
Node* dest_node = NULL; |
- if (target == navigation::TARGET_SOURCE_NODE) { |
+ if (target == TARGET_SOURCE_NODE) { |
Node* source_node = view_manager_->GetNodeById(source_node_id); |
bool app_initiated = std::find(windows_.begin(), windows_.end(), |
source_node) != windows_.end(); |
@@ -428,8 +427,8 @@ class WindowManager |
// TODO(beng): proper layout manager!! |
Id CreateLauncherUI() { |
- navigation::NavigationDetailsPtr nav_details; |
- navigation::ResponseDetailsPtr response; |
+ NavigationDetailsPtr nav_details; |
+ ResponseDetailsPtr response; |
Node* node = view_manager_->GetNodeById(content_node_id_); |
gfx::Rect bounds = node->bounds(); |
bounds.Inset(kBorderInset, kBorderInset); |
@@ -440,8 +439,8 @@ class WindowManager |
} |
void CreateWindow(const std::string& handler_url, |
- navigation::NavigationDetailsPtr nav_details, |
- navigation::ResponseDetailsPtr response) { |
+ NavigationDetailsPtr nav_details, |
+ ResponseDetailsPtr response) { |
Node* node = view_manager_->GetNodeById(content_node_id_); |
gfx::Rect bounds(kBorderInset, |
2 * kBorderInset + kTextfieldHeight, |
@@ -461,8 +460,8 @@ class WindowManager |
Node* CreateChild(Id parent_id, |
const std::string& url, |
const gfx::Rect& bounds, |
- navigation::NavigationDetailsPtr nav_details, |
- navigation::ResponseDetailsPtr response) { |
+ NavigationDetailsPtr nav_details, |
+ ResponseDetailsPtr response) { |
Node* node = view_manager_->GetNodeById(parent_id); |
Node* embedded = Node::Create(view_manager_); |
node->AddChild(embedded); |
@@ -473,11 +472,11 @@ class WindowManager |
} |
void Embed(Node* node, const std::string& app_url, |
- navigation::NavigationDetailsPtr nav_details, |
- navigation::ResponseDetailsPtr response) { |
+ NavigationDetailsPtr nav_details, |
+ ResponseDetailsPtr response) { |
node->Embed(app_url); |
if (nav_details) { |
- navigation::NavigatorPtr navigator; |
+ NavigatorPtr navigator; |
app_->ConnectToService(app_url, &navigator); |
navigator->Navigate(node->id(), nav_details.Pass(), response.Pass()); |
} |
@@ -508,7 +507,7 @@ class WindowManager |
scoped_ptr<ViewsInit> views_init_; |
DebugPanel* debug_panel_; |
- launcher::LauncherPtr launcher_; |
+ LauncherPtr launcher_; |
Node* launcher_ui_; |
std::vector<Node*> windows_; |
ViewManager* view_manager_; |
@@ -543,8 +542,8 @@ void NavigatorHost::DidNavigateLocally(uint32 source_node_id, |
void NavigatorHost::RequestNavigate( |
uint32 source_node_id, |
- navigation::Target target, |
- navigation::NavigationDetailsPtr nav_details) { |
+ Target target, |
+ NavigationDetailsPtr nav_details) { |
window_manager_->RequestNavigate(source_node_id, target, nav_details.Pass()); |
} |