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

Side by Side Diff: mojo/examples/launcher/launcher.cc

Issue 286733002: [Refactor] Consolidate the logic for whether a widget can be activated. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.cc ('k') | ui/views/bubble/bubble_delegate.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <stdio.h> 5 #include <stdio.h>
6 #include <string> 6 #include <string>
7 7
8 #include "base/at_exit.h" 8 #include "base/at_exit.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 class LauncherController : public views::TextfieldController { 143 class LauncherController : public views::TextfieldController {
144 public: 144 public:
145 explicit LauncherController(URLReceiver* url_receiver) 145 explicit LauncherController(URLReceiver* url_receiver)
146 : url_receiver_(url_receiver) {} 146 : url_receiver_(url_receiver) {}
147 147
148 void InitInWindow(aura::Window* parent) { 148 void InitInWindow(aura::Window* parent) {
149 views::Widget* widget = new views::Widget; 149 views::Widget* widget = new views::Widget;
150 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); 150 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP);
151 params.parent = parent; 151 params.parent = parent;
152 params.bounds = parent->bounds(); 152 params.bounds = parent->bounds();
153 params.can_activate = true; 153 params.activatable = views::Widget::InitParams::ACTIVATABLE_YES;
154 widget->Init(params); 154 widget->Init(params);
155 155
156 views::View* container = new views::View; 156 views::View* container = new views::View;
157 container->set_background( 157 container->set_background(
158 views::Background::CreateSolidBackground(SK_ColorYELLOW)); 158 views::Background::CreateSolidBackground(SK_ColorYELLOW));
159 container->SetBorder( 159 container->SetBorder(
160 views::Border::CreateEmptyBorder(10, 10, 10, 10)); 160 views::Border::CreateEmptyBorder(10, 10, 10, 10));
161 container->SetLayoutManager(new views::FillLayout); 161 container->SetLayoutManager(new views::FillLayout);
162 widget->SetContentsView(container); 162 widget->SetContentsView(container);
163 163
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 // Aura that doesn't define platform-specific stuff. 286 // Aura that doesn't define platform-specific stuff.
287 aura::Env::CreateInstance(true); 287 aura::Env::CreateInstance(true);
288 288
289 mojo::Application app(shell_handle); 289 mojo::Application app(shell_handle);
290 app.AddServiceConnector( 290 app.AddServiceConnector(
291 new mojo::ServiceConnector<mojo::examples::LauncherImpl>()); 291 new mojo::ServiceConnector<mojo::examples::LauncherImpl>());
292 292
293 loop.Run(); 293 loop.Run();
294 return MOJO_RESULT_OK; 294 return MOJO_RESULT_OK;
295 } 295 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.cc ('k') | ui/views/bubble/bubble_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698