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

Side by Side Diff: chrome/browser/first_run/try_chrome_dialog_view.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
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 "chrome/browser/first_run/try_chrome_dialog_view.h" 5 #include "chrome/browser/first_run/try_chrome_dialog_view.h"
6 6
7 #include <shellapi.h> 7 #include <shellapi.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 TryChromeDialogView::Result TryChromeDialogView::ShowModal( 79 TryChromeDialogView::Result TryChromeDialogView::ShowModal(
80 const ActiveModalDialogListener& listener) { 80 const ActiveModalDialogListener& listener) {
81 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 81 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
82 82
83 views::ImageView* icon = new views::ImageView(); 83 views::ImageView* icon = new views::ImageView();
84 icon->SetImage(rb.GetNativeImageNamed(IDR_PRODUCT_LOGO_32).ToImageSkia()); 84 icon->SetImage(rb.GetNativeImageNamed(IDR_PRODUCT_LOGO_32).ToImageSkia());
85 gfx::Size icon_size = icon->GetPreferredSize(); 85 gfx::Size icon_size = icon->GetPreferredSize();
86 86
87 // An approximate window size. After Layout() we'll get better bounds. 87 // An approximate window size. After Layout() we'll get better bounds.
88 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); 88 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP);
89 params.can_activate = true; 89 params.activatable = views::Widget::InitParams::ACTIVATABLE_YES;
90 params.bounds = gfx::Rect(310, 200); 90 params.bounds = gfx::Rect(310, 200);
91 popup_ = new views::Widget; 91 popup_ = new views::Widget;
92 popup_->Init(params); 92 popup_->Init(params);
93 93
94 views::View* root_view = popup_->GetRootView(); 94 views::View* root_view = popup_->GetRootView();
95 // The window color is a tiny bit off-white. 95 // The window color is a tiny bit off-white.
96 root_view->set_background( 96 root_view->set_background(
97 views::Background::CreateSolidBackground(0xfc, 0xfc, 0xfc)); 97 views::Background::CreateSolidBackground(0xfc, 0xfc, 0xfc));
98 98
99 views::GridLayout* layout = views::GridLayout::CreatePanel(root_view); 99 views::GridLayout* layout = views::GridLayout::CreatePanel(root_view);
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 result_ = TRY_CHROME_AS_DEFAULT; 358 result_ = TRY_CHROME_AS_DEFAULT;
359 } 359 }
360 360
361 popup_->Close(); 361 popup_->Close();
362 base::MessageLoop::current()->Quit(); 362 base::MessageLoop::current()->Quit();
363 } 363 }
364 364
365 void TryChromeDialogView::LinkClicked(views::Link* source, int event_flags) { 365 void TryChromeDialogView::LinkClicked(views::Link* source, int event_flags) {
366 ::ShellExecuteW(NULL, L"open", kHelpCenterUrl, NULL, NULL, SW_SHOW); 366 ::ShellExecuteW(NULL, L"open", kHelpCenterUrl, NULL, NULL, SW_SHOW);
367 } 367 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/ui/idle_app_name_notification_view.cc ('k') | chrome/browser/ui/views/fullscreen_exit_bubble_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698