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

Side by Side Diff: chrome/browser/first_run/first_run.cc

Issue 11434074: browser: Move FindBrowserWithWebContents() into chrome namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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/first_run.h" 5 #include "chrome/browser/first_run/first_run.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 content::NotificationService::AllSources()); 510 content::NotificationService::AllSources());
511 } 511 }
512 512
513 FirstRunBubbleLauncher::~FirstRunBubbleLauncher() {} 513 FirstRunBubbleLauncher::~FirstRunBubbleLauncher() {}
514 514
515 void FirstRunBubbleLauncher::Observe( 515 void FirstRunBubbleLauncher::Observe(
516 int type, 516 int type,
517 const content::NotificationSource& source, 517 const content::NotificationSource& source,
518 const content::NotificationDetails& details) { 518 const content::NotificationDetails& details) {
519 DCHECK_EQ(type, content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME); 519 DCHECK_EQ(type, content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME);
520 Browser* browser = browser::FindBrowserWithWebContents( 520 Browser* browser = chrome::FindBrowserWithWebContents(
521 content::Source<content::WebContents>(source).ptr()); 521 content::Source<content::WebContents>(source).ptr());
522 if (!browser || !browser->is_type_tabbed()) 522 if (!browser || !browser->is_type_tabbed())
523 return; 523 return;
524 524
525 // Check the preference to determine if the bubble should be shown. 525 // Check the preference to determine if the bubble should be shown.
526 PrefService* prefs = g_browser_process->local_state(); 526 PrefService* prefs = g_browser_process->local_state();
527 if (!prefs || !prefs->GetBoolean(prefs::kShouldShowFirstRunBubble)) { 527 if (!prefs || !prefs->GetBoolean(prefs::kShouldShowFirstRunBubble)) {
528 delete this; 528 delete this;
529 return; 529 return;
530 } 530 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 564
565 // Reset the preference and notifications to avoid showing the bubble again. 565 // Reset the preference and notifications to avoid showing the bubble again.
566 prefs->SetBoolean(prefs::kShouldShowFirstRunBubble, false); 566 prefs->SetBoolean(prefs::kShouldShowFirstRunBubble, false);
567 567
568 // Show the bubble now and destroy this bubble launcher. 568 // Show the bubble now and destroy this bubble launcher.
569 browser->ShowFirstRunBubble(); 569 browser->ShowFirstRunBubble();
570 delete this; 570 delete this;
571 } 571 }
572 572
573 } // namespace first_run 573 } // namespace first_run
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_tab_util.cc ('k') | chrome/browser/history/history_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698