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

Side by Side Diff: chrome/browser/views/first_run_bubble.cc

Issue 140023: Reverting 18872. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 6 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/views/first_run_bubble.h" 5 #include "chrome/browser/views/first_run_bubble.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "base/win_util.h" 9 #include "base/win_util.h"
10 #include "chrome/browser/browser.h" 10 #include "chrome/browser/browser.h"
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 if (::IsWindowEnabled(GetParent())) 336 if (::IsWindowEnabled(GetParent()))
337 InfoBubble::OnActivate(action, minimized, window); 337 InfoBubble::OnActivate(action, minimized, window);
338 } 338 }
339 339
340 void FirstRunBubble::InfoBubbleClosing(InfoBubble* info_bubble, 340 void FirstRunBubble::InfoBubbleClosing(InfoBubble* info_bubble,
341 bool closed_by_escape) { 341 bool closed_by_escape) {
342 // Make sure our parent window is re-enabled. 342 // Make sure our parent window is re-enabled.
343 if (!IsWindowEnabled(GetParent())) 343 if (!IsWindowEnabled(GetParent()))
344 ::EnableWindow(GetParent(), true); 344 ::EnableWindow(GetParent(), true);
345 enable_window_method_factory_.RevokeAll(); 345 enable_window_method_factory_.RevokeAll();
346 GetFocusManager()->RemoveFocusChangeListener(view_); 346 views::FocusManager* focus_manager =
347 views::FocusManager::GetFocusManager(GetNativeView());
348 focus_manager->RemoveFocusChangeListener(view_);
347 } 349 }
348 350
349 // static 351 // static
350 FirstRunBubble* FirstRunBubble::Show(Profile* profile, views::Window* parent, 352 FirstRunBubble* FirstRunBubble::Show(Profile* profile, views::Window* parent,
351 const gfx::Rect& position_relative_to, 353 const gfx::Rect& position_relative_to,
352 bool use_OEM_bubble) { 354 bool use_OEM_bubble) {
353 FirstRunBubble* window = new FirstRunBubble(); 355 FirstRunBubble* window = new FirstRunBubble();
354 FirstRunBubbleViewBase* view = NULL; 356 FirstRunBubbleViewBase* view = NULL;
355 if (use_OEM_bubble) 357 if (use_OEM_bubble)
356 view = new FirstRunOEMBubbleView(window, profile); 358 view = new FirstRunOEMBubbleView(window, profile);
357 else 359 else
358 view = new FirstRunBubbleView(window, profile); 360 view = new FirstRunBubbleView(window, profile);
359 window->SetDelegate(window); 361 window->SetDelegate(window);
360 window->set_view(view); 362 window->set_view(view);
361 window->Init(parent, position_relative_to, view); 363 window->Init(parent, position_relative_to, view);
362 window->ShowWindow(SW_SHOW); 364 window->ShowWindow(SW_SHOW);
363 window->GetFocusManager()->AddFocusChangeListener(view); 365 views::FocusManager* focus_manager =
366 views::FocusManager::GetFocusManager(window->GetNativeView());
367 focus_manager->AddFocusChangeListener(view);
364 view->BubbleShown(); 368 view->BubbleShown();
365 return window; 369 return window;
366 } 370 }
367 371
368 void FirstRunBubble::EnableParent() { 372 void FirstRunBubble::EnableParent() {
369 ::EnableWindow(GetParent(), true); 373 ::EnableWindow(GetParent(), true);
370 // Reactivate the FirstRunBubble so it responds to OnActivate messages. 374 // Reactivate the FirstRunBubble so it responds to OnActivate messages.
371 SetWindowPos(GetParent(), 0, 0, 0, 0, 375 SetWindowPos(GetParent(), 0, 0, 0, 0,
372 SWP_NOSIZE | SWP_NOMOVE | SWP_NOREDRAW | SWP_SHOWWINDOW); 376 SWP_NOSIZE | SWP_NOMOVE | SWP_NOREDRAW | SWP_SHOWWINDOW);
373 } 377 }
OLDNEW
« no previous file with comments | « chrome/browser/views/find_bar_win_browsertest.cc ('k') | chrome/browser/views/fullscreen_exit_bubble.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698