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

Side by Side Diff: chrome/browser/chromeos/frame/panel_controller.cc

Issue 6881107: Rework the way Widget::Init works: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/chromeos/input_method/candidate_window.cc » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/chromeos/frame/panel_controller.h" 5 #include "chrome/browser/chromeos/frame/panel_controller.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 focused_(false), 134 focused_(false),
135 urgent_(false) { 135 urgent_(false) {
136 } 136 }
137 137
138 void PanelController::Init(bool initial_focus, 138 void PanelController::Init(bool initial_focus,
139 const gfx::Rect& window_bounds, 139 const gfx::Rect& window_bounds,
140 XID creator_xid, 140 XID creator_xid,
141 WmIpcPanelUserResizeType resize_type) { 141 WmIpcPanelUserResizeType resize_type) {
142 gfx::Rect title_bounds(0, 0, window_bounds.width(), kTitleHeight); 142 gfx::Rect title_bounds(0, 0, window_bounds.width(), kTitleHeight);
143 143
144 title_window_ = views::Widget::CreateWidget();
144 views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_WINDOW); 145 views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_WINDOW);
145 params.transparent = true; 146 params.transparent = true;
146 title_window_ = views::Widget::CreateWidget(params); 147 params.bounds = title_bounds;
147 title_window_->Init(NULL, title_bounds); 148 title_window_->Init(params);
148 gtk_widget_set_size_request(title_window_->GetNativeView(), 149 gtk_widget_set_size_request(title_window_->GetNativeView(),
149 title_bounds.width(), title_bounds.height()); 150 title_bounds.width(), title_bounds.height());
150 title_ = title_window_->GetNativeView(); 151 title_ = title_window_->GetNativeView();
151 title_xid_ = ui::GetX11WindowFromGtkWidget(title_); 152 title_xid_ = ui::GetX11WindowFromGtkWidget(title_);
152 153
153 WmIpc::instance()->SetWindowType( 154 WmIpc::instance()->SetWindowType(
154 title_, 155 title_,
155 WM_IPC_WINDOW_CHROME_PANEL_TITLEBAR, 156 WM_IPC_WINDOW_CHROME_PANEL_TITLEBAR,
156 NULL); 157 NULL);
157 std::vector<int> type_params; 158 std::vector<int> type_params;
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 views::Button* sender, const views::Event& event) { 443 views::Button* sender, const views::Event& event) {
443 if (panel_controller_ && sender == close_button_) 444 if (panel_controller_ && sender == close_button_)
444 panel_controller_->OnCloseButtonPressed(); 445 panel_controller_->OnCloseButtonPressed();
445 } 446 }
446 447
447 PanelController::TitleContentView::~TitleContentView() { 448 PanelController::TitleContentView::~TitleContentView() {
448 VLOG(1) << "panel: delete " << this; 449 VLOG(1) << "panel: delete " << this;
449 } 450 }
450 451
451 } // namespace chromeos 452 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/input_method/candidate_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698