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

Side by Side Diff: mojo/examples/window_manager/debug_panel.cc

Issue 658923003: Remove dependency on ui from view_manager. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebase Created 6 years, 2 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "mojo/examples/window_manager/debug_panel.h" 5 #include "mojo/examples/window_manager/debug_panel.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "mojo/services/public/cpp/view_manager/view.h" 9 #include "mojo/services/public/cpp/view_manager/view.h"
10 #include "mojo/views/native_widget_view_manager.h" 10 #include "mojo/views/native_widget_view_manager.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 widget_delegate->GetContentsView()->AddChildView(colored_square_); 58 widget_delegate->GetContentsView()->AddChildView(colored_square_);
59 widget_delegate->GetContentsView()->AddChildView(close_last_); 59 widget_delegate->GetContentsView()->AddChildView(close_last_);
60 widget_delegate->GetContentsView()->AddChildView(cross_app_); 60 widget_delegate->GetContentsView()->AddChildView(cross_app_);
61 widget_delegate->GetContentsView()->SetLayoutManager(this); 61 widget_delegate->GetContentsView()->SetLayoutManager(this);
62 62
63 views::Widget* widget = new views::Widget(); 63 views::Widget* widget = new views::Widget();
64 views::Widget::InitParams params( 64 views::Widget::InitParams params(
65 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); 65 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
66 params.native_widget = new NativeWidgetViewManager(widget, shell, view); 66 params.native_widget = new NativeWidgetViewManager(widget, shell, view);
67 params.delegate = widget_delegate; 67 params.delegate = widget_delegate;
68 params.bounds = gfx::Rect(view->bounds().size()); 68 params.bounds = gfx::Rect(0, 0, view->bounds().width, view->bounds().height);
69 widget->Init(params); 69 widget->Init(params);
70 widget->Show(); 70 widget->Show();
71 } 71 }
72 72
73 DebugPanel::~DebugPanel() { 73 DebugPanel::~DebugPanel() {
74 } 74 }
75 75
76 gfx::Size DebugPanel::GetPreferredSize(const views::View* view) const { 76 gfx::Size DebugPanel::GetPreferredSize(const views::View* view) const {
77 return gfx::Size(); 77 return gfx::Size();
78 } 78 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 } 129 }
130 130
131 void DebugPanel::Navigate(const std::string& url) { 131 void DebugPanel::Navigate(const std::string& url) {
132 URLRequestPtr request(URLRequest::New()); 132 URLRequestPtr request(URLRequest::New());
133 request->url = url; 133 request->url = url;
134 delegate_->RequestNavigate(view_->id(), TARGET_NEW_NODE, request.Pass()); 134 delegate_->RequestNavigate(view_->id(), TARGET_NEW_NODE, request.Pass());
135 } 135 }
136 136
137 } // namespace examples 137 } // namespace examples
138 } // namespace mojo 138 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698