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

Side by Side Diff: ash/shell/window_type_launcher.cc

Issue 2859193004: Remove GridLayout::SetInsets in favor of an empty border on the host. (Closed)
Patch Set: missed a merge problem Created 3 years, 7 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 | « no previous file | chrome/browser/chromeos/profiles/multiprofiles_session_aborted_dialog.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) 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 "ash/shell/window_type_launcher.h" 5 #include "ash/shell/window_type_launcher.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/public/cpp/shell_window_ids.h" 9 #include "ash/public/cpp/shell_window_ids.h"
10 #include "ash/root_window_controller.h" 10 #include "ash/root_window_controller.h"
11 #include "ash/session/session_controller.h" 11 #include "ash/session/session_controller.h"
12 #include "ash/shell.h" 12 #include "ash/shell.h"
13 #include "ash/shell/example_factory.h" 13 #include "ash/shell/example_factory.h"
14 #include "ash/shell/panel_window.h" 14 #include "ash/shell/panel_window.h"
15 #include "ash/shell/toplevel_window.h" 15 #include "ash/shell/toplevel_window.h"
16 #include "ash/system/status_area_widget.h" 16 #include "ash/system/status_area_widget.h"
17 #include "ash/system/web_notification/web_notification_tray.h" 17 #include "ash/system/web_notification/web_notification_tray.h"
18 #include "ash/test/child_modal_window.h" 18 #include "ash/test/child_modal_window.h"
19 #include "base/strings/utf_string_conversions.h" 19 #include "base/strings/utf_string_conversions.h"
20 #include "ui/aura/window.h" 20 #include "ui/aura/window.h"
21 #include "ui/aura/window_event_dispatcher.h" 21 #include "ui/aura/window_event_dispatcher.h"
22 #include "ui/compositor/layer.h" 22 #include "ui/compositor/layer.h"
23 #include "ui/gfx/canvas.h" 23 #include "ui/gfx/canvas.h"
24 #include "ui/message_center/message_center.h" 24 #include "ui/message_center/message_center.h"
25 #include "ui/message_center/notification_types.h" 25 #include "ui/message_center/notification_types.h"
26 #include "ui/views/border.h"
26 #include "ui/views/controls/button/md_text_button.h" 27 #include "ui/views/controls/button/md_text_button.h"
27 #include "ui/views/controls/menu/menu_item_view.h" 28 #include "ui/views/controls/menu/menu_item_view.h"
28 #include "ui/views/controls/menu/menu_runner.h" 29 #include "ui/views/controls/menu/menu_runner.h"
29 #include "ui/views/layout/grid_layout.h" 30 #include "ui/views/layout/grid_layout.h"
30 #include "ui/views/widget/widget.h" 31 #include "ui/views/widget/widget.h"
31 #include "ui/wm/core/shadow_types.h" 32 #include "ui/wm/core/shadow_types.h"
32 33
33 using views::MdTextButton; 34 using views::MdTextButton;
34 using views::MenuItemView; 35 using views::MenuItemView;
35 using views::MenuRunner; 36 using views::MenuRunner;
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 examples_button_(MdTextButton::Create( 200 examples_button_(MdTextButton::Create(
200 this, 201 this,
201 base::ASCIIToUTF16("Open Views Examples Window"))), 202 base::ASCIIToUTF16("Open Views Examples Window"))),
202 show_hide_window_button_( 203 show_hide_window_button_(
203 MdTextButton::Create(this, base::ASCIIToUTF16("Show/Hide a Window"))), 204 MdTextButton::Create(this, base::ASCIIToUTF16("Show/Hide a Window"))),
204 show_web_notification_(MdTextButton::Create( 205 show_web_notification_(MdTextButton::Create(
205 this, 206 this,
206 base::ASCIIToUTF16("Show a web/app notification"))), 207 base::ASCIIToUTF16("Show a web/app notification"))),
207 show_views_examples_callback_(show_views_examples_callback) { 208 show_views_examples_callback_(show_views_examples_callback) {
208 views::GridLayout* layout = new views::GridLayout(this); 209 views::GridLayout* layout = new views::GridLayout(this);
209 layout->SetInsets(5, 5, 5, 5);
210 SetLayoutManager(layout); 210 SetLayoutManager(layout);
211 SetBorder(views::CreateEmptyBorder(gfx::Insets(5)));
211 views::ColumnSet* column_set = layout->AddColumnSet(0); 212 views::ColumnSet* column_set = layout->AddColumnSet(0);
212 column_set->AddColumn(views::GridLayout::LEADING, views::GridLayout::CENTER, 213 column_set->AddColumn(views::GridLayout::LEADING, views::GridLayout::CENTER,
213 0, views::GridLayout::USE_PREF, 0, 0); 214 0, views::GridLayout::USE_PREF, 0, 0);
214 AddViewToLayout(layout, create_button_); 215 AddViewToLayout(layout, create_button_);
215 AddViewToLayout(layout, panel_button_); 216 AddViewToLayout(layout, panel_button_);
216 AddViewToLayout(layout, create_nonresizable_button_); 217 AddViewToLayout(layout, create_nonresizable_button_);
217 AddViewToLayout(layout, bubble_button_); 218 AddViewToLayout(layout, bubble_button_);
218 AddViewToLayout(layout, lock_button_); 219 AddViewToLayout(layout, lock_button_);
219 AddViewToLayout(layout, widgets_button_); 220 AddViewToLayout(layout, widgets_button_);
220 AddViewToLayout(layout, system_modal_button_); 221 AddViewToLayout(layout, system_modal_button_);
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 MenuItemView::NORMAL); 330 MenuItemView::NORMAL);
330 // MenuRunner takes ownership of root. 331 // MenuRunner takes ownership of root.
331 menu_runner_.reset(new MenuRunner( 332 menu_runner_.reset(new MenuRunner(
332 root, MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU)); 333 root, MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU));
333 menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(point, gfx::Size()), 334 menu_runner_->RunMenuAt(GetWidget(), NULL, gfx::Rect(point, gfx::Size()),
334 views::MENU_ANCHOR_TOPLEFT, source_type); 335 views::MENU_ANCHOR_TOPLEFT, source_type);
335 } 336 }
336 337
337 } // namespace shell 338 } // namespace shell
338 } // namespace ash 339 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/profiles/multiprofiles_session_aborted_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698